Planet readonly 2024-11-21T11:03:25Z Author jQuery UI : jQuery UI 1.14.1 released https://blog.jqueryui.com/2024/10/jquery-ui-1-14-1-released/ 2024-10-30T18:10:41+00:00 Michał Gołębiowski-Owczarek jQuery UI 1.14.1 has been released. It includes a fix for shrinking dialog contents on resizing with box-sizing set to content-box (issue #2277, PR #2281) and makes the tabs widget work correctly with IDs with backslashes (PR #2307). Dialog supports a new option: uiDialogTitleHeadingLevel. When set to a number between 1 & 6, it changes the current <span> wrapper of the dialog title into a heading element of a specified level (issue #2271, PR #2275). We’ve also enabled GitHub CodeQL checks and fixed a few reported issues.

Apart from that, there have been a number of fixes to demos available on jqueryui.com, mostly accounting for the back compat flag being off by default.

If you’re still on jQuery UI 1.13.x, see the jQuery UI 1.14.0 release blog post to learn about the changes in the 1.14.x line.

Supported jQuery versions

This release has been tested against jQuery 1.12.4, 2.2.4, 3.6.4 & 3.7.1. Since jQuery follows semver, newer jQuery <4 versions within each major version line should generally work as well.

jQuery UI 1.14.1 triggers no jQuery Migrate warnings when running its test suite against jQuery 3.7.1 with jQuery Migrate 3.5.2, i.e. the latest versions at the time of this release.

Reminder about maintenance state

Please remember jQuery UI is in a maintenance state: we’ll make sure the library is compatible with new jQuery releases and that security issues are fixed but no new significant feature work is planned. We’ll also try to fix important regressions from jQuery UI 1.12.1; older long-standing bugs may not get fixed. Note that this does not affect jQuery Core which is still actively maintained.

Download

File Downloads

Git (contains source files, with @VERSION replaced with 1.14.1, base theme only)

Install via npm

  • npm install jquery-ui@1.14.1

Install via bower

  • bower install jquery/jquery-ui#1.14.1

jQuery CDN

Google Ajax Libraries API (CDN)

Microsoft Ajax CDN (CDN)

Custom Download Builder

Changelog

See the 1.14 Upgrade Guide for a list of changes that may affect you when upgrading from 1.13.x. For full details on what’s included in this release see the 1.14.1 Changelog.

Thanks

Thanks to all who helped with this release, specifically: Daniel García, Michał Gołębiowski-Owczarek, Ralf Koller, Timmy Willison & Felix Nagel.

Comments

Note: please report bugs to the jQuery UI Bug Tracker; support questions should be posted on Stack Overflow with the jquery-ui tag.

]]>
jQuery UI : jQuery UI 1.14.0 released https://blog.jqueryui.com/2024/08/jquery-ui-1-14-0-released/ 2024-08-05T23:00:51+00:00 Michał Gołębiowski-Owczarek We are happy to announce the 1.14.0 stable release! The focus of this release is reducing the maintenance burden to ensure important issues are addressed, as outlined in the blog post about plans for jQuery UI 1.14. As of today, the jQuery UI 1.13.x line is no longer supported.

Reduced support for older browsers or jQuery

jQuery UI 1.14 finally drops support for all versions of Internet Explorer & Edge Legacy. Only the latest version of Chrome, Firefox, Safari & Edge are officially supported. Contrary to what we did in past releases, code supporting unsupported browsers has been deleted.

Support for jQuery 1.7-1.11, 2.0-2.1 & 3.0-3.5 has been dropped.

This release has been tested against jQuery 1.12.4, 2.2.4, 3.6.4 & 3.7.1. Since jQuery follows semver, newer jQuery <4 versions within each major version line should generally work as well.

jQuery UI 1.14 triggers no jQuery Migrate warnings when running its test suite against jQuery 3.7.1 with jQuery Migrate 3.5.2, i.e. the latest versions at the time of this release.

Breaking changes

Backward compatibility with the 1.11 API is disabled by default. To enable it (restoring the default 1.13 behavior), set the jQuery.uiBackCompat flag to true. We encourage trying without the compatibility layer, though – maybe your app is already using new APIs exclusively? If there are any feature gaps from the old APIs, please submit issues.

A few APIs have been removed as they were no longer needed after dropping IE support: $.fn._form, $.ui.ie, $.ui.safeActiveElement & $.ui.safeBlur. See the 1.14 Upgrade Guide for information about replacements.

The Download Builder now only supports jQuery UI 1.12 & newer. This change happened independently from the jQuery UI 1.14 release, but it’s worth reminding.

Feature: aria-modal support in the dialog widget

Modal dialogs now get the aria-modal=”true” attribute added. Thanks to that, modal dialogs cause the elements outside of the dialog to be excluded from the accessibility tree, making some accessibility tools more useful. See issue #2246 for more information.

Test infrastructure changes

jQuery UI 1.14 is tested in all supported browsers & jQuery Core versions not only post-merge as was done in the past, but also on every pull request via GitHub Actions. That should make contributing to jQuery UI easier.

This improvement was made possible by a major rewrite of jQuery UI test infrastructure, which removed all deprecated or under-supported dependencies.

Reminder about maintenance state

Please remember jQuery UI is in a maintenance state: we’ll make sure the library is compatible with new jQuery releases and that security issues are fixed but no new significant feature work is planned. We’ll also try to fix important regressions from jQuery UI 1.12.1; older long-standing bugs may not get fixed. Note that this does not affect jQuery Core which is in active development.

Download

File Downloads

Git (contains source files, with @VERSION replaced with 1.14.0, base theme only)

Install via bower

  • bower install jquery/jquery-ui#1.14.0

jQuery CDN

Google Ajax Libraries API (CDN)

Microsoft Ajax CDN (CDN)

Custom Download Builder

Changelog

See the 1.14 Upgrade Guide for a list of changes that may affect you when upgrading from 1.13.x. For full details on what’s included in this release see the 1.14.0 Changelog.

Thanks

Thanks to all who helped with this release, specifically: Michał Gołębiowski-Owczarek, Porter Clevidence, Ralf Koller, Timmy Willison, and Felix Nagel.

Comments

Note: please report bugs to the jQuery UI Bug Tracker; support questions should be posted on Stack Overflow with the jquery-ui tag. Please don’t use comments to report bugs.

If you have feedback on us doing our release for jQuery UI 1.14.0, feel free to leave a comment below. Thank you.

]]>
jQuery : Second Beta of jQuery 4.0.0 https://blog.jquery.com/2024/07/17/second-beta-of-jquery-4-0-0/ 2024-07-17T16:03:14+00:00 Timmy Willison

Last February, we released the first beta of jQuery 4.0.0. We’re now ready to release a second, and we expect a release candidate to come soon™. This release comes with a major rewrite to jQuery’s testing infrastructure, which removed all deprecated or under-supported dependencies. But the main change that warranted a second beta was a fix to the exports field for bundlers. More on that and other changes below.

Many of the breaking changes in jQuery 4.0.0 are ones the team has wanted to make for years, but couldn’t in a patch or minor release. We’ve trimmed legacy code (including removing support for IE before version 11), removed some previously-deprecated APIs, removed some internal-only parameters to public functions that were never documented, and dropped support for some “magic” behaviors that were overly complicated.

We will publish a comprehensive upgrade guide before final release, to outline the removed code and how to migrate. The jQuery Migrate plugin will also be ready to assist. For now, please try out this release and let us know if you encounter any issues.

As usual, the release is available on our CDN and the npm package manager. Third party CDNs will not be hosting this beta release, but will host the 4.0.0 final release later. Here are some highlights for jQuery 4.0.0 beta.2.

CommonJS + ESM: Strange Bedfellows

There are many different ways to include jQuery in a project. Supporting all of them can be difficult, especially when the environment supports both CommonJS and ESM modules. We wanted to support all of the ways jQuery might be included, whether using a named export or the default export. Also, we wanted to ensure jQuery was only ever included once, even when jQuery was both imported using ESM and required using CommonJS in the same environment or bundle. We think we’ve worked out a solution that supports Node.js and bundlers like rollup, webpack, and parcel. More details can be found in the PR. Also, we created a wiki page to explain how the exports property in jQuery’s package.json will work in 4.0.

Boolean Attributes: To Be Or …

The HTML spec defines boolean attributes that often correlate with boolean properties. If the attribute is missing, it correlates with the false property value, if it’s present – the true property value. The only valid values for boolean content attributes are empty string or the full attribute name (e.g. checked="checked").

jQuery has historically tried to be helpful here and treated boolean attributes in a special way in the .attr() API:

  1. For the getter, as long as the attribute was present, it was returning the
    attribute name lowercased, ignoring the value.
  2. For the setter, it was removing the attribute when false was passed;
    otherwise, it was ignoring the passed value and set the attribute –
    interestingly, in jQuery >=3 not lowercased anymore.

The problem is the spec occasionally converts boolean attributes into ones with additional attribute values with special behavior – one such example is the new "until-found" value for the hidden attribute. Our setter normalization meant passing those values was impossible with .attr() (.prop() was unaffected). Also, new boolean attributes were introduced occasionally and jQuery could not easily add them to the list without incurring breaking changes.

This patch removes any special handling of boolean attributes – the getter returns the value as-is and the setter sets the provided value, with one exception. To maintain backwards compatibility, this patch makes the false boolean value trigger attribute removal for ALL non-ARIA attributes. For example, .attr( "checked", false ) will continue to remove the checked attribute, which is the only way the corresponding property will be set to false. ARIA attributes are exempt from the rule since many of them recognize the string "false" as a valid value with semantics different than the attribute missing. To remove an ARIA attribute, use .removeAttr() or pass null as the value to .attr().

Position of Elements In Tables

jQuery 4.0.0-beta.2 also fixes some inconsistent behavior when finding the position of elements within tables. The offset parent on which the position was based could change depending on whether the element’s position style was static or relative.

<div id="container" style="position: relative;">
    <table>
        <tr>
            <td>
                <span id="static"></span>
                <span id="relative" style="position: relative;"></span>
            </td>
        </tr>
    </table>
</div>

Previously, $('#static').position() was returning the position relative to the containing <td> element, while $('#relative').position() was returning the position relative to #container.

Now, both elements return their position relative to #container.

Download

You can get the files from the jQuery CDN, or link to them directly:

https://code.jquery.com/jquery-4.0.0-beta.2.js

https://code.jquery.com/jquery-4.0.0-beta.2.min.js

You can also get this release from npm:

npm install jquery@4.0.0-beta.2

Slim build

Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for web animations. Finally, all of jQuery’s supported browsers (except for IE11) now have support for native Promises across the board, so Deferreds and Callbacks are no longer needed in most cases. Along with the regular version of jQuery that includes everything, we’ve released a “slim” version that excludes these modules. The size of jQuery is very rarely a load performance concern these days, but the slim build is about 8k gzipped bytes smaller than the regular version. These files are also available in the npm package and on the CDN:

https://code.jquery.com/jquery-4.0.0-beta.2.slim.js

https://code.jquery.com/jquery-4.0.0-beta.2.slim.min.js

These updates are already available as the current versions on npm. Information on all the ways to get jQuery is available at https://jquery.com/download/. Public CDNs receive their copies today, please give them a few days to post the files. If you’re anxious to get a quick start, use the files on our CDN until they have a chance to update.

Thanks

Thank you to all of you who participated in this release by submitting patches, reporting bugs, or testing, including Michał Gołębiowski-Owczarek, J.Son, Liam James and the whole jQuery team.

We’re on Mastodon!

jQuery has a Mastodon account! We now post releases and other updates to both X and Mastodon. Also, you may be interested in following some of our team members that have Mastodon accounts.

jQuery: https://social.lfx.dev/@jquery

mgol: https://hachyderm.io/@mgol

timmywil: https://hachyderm.io/@timmywil

Changelog

Full changelog: 4.0.0-beta.2

Attributes

  • Make .attr( name, false ) remove for all non-ARIA attrs (#5388, 063831b6)

Build

  • Bump the github-actions group with 2 updates (3a98ef91)
  • upgrade dependencies; fix bundler tests on windows (cb8ab6cc)
  • improve specificity of eslint config; add ecma versions (74970524)
  • Bump the github-actions group with 2 updates (46b9e480)
  • Group dependabot PRs updating GitHub Actions (3cac1465)
  • Bump actions/cache, actions/checkout & github/codeql-action (df1df950)
  • Bump express from 4.18.3 to 4.19.2 (691c0aee)
  • make compare size cache readable for manual edits (783c9d69)
  • fix size comparison for slim files when the branch is dirty (8a3a74c4)
  • migrate more uses of fs.promises; use node: protocol (ae7f6139)
  • Bump github/codeql-action from 3.24.0 to 3.24.6 (ae67ace6)
  • Bump actions/cache from 4.0.0 to 4.0.1 (68f772e0)
  • drop support for Node 10 (5aa7ed88)
  • add GitHub Actions workflow to update Filestash (0293d3e3)
  • update jenkins script to only build (c21c6f4d)
  • Bump actions/cache & github/codeql-action (#5402) (bf11739f)

CSS

  • Tests: Fix tests & support tests under CSS Zoom (#5489, 071f6dba)

Core

  • Fix the exports setup to make bundlers work with ESM & CommonJS (#5416, 60f11b58)

Docs

  • Update remaining HTTP URLs to HTTPS (7cdd8374)

Event

  • Increase robustness of an inner native event in leverageNative (#5459, 527fb3dc)

Offset

  • Increase search depth when finding the 'real' offset parent (556eaf4a)

Release

Tests

  • remove unnecessary scroll feature test (ea31e4d5)
  • Align :has selector tests with 3.x-stable (f2d9fde5)
  • revert concurrency group change (fa73e2f1)
  • include github ref in concurrency group (5880e027)
  • Make the beforeunload event tests work regardless of extensions (399a78ee)
  • share queue/browser handling for all worker types (284b082e)
  • improve diffing for values of different types (b9d333ac)
  • show any and all actual/expected values (f80e78ef)
  • add diffing to test reporter (44fb7fa2)
  • add actual and expected messages to test reporter (1e84908b)
  • fix worker restarts for failed browser acknowledgements (fedffe74)
  • add –hard-retries option to test runner (822362e6)
  • fix cleanup in cases where server doesn't stop (0754d596)
  • fix flakey message logs; ignore delete worker failures (02d23478)
  • reuse browser workers in BrowserStack tests (#5428) (95a4c94b)
  • Use allowlist instead of whitelist (2b97b6bb)
  • migrate testing infrastructure to minimal dependencies (dfc693ea)
  • Fix Karma tests on Node.js 20 (d478a1c0)
]]>
jQuery UI : jQuery UI 1.14.0-beta.2 released https://blog.jqueryui.com/2024/06/jquery-ui-1-14-0-beta-2-released/ 2024-06-15T01:32:33+00:00 Michał Gołębiowski-Owczarek Following up on our blog post on Plans for jQuery UI 1.14, it is our pleasure to announce the second beta for jQuery UI 1.14.0.

Compared to the first beta, there are two main changes:

  • Support for aria-modal attribute in dialogs have been added (PR #2257).
  • The release is now fully supported in the jQuery UI Download Builder; zip files are also available.

We’ve also finalized the migration from the TestSwarm test runner to our custom one integrated into GitHub Actions.

See the jQuery UI 1.14.0-beta.1 blog post for information about changes already available in the first beta.

Please remember jQuery UI is in a maintenance state. We’ll make sure the library is compatible with new jQuery releases and that security issues are fixed but no new significant feature work is planned. We’ll also try to fix important regressions from jQuery UI 1.12.1; older long-standing bugs may not get fixed. Note that this does not affect jQuery Core, which is still actively maintained.

Download

File Downloads

Git (contains source files, with @VERSION replaced with 1.14.0-beta.2, base theme only)

Install via npm

  • npm install jquery-ui@1.14.0-beta.2

Install via bower

  • bower install jquery/jquery-ui#1.14.0-beta.2

jQuery CDN

Changelog

For full details on what’s included in this release see the 1.14.0-beta.2 Changelog. The 1.14 Upgrade Guide will be available later.

Thanks

Thanks to all who helped with this release, specifically: Ralf Koller, Michał Gołębiowski-Owczarek, Timmy Willison.

Comments

Note: Please report bugs to the jQuery UI Bug Tracker. Support questions should be posted on Stack Overflow with the jquery-ui tag.

]]>
jQuery UI : jQuery UI 1.14.0-beta.1 released https://blog.jqueryui.com/2024/05/jquery-ui-1-14-0-beta-1-released/ 2024-05-16T00:24:42+00:00 Michał Gołębiowski-Owczarek Following up on our blog post on Plans for jQuery UI 1.14, it is our pleasure to announce the first beta for jQuery UI 1.14.0.

This release doesn’t offer any new features, only the following breaking changes:

  • Only the latest version of Chrome, Firefox, Safari & Edge are officially supported; there is no support for any version of IE and Edge Legacy. Contrary to what was done in past releases, code supporting unsupported browsers has been deleted.
  • Only the latest jQuery version within each major version of jQuery Core is supported. This beta was tested against jQuery 1.12.4, 2.2.4 & 3.7.1, plus two development versions: 3.x & 4.x.
  • Backwards compatibility with the 1.11 API is disabled by default. To re-enable it (restoring the default 1.13 behavior) set the jQuery.uiBackCompat flag to true.

This beta is not integrated into the jQuery UI Download Builder; support for jQuery UI 1.14 will be added before the final release. Because of that, zip bundles are not available for this beta.

We’d also like to remind you that beginning in June 2024, the Download Builder will only support jQuery UI 1.12 or newer. For more information, please read the Plans for jQuery UI 1.14 blog post.

Please remember jQuery UI is in a maintenance state. We’ll make sure the library is compatible with new jQuery releases and that security issues are fixed but no new significant feature work is planned. We’ll also try to fix important regressions from jQuery UI 1.12.1; older long-standing bugs may not get fixed. Note that this does not affect jQuery Core, which is still actively maintained.

Download

Git (contains source files, with @VERSION replaced with 1.14.0-beta.1, base theme only)

Install via npm

  • npm install jquery-ui@1.14.0-beta.1

Install via bower

  • bower install jquery/jquery-ui#1.14.0-beta.1

jQuery CDN

Changelog

For full details on what’s included in this release see the 1.14.0-beta.1 Changelog. The 1.14 Upgrade Guide will be available later.

Thanks

Thanks to all who helped with this release, specifically: Michał Gołębiowski-Owczarek, Timmy Willison, Felix Nagel.

Comments

Note: Please report bugs to the jQuery UI Bug Tracker. Support questions should be posted on Stack Overflow with the jquery-ui tag.

]]>
jQuery UI : Plans for jQuery UI 1.14, dropping support for UI &lt;1.12 in the Download Builder https://blog.jqueryui.com/2024/04/plans-for-jquery-ui-1-14-dropping-support-for-ui-1-12-in-the-download-builder/ 2024-04-30T20:32:18+00:00 Michał Gołębiowski-Owczarek jQuery UI has been in maintenance mode since 2021. We are prioritizing security issues & regressions from jQuery UI 1.12, with occasional fixes contributed by the community. That said, maintaining jQuery UI still takes a significant effort. This is caused by many moving pieces:

  • jQuery UI 1.13 supports jQuery 1.8 & newer. This means jQuery UI is currently tested against every major and minor jQuery release since jQuery 1.8, in all supported browsers, and in development versions of jQuery. This amounts to 18 test variants in total.
  • jQuery UI is tested against the latest two versions of Chrome, Firefox, Safari, Opera & Edge, Edge Legacy & IE 11.
  • The Download Builder supports jQuery UI 1.9 & newer – that’s 5 versions, the older of which was first released in 2012. Each of those versions has custom builder code that needs maintenance.
  • Most of the testing is only done post-commit; PRs have had limited testing so far.

The above issues, combined with the fact very few people work on jQuery UI in their limited time, result in delays—1 year and 9 months have passed between the 1.13.2 and 1.13.3 releases. If we want to continue supporting jQuery UI, we need to reduce some of this complexity.

We are planning the following changes to ease the maintenance effort:

  • Beginning in June, 2024, the Download Builder will only support jQuery UI 1.12 or newer. If you rely on built-in themes, you’ll still be able to download full builds of previous releases from the releases page after this date.
  • jQuery UI 1.14 will only be tested on the latest version of Chrome, Firefox, Safari & Edge. It will not support IE and Edge Legacy. Contrary to what was done in past releases, code supporting unsupported browsers will be deleted.
  • Only the latest jQuery version within each major version of jQuery Core will be supported. As of the publication date of this blog post, that would be jQuery 1.12.4, 2.2.4 & 3.7.1, plus two development versions: 3.x & 4.x.
  • All browsers supported by jQuery UI 1.14 will be tested on PRs via the same custom test runner as jQuery Core. This will help catch issues before problematic code gets merged. In fact, this change has already landed!
  • jQuery UI 1.14 will have the jQuery.uiBackCompat flag set to false. We are not planning new big compatibility breaks and this will help people discover accidental reliance on deprecated behaviors.
  • Support for jQuery UI 1.13 will end on the day jQuery UI 1.14.0 is released.

We understand these changes may be disrupting for some teams. However, we need to balance limited resources with still being able to address more important issues. We think the above plan is the best way to achieve this goal.

]]>
jQuery UI : jQuery UI 1.13.3 released https://blog.jqueryui.com/2024/04/jquery-ui-1-13-3-released/ 2024-04-26T23:32:28+00:00 Michał Gołębiowski-Owczarek We’re happy to announce the third patch release to jQuery UI 1.13 is out. It includes fixes for the resizable widget when a global box-sizing: border-box CSS declaration is present (a common complaint was about resizable dialogs), support for the hidden attribute in selectmenu options, fixes for the deprecated -ms-filter syntax, and correcting the format of the deprecated ui/core.js AMD module.

jQuery UI has a new test runner ported from jQuery that allows local & BrowserStack test runs without reliance on Karma. As an added bonus, we’re now running tests against Chrome, Firefox, Safari & Edge against latest jQuery 1.x, 2.x, 3.x & the development version in GitHub CI, allowing to detect more issues at the pull request level. This will also be a basis for a future jQuery UI 1.14 – but that’s a topic for a separate blog post.

Please remember jQuery UI is in a maintenance state: we’ll make sure the library is compatible with new jQuery releases and that security issues are fixed but no new significant feature work is planned. We’ll also try to fix important regressions from jQuery UI 1.12.1; older long-standing bugs may not get fixed. Note that this does not affect jQuery Core which is still actively maintained.

Download

File Downloads

Git (contains source files, with @VERSION replaced with 1.13.3, base theme only)

Install via npm

  • npm install jquery-ui@1.13.3

Install via bower

  • bower install jquery/jquery-ui#1.13.3

jQuery CDN

Google Ajax Libraries API (CDN)

Microsoft Ajax CDN (CDN)

Custom Download Builder

Changelog

See the 1.13 Upgrade Guide for a list of changes that may affect you when upgrading from 1.12.x. For full details on what’s included in this release see the 1.13.3 Changelog.

Thanks

Thanks to all who helped with this release, specifically: Ashish Kurmi, DeerBear, divdeploy, Kenneth DeBacker, mark van tilburg, Matías Cánepa, Michał Gołębiowski-Owczarek, Timmy Willison, Timo Tijhof, Дилян Палаузов, Felix Nagel.

Comments

Note: please report bugs to the jQuery UI Bug Tracker; support questions should be posted on Stack Overflow with the jquery-ui tag.

]]>
jQuery : Upgrading jQuery: Working Towards a Healthy Web https://blog.jquery.com/2024/04/17/upgrading-jquery-working-towards-a-healthy-web/ 2024-04-17T19:00:00+00:00 Timmy Willison jQuery’s influence on the web will always be evident. When it was first introduced in 2006, jQuery became a fundamental tool for web developers almost immediately. It simplified JavaScript programming, making it easier to manipulate HTML documents, handle events, perform animations, and much more. Since then, it has played and continues to play a major role in the evolution of web standards and browser capabilities.

With the rise of modern JavaScript frameworks, fewer developers may be choosing to use jQuery for new projects, but worldwide usage is still extremely high. After analyzing the results of a survey conducted by IDC, the OpenJS Foundation estimated that 90% of all websites use jQuery. And about a third of those use an outdated version.

The jQuery Team and OpenJS Foundation are working to fix that as part of the Healthy Web checkup campaign. This guide will explain why it is important to keep your jQuery version up to date and walk you through the process of upgrading jQuery.

Why Is Upgrading jQuery Important for Security?

Security Vulnerabilities: Like any software, jQuery may contain security vulnerabilities in its codebase. These vulnerabilities can range from Cross-Site Scripting (XSS) vulnerabilities to more severe issues like Remote Code Execution (RCE). As vulnerabilities are discovered, the jQuery team releases patches and updates to address them. By upgrading to the latest version of jQuery, you ensure that your application benefits from these security fixes, reducing the risk of exploitation by attackers.

Security Best Practices: Newer versions of jQuery often incorporate security best practices and enhancements to mitigate common security threats. These improvements may include stricter input validation, improved handling of user-generated content, and better protection against XSS attacks. By upgrading, you adopt these best practices and strengthen the security posture of your application.

Compliance Requirements: Many industries and regulatory frameworks require organizations to maintain up-to-date software and address known security vulnerabilities promptly. Failure to upgrade jQuery and address security issues could lead to non-compliance with these requirements.

What About Browser Support?

jQuery 1.x, 2.x, and 3.x each have a different list of supported browsers. However, given current browser market usage, the browsers that jQuery 3.x supports, which includes IE 9+, should be sufficient in almost all cases. jQuery 4.x will still support IE11, even though Microsoft announced it is officially out of support.

How Do I Upgrade jQuery?

The jQuery Team provides the jQuery Migrate plugin to make upgrading jQuery as easy as possible. It is mainly meant as a development tool that generates warning messages in the browser console that can be used to identify and fix compatibility issues. It temporarily restores deprecated features and behaviors so that older code will still run on newer versions of jQuery while the compatibility issues are addressed.

There are two versions of jQuery Migrate: 1.x and 3.x (there is no Migrate 2.x). Only one version should be used at a time, but you may need to use both in succession if upgrading from a jQuery version that predates jQuery 1.9.

For example, if your current jQuery version is 1.4.4, first use jQuery Migrate 1.x to upgrade to jQuery 1.12.4 and then use jQuery Migrate 3.x to upgrade to the latest jQuery (3.7.1, as of this writing). If your current version is 2.2.4, you only need to use jQuery Migrate 3.x to upgrade to the latest jQuery.

Using jQuery Migrate

First, add jQuery Migrate to your page *after* loading jQuery.

<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://code.jquery.com/jquery-migrate-3.4.1.js"></script>

Then, test your website or application. As different jQuery APIs are used, jQuery Migrate will log messages to the console warning about any deprecations or breaking changes. Address each warning one at a time.

Finally, when no more warnings are logged to the console and all breaking changes have been addressed, the jQuery Migrate can be removed and migration is complete!

See the jQuery Migrate README for more details.

jQuery Upgrade Guides

The jQuery Upgrade Guides can be helpful when you’re looking for more details on a breaking change, or you just want to see the full list of breaking changes for each version. There are upgrade guides for jQuery 1.9, 3.0 and 3.5 that list all of the breaking changes that happened in those releases. Most of the breaking changes listed will probably not apply to your code, but these guides add some context and explanation for each change.

A Note on Future jQuery Versions

With jQuery 4.0 on the horizon, you may wonder what the process will be for upgrading to jQuery 4.x. The answer is that it will be the same as upgrading to jQuery 3.x and it can still be done in one step. In other words, there will be no need to upgrade to jQuery 3.x before upgrading to jQuery 4.x. You will be able to upgrade straight from 1.9+ to jQuery 4.x. We will also have an upgrade guide ready for jQuery 4.0.

Conclusion

Upgrading jQuery is essential for maintaining the security, performance, and compatibility of your web applications. By following the steps outlined in this guide, you can safely upgrade to the latest version of jQuery and take advantage of its new features and improvements while ensuring that your web application remains protected against any discovered vulnerabilities. Remember to regularly check for updates and stay informed about new releases to keep your codebase up to date.

]]>
jQuery : jQuery 4.0.0 BETA! https://blog.jquery.com/2024/02/06/jquery-4-0-0-beta/ 2024-02-06T17:43:14+00:00 Timmy Willison

jQuery 4.0.0 has been in the works for a long time, but it is now ready for a beta release! There’s a lot to cover, and the team is excited to see it released. We’ve got bug fixes, performance improvements, and some breaking changes. We removed support for IE<11 after all! Still, we expect disruption to be minimal.

Many of the breaking changes are ones the team has wanted to make for years, but couldn’t in a patch or minor release. We’ve trimmed legacy code, removed some previously-deprecated APIs, removed some internal-only parameters to public functions that were never documented, and dropped support for some “magic” behaviors that were overly complicated.

We will publish a comprehensive upgrade guide before final release, to outline the removed code and how to migrate. The jQuery Migrate plugin will also be ready to assist. For now, please try out the beta release and let us know if you encounter any issues.

As usual, the release is available on our CDN and the npm package manager. Third party CDNs will not be hosting this beta release, but will host the 4.0.0 final release later. Here are some highlights for jQuery 4.0.0 beta.

Goodbye IE<11

jQuery 4.0 drops support for IE 10 and older. Some may be asking why we didn’t remove support for IE 11. We plan to remove support in stages, and the next step will be released in jQuery 5.0. For now, we’ll start by removing code specifically supporting IE versions older than 11, giving us a size reduction of 867 gzipped bytes in one PR!

We also dropped support for other very old browsers, including Edge Legacy, iOS <11, Firefox <65, and Android Browser. No changes should be required on your end. If you need to support any of these browsers, simply stick with jQuery 3.x.

Deprecated APIs removed

These functions have been deprecated for several versions. It’s time to remove them now that we’ve reached a major release. These functions were either always meant to be internal or ones that now have native equivalents in all supported browsers. The removed functions are:

push, sort, and splice removed

The jQuery prototype has long had Array methods that did not behave like any other jQuery methods and were always meant for internal-use only. These methods are push, sort, and splice. We switched our uses of these methods to Array functions instead of the jQuery prototype. For example, $elems.push( elem ) became [].push.call( $elems, elem ). We’re mentioning it here in case there are any plugins out there that may have relied on these methods.

focusin and focosout event order

For a long time, browsers did not agree on the order of focus and blur events, which includes focusin, focusout, focus, and blur. Finally, the latest versions of all browsers that jQuery 4.0 supports have converged on a common event order. Unfortunately, it differs from the consistent order that jQuery had chosen years ago, which makes this a breaking change. At least everyone is the on the same page now!

jQuery’s order for all four events in previous versions was:

1. focusout
2. blur
3. focusin
4. focus

Starting with jQuery 4.0, we no longer override native behavior. This means that all browsers except IE will follow the current W3C specification, which is:

1. blur
2. focusout
3. focus
4. focusin

For those that are curious, the W3C specification previously defined a different order:

1. focusout
2. focusin
3. blur
4. focus

But, few thought that intuitive and the spec was changed in 2023 to match what browsers have already implemented. Ironically, the only browser to ever follow the old spec was Internet Explorer.

FormData support

jQuery.ajax has added support for binary data, including FormData. Previously, binary data was not a known data type and was converted to a string. That behavior could be disabled by disabling data conversion and handling the data manually, but we decided to make this work automatically. This is technically a breaking change, but should be closer to expected behavior.

Automatic JSONP promotion removed

Previously, jQuery.ajax with dataType: "json" with a provided callback would be converted to a JSONP request. Today, the preferred way to interact with a cross-domain backend is with CORS, which works in all browsers that jQuery 4.0 supports. This should help avoid unexpected behavior in case a developer is unaware that code can be executed from a remote domain with JSONP.

jQuery source migrated to ES modules

It was a special day when the jQuery source on the main branch was migrated from AMD to ES modules. The jQuery source has always been published with jQuery releases on npm and GitHub, but could not be imported directly as modules without RequireJS, which was jQuery’s build tool of choice. We have since switched to Rollup for packaging jQuery and we do run all tests on the ES modules separately.

Trusted Types and CSP

jQuery 4.0 adds support for Trusted Types, ensuring that HTML wrapped in TrustedHTML can be used as input to jQuery manipulation methods in a way that doesn’t violate the require-trusted-types-for Content Security Policy directive.

Along with this, while some AJAX requests were already using <script> tags to maintain attributes such as crossdomain, we have since switched most asynchronous script requests to use <script> tags to avoid any CSP errors caused by using inline scripts. There are still a few cases where XHR is used for asynchronous script requests, such as when the "headers" option is passed (use scriptAttrs instead!), but we now use a <script> tag whenever possible.

Updated slim build

The slim build has gotten even smaller in jQuery 4.0.0 with the removal of Deferreds and Callbacks (now below 20k bytes gzipped!). Deferreds have long-supported the Promises A+ standard, so native Promises can be used instead in most cases and they are available in all of jQuery’s supported browsers except IE11. Deferreds do have some extra features that native Promises do not support, but most usage can be migrated to Promise methods. If you need to support IE11, it’s best to use the main build or add a polyfill for native Promises.

Download

You can get the files from the jQuery CDN, or link to them directly:

https://code.jquery.com/jquery-4.0.0-beta.js

https://code.jquery.com/jquery-4.0.0-beta.min.js

You can also get this release from npm:

npm install jquery@4.0.0-beta

Slim build

Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for web animations. Finally, all of jQuery’s supported browsers (except for IE11) now have support for native Promises across the board, so Deferreds and Callbacks are no longer needed in most cases. Along with the regular version of jQuery that includes everything, we’ve released a “slim” version that excludes these modules. The size of jQuery is very rarely a load performance concern these days, but the slim build is about 8k gzipped bytes smaller than the regular version. These files are also available in the npm package and on the CDN:

https://code.jquery.com/jquery-4.0.0-beta.slim.js

https://code.jquery.com/jquery-4.0.0-beta.slim.min.js

These updates are already available as the current versions on npm and Bower. Information on all the ways to get jQuery is available at https://jquery.com/download/. Public CDNs receive their copies today, please give them a few days to post the files. If you’re anxious to get a quick start, use the files on our CDN until they have a chance to update.

Thanks

Thank you to all of you who participated in this release by submitting patches, reporting bugs, or testing, including Alex, Ahmed S. El-Afifi, fecore1, Dallas Fraser, Richard Gibson, Michał Gołębiowski-Owczarek, Pierre Grimaud, Gabriela Gutierrez, Jonathan, Necmettin Karakaya, Anders Kaseorg, Wonseop Kim, Simon Legner, Shashanka Nataraj, Pat O’Callaghan, Christian Oliff, Dimitri Papadopoulos Orfanos, Wonhyoung Park, Bruno PIERRE, Baoshuo Ren, Beatriz Rezener, Sean Robinson, Ed Sanders, Timo Tijhof, Tom, Christian Wenz, ygj6 and the whole jQuery team.

We’re on Mastodon!

jQuery now has its very own Mastodon account. We will be cross posting to both Twitter and Mastodon from now on. Also, you may be interested in following some of our team members that have Mastodon accounts.

jQuery: https://social.lfx.dev/@jquery

mgol: https://hachyderm.io/@mgol

timmywil: https://hachyderm.io/@timmywil

Changelog

Full changelog: 4.0.0-beta

Ajax

  • Don’t treat array data as binary (992a1911)
  • Allow `processData: true` even for binary data (ce264e07)
  • Support binary data (including FormData) (a7ed9a7b)
  • Support `headers` for script transport even when cross-domain (#5142, 6d136443)
  • Support `null` as success functions in `jQuery.get` (#4989, 74978b7e)
  • Don’t auto-execute scripts unless dataType provided (#4822, 025da4dd)
  • Make responseJSON work for erroneous same-domain JSONP requests (68b4ec59)
  • Execute JSONP error script responses (#4771, a1e619b0)
  • Avoid CSP errors in the script transport for async requests (#3969, 07a8e4a1)
  • Drop the json to jsonp auto-promotion logic (#1799, #3376, e7b3bc48)
  • Overwrite s.contentType with content-type header value, if any (#4119, 7fb90a6b)
  • Deprecate AJAX event aliases, inline event/alias into deprecated (23d53928)
  • Do not execute scripts for unsuccessful HTTP responses (#4250, 50871a5a)
  • Simplify jQuery.ajaxSettings.xhr (#1967, abdc89ac)

Attributes

  • Shave off a couple of bytes (b40a4807)
  • Don’t stringify attributes in the setter (#4948, 4250b628)
  • Drop the `toggleClass(boolean|undefined)` signature (#3388, a4421101)
  • Refactor val(): don’t strip carriage return, isolate IE workarounds (ff281991)
  • Don’t set the type attr hook at all outside of IE (9e66fe9a)

build

  • set up periodic code scanning analysis (39c5778c)

Build

  • migrate grunt authors to a custom script (af79c999)
  • Bump follow-redirects from 1.15.1 to 1.15.4 (56139394)
  • Bump actions/setup-node and github/codeql-action (99151d7a)
  • Reformat GitHub workflow Yaml files (c98597ea)
  • Bump @babel/traverse & multiple actions (fb0cc272)
  • Don’t run CI push workflows for dependabot branches (635cb152)
  • Update ESLint-related packages, fix linting errors (f47c6a83)
  • Run pretest before test:* npm scripts (1ad66aeb)
  • sort branches in compare_size; last run last (a7fa303f)
  • run pretest in jenkins script (cb763072)
  • fix inconsistent builds in Node 20 (7ef9099d)
  • add commit SHAs and last runs to comparisons (09972bcc)
  • add new factory files to dist eslint (79223841)
  • Bump qs, socket.io-parser, socket.io & json5 (b923047d)
  • migrate most grunt tasks off of grunt (2bdecf8b)
  • Bump actions/checkout, actions/setup-node & github/codeql-action (42e50f8c)
  • Update mailmap entry for Krinkle (699bcd39)
  • replace CRLF with LF during minify (48cc402a)
  • Add `exports` to package.json, export slim & esm builds (#4592, 8be4c0e4)
  • Switch form Terser to SWC for JS minification (#5286) (#5285, e2421875)
  • Make sure `*.cjs` & `*.mjs` files use UNIX line endings as well (198b41c8)
  • switch preferred email for timmywil (2b6b5e0a)
  • Bump github/codeql-action & actions/checkout (4a13266e)
  • Drop individual AMD modules (5701957b)
  • Reference GitHub Actions by commit SHAs (#5266, 784b9ba6)
  • Switch the minifier from UglifyJS to Terser (27303c6b)
  • Make the `eslint:dev` task not lint the `dist/` folder (44906a83)
  • Test on Node.js 20, stop testing on Node.js 14 & 19 (6616acff)
  • Only install Playwright dependencies when needed (e77bd9d6)
  • Bump actions/setup-node from 3.5.1 to 3.6.0 (7e7bd062)
  • Run GitHub Action browser tests on Playwright WebKit (b02a257f)
  • Migrate middleware-mockserver to modern JS (ce90a484)
  • remove stale Insight package from custom builds (c66d4700)
  • Limit permissions for GitHub workflows (c909d6b1)
  • Test on Node.js 18 & 19, stop testing on Node 12 (f62d8e21)
  • Bump actions/setup-node from 3.5.0 to 3.5.1 (0208224b)
  • Update Grunt from 1.4.1 to 1.5.3 (aa231cd2)
  • Bump actions/setup-node from 3.4.1 to 3.5.0 (25400750)
  • Update GitHub Actions (52f452b2)
  • Add dependabot.yml config (GitHub Actions) (3f8bb2a4)
  • Test on Node 17, update Grunt & `karma-*` packages (2525cffc)
  • Separate the install step from running tests in GitHub Actions (eef97250)
  • remove travis.yml and travis mentions from core (#4983) (5f4d449a)
  • Migrate CI to GitHub Actions (e23190e6)
  • Update ESLint & eslint-plugin-import, fixing the build (9735edd5)
  • Test on Node.js 16 instead of 15 (0f623fdc)
  • Take core-js-bundle from the external directory as well (345cd22e)
  • Restore the external directory (a684e6ba)
  • Rename master to main across the repository (8ae477a4)
  • Test on Node.js 15 (6984d174)
  • Explicitly exclude the queue module from the slim build (a503c691)
  • Make the import/no-unused-modules ESLint rule work in WebStorm (8612018d)
  • Append .eslintignore paths to grunt eslint paths (a22b43ba)
  • Use the US spelling of “favor” (fa0058af)
  • Fix commitplease husky config (#4735, 3a1b338a)
  • Update dependencies (b5028669)
  • Event: Make sure all source modules’ exports are used (#4648) (40c3abd0)
  • Update eslint-config-jquery, fix linting violations (ef4d6ca6)
  • Followups after introducing ES modules compiled via Rollup (55cd3a44)
  • Correct code indentations based on jQuery Style Guide (3d62d570)
  • Reduce the slim build header comment & jQuery.fn.jquery (812b4a1a)
  • Move ESLint max-len disable-directive to dist/.eslintrc.json (34296ec5)
  • Test on Node.js 14, stop testing on Node.js 8 & 13 (88eb22e0)
  • Enable reportUnusedDisableDirectives in ESLint (46f9810b)
  • Resolve Travis config warnings (5b94a4f8)
  • Enable ESLint one-var rule for var declarations in browser code (4a7fc854)
  • Add Christian Oliff to .mailmap & AUTHORS.txt (721744a9)
  • Lint the minified jQuery file as well – a Gruntfile fix (#3075, 338f1fc7)
  • Lint the minified jQuery file as well (#3075, 89a18de6)
  • Add intuitive names to Travis jobs (e1fab109)
  • Make dev mode work in Karma again, serve source files from disk (437f389a)
  • Tests: Fix custom build tests, verify on Travis (0f780ba7)
  • Create a `grunt custom:slim` alias for the Slim build (#4578) (9b9ed469)
  • Make Karma work in ES modules mode (341c6d1b)
  • Auto-convert sources to AMD (f37c2e51)
  • Fix the Windows build (#4548, 9fd2fa53)
  • Require extensions for ES6 imports, prevent import cycles (44ac8c85)
  • Fix the import path to serialize.js from ajax.js (07532014)
  • Run tests on Travis only on browsers defined in the config (bcbcdd2b)
  • Run tests on Firefox ESR as well (2d5ad6d2)
  • Run tests on Node.js 13 in addition to 8, 10 & 12 (830976e6)
  • Run tests on Travis on FirefoxHeadless as well (584835e6)
  • Require strict mode in Node.js scripts via ESLint (bbad821c)
  • Support jquery-release –dry-run flag (d7d0b52b)
  • Stop copying src/core.js to dist on release (#4489, 9a4d9806)
  • Remove the external directory, read from node_modules directly (d7e64190)
  • ESLint: forbid unused function parameters (438b1a3e)
  • Fix the regex parsing AMD var-modules (#4389) (9ec09c3b)
  • Fix AMD dependencies in curCSS (b220f6df)
  • Test on Node.js 12, stop testing on Node.js 6 & 11 (b8d47128)
  • Fix unresolved jQuery reference in finalPropName (#4358, 87403058)
  • Update Sizzle from 2.3.3 to 2.3.4 (#1756, #4170, #4249, 0b2c36ad)
  • Update the master version to 4.0.0-pre (c4f2fa2f)
  • Update Sinon from 2.3.7 to 7.3.1, other updates (fea7a2a3)

Core

  • Add more info about named exports (5f869590)
  • Simplify code post browser support reduction (93ca49e6)
  • Move the factory to separate exports (46f6e3da)
  • Use named exports in `src/` (#5262, f75daab0)
  • Fix regression in jQuery.text() on HTMLDocument objects (#5264, a75d6b52)
  • Selector: Move jQuery.contains from the selector to the core module (024d8719)
  • Drop the root parameter of jQuery.fn.init (d2436df3)
  • Don’t rely on splice being present on input (9c6f64c7)
  • Manipulation: Add basic TrustedHTML support (#4409, de5398a6)
  • Report browser errors in parseXML (#4784, 89697325)
  • Make jQuery.isXMLDoc accept falsy input (#4782, fd421097)
  • Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge) (#4568, e35fb62d)
  • Fire iframe script in its context, add doc param in globalEval (#4518, 4592595b)
  • Exclude callbacks & deferred modules in the slim build as well (fbc44f52)
  • Migrate from AMD to ES modules 🎉 (d0ce00cd)
  • Use Array.prototype.flat where supported (#4320, 9df4f1de)
  • Remove private copies of push, sort & splice from the jQuery prototype (b59107f5)
  • Implement .even() & .odd() to replace POS :even & :odd (78420d42)
  • Deprecate jQuery.trim (#4363, 5ea59460)
  • Remove IE-specific support tests, rely on document.documentMode (#4386, 3527a384)
  • Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJS (#3950, #4299, cf84696f)
  • Remove deprecated jQuery APIs (#4056, 58f0c00b)

CSS

  • Fix reliableTrDimensions support test for initially hidden iframes (b1e66a5f)
  • Selector: Align with 3.x, remove the outer `selector.js` wrapper (53cf7244)
  • Make the reliableTrDimensions support test work with Bootstrap CSS (#5270, 65b85031)
  • Make `offsetHeight( true )`, etc. include negative margins (#3982, bce13b72)
  • Return `undefined` for whitespace-only CSS variable values (#5120) (7eb00196)
  • Don’t trim whitespace of undefined custom property (#5105, ed306c02)
  • Skip falsy values in `addClass( array )`, compress code (#4998, a338b407)
  • Justify use of rtrim on CSS property values (655c0ed5)
  • Trim whitespace surrounding CSS Custom Properties values (#4926, efadfe99)
  • Include `show`, `hide` & `toggle` methods in the jQuery slim build (297d18dd)
  • Remove the opacity CSS hook (865469f5)
  • Workaround buggy getComputedStyle on table rows in IE/Edge (#4490, 26415e08)
  • Don’t automatically add “px” to properties with a few exceptions (#2795, 00a9c2e5)

Data

  • Refactor to reduce size (805cdb43)
  • Event:Manipulation: Prevent collisions with Object.prototype (#3256, 9d76c0b1)
  • Separate data & css/effects camelCase implementations (#3355, 8fae2120)

Deferred

Deprecated

  • Define `.hover()` using non-deprecated methods (fd6ffc5e)
  • Remove jQuery.trim (0b676ae1)
  • Fix AMD parameter order (f810080e)

Dimensions

  • Add offset prop fallback to FF for unreliable TR dimensions (#4529, 3bbbc111)

Docs

  • Fix module links in the package README (ace646f6)
  • update watch task in CONTRIBUTING.md (77d6ad71)
  • Fix typos found by codespell (620870a1)
  • remove stale gitter badge from readme (67cb1af7)
  • Remove the “Grunt build” section from the PR template (988a5684)
  • Remove stale badge from README (bcd9c2bc)
  • Update the README of the published package (edccabf1)
  • Remove git.io from a GitHub Actions comment (016872ff)
  • Update webpack website in README (01819bc3)
  • add link to patchwelcome and help wanted issues (924b7ce8)
  • add link to preview the new CLAs (683ceb8f)
  • Fix incorrect `trac-NUMBER` references (eb9ceb2f)
  • remove expired links from old jquery source (#4997) (ed066ac7)
  • Remove links to Web Archive from source (#4981, e24f2dcf)
  • Replace `#NUMBER` Trac issue references with `trac-NUMBER` (5d5ea015)
  • Update the URL to the latest jQuery build in CONTRIBUTING.md (9bdb16cd)
  • Remove the CLA checkbox in the pull request template (e1248931)
  • update irc to Libera and fix LAMP dead link (175db73e)
  • Update Frequently Reported Issues in the GitHub issue template (7a6fae6a)
  • Change JS Foundation mentions to OpenJS Foundation (11611967)
  • add SECURITY.md, show security email address (2ffe54ca)
  • Fix typos (1a7332ce)
  • Update the link to the jsdom repository (a62309e0)
  • Use https for hyperlinks in README (73415da2)
  • Remove a mention of the event/alias.js module from README (3edfa1bc)
  • Update links to EdgeHTML issues to go through Web Archive (1dad1185)
  • direct users to GitHub docs for cloning the repo (f1c16de2)
  • Change OS X to macOS in README (5a3e0664)
  • Update most URLs to HTTPS (f09d9210)
  • Convert link to Homebrew from HTTP to HTTPS (e0022f23)

Effect

  • Fix a unnecessary conditional statement in .stop() (#4374, 110802c7)

Effects

Event

  • Avoid collisions between jQuery.event.special & Object.prototype (bcaeb000)
  • Simplify the check for saved data in leverageNative (dfe212d5)
  • Make trigger(focus/blur/click) work with native handlers (#5015, 6ad3651d)
  • Simulate focus/blur in IE via focusin/focusout (#4856, #4859, #4950, ce60d318)
  • Don’t break focus triggering after `.on(focus).off(focus)` (#4867, e539bac7)
  • Make focus re-triggering not focus the original element back (#4382, dbcffb39)
  • Don’t crash if an element is removed on blur (#4417, 5c2d0870)
  • Remove the event.which shim (#3235, 1a5fff4c)
  • remove jQuery.event.global (18db8717)
  • Only attach events to objects that accept data – for real (#4397, d5c505e3)
  • Stop shimming focusin & focusout events (#4300, 8a741376)
  • Prevent leverageNative from registering duplicate dummy handlers (eb6c0a7c)
  • Fix handling of multiple async focus events (#4350, ddfa8376)

Manipulation

  • Generalize a test to support IE (88690ebf)
  • Support $el.html(selfRemovingScript) (#5378) (#5377, 937923d9)
  • Extract domManip to a separate file (ee6e8740)
  • Don’t remove HTML comments from scripts (#4904, 2f8f39e4)
  • Respect script crossorigin attribute in DOM manipulation (#4542, 15ae3614)
  • Avoid concatenating strings in buildFragment (9c98e4e8)
  • Make jQuery.htmlPrefilter an identity function (90fed4b4)
  • Selector: Use the nodeName util where possible to save size (4504fc3d)

Release

  • use buildDefaultFiles directly and pass version (b507c864)
  • copy dist-module folder as well (63767650)
  • only published versioned files to cdn (3a0ca684)
  • remove scripts and dev deps from dist package.json (7eac932d)
  • update build command in Release.generateArtifacts (3b963a21)
  • add support for md5 sums in windows (f088c366)
  • remove the need to install grunt globally (b2bbaa36)
  • upgrade release dependencies (967af732)
  • Remove an unused chalk dependency (bfb6897c)
  • Use an in-repository dist README fixture (358b769a)
  • Update AUTHORS.txt (1b74660f)
  • update AUTHORS.txt (cf9fe0f6)

Selector

  • Make `selector.js` module depend on `attributes/attr.js` (#5379, e06ff088)
  • Eliminate `selector.js` depenencies from various modules (e8b7db4b)
  • Re-expose jQuery.find.{tokenize,select,compile,setDocument} (#5259, 338de359)
  • Stop relying on CSS.supports( “selector(…)” ) (#5194, 68aa2ef7)
  • Backport jQuery selection context logic to selector-native (#5185, 2e644e84)
  • Make selector lists work with `qSA` again (#5177, 09d988b7)
  • Implement the `uniqueSort` chainable method (#5166, 5266f23c)
  • Re-introduce selector-native.js (4c1171f2)
  • Manipulation: Fix DOM manip within template contents (#5147, 3299236c)
  • Drop support for legacy pseudos, test custom pseudos (8c7da22c)
  • Use jQuery `:has` if `CSS.supports(selector(…))` non-compliant (#5098, d153c375)
  • Remove the “a:enabled” workaround for Chrome <=77 (c1ee33ad)
  • Make empty attribute selectors work in IE again (#4435, 05184cc4)
  • Use shallow document comparisons in uniqueSort (#4441, 15750b0a)
  • Add a test for throwing on post-comma invalid selectors (6eee5f7f)
  • Make selectors with leading combinators use qSA again (ed66d5a2)
  • Use shallow document comparisons to avoid IE/Edge crashes (#4441, aa6344ba)
  • reduce size, simplify setDocument (29a9544a)
  • Leverage the :scope pseudo-class where possible (#4453, df6a7f7f)
  • Bring back querySelectorAll shortcut usage (cef4b731)
  • Inline Sizzle into the selector module (47835965)
  • Port Sizzle tests to jQuery (79b74e04)

Support

  • ensure display is set to block for the support div (#4832, 09f25436)

Tests

  • Disable the “:lang respects escaped backslashes” test (#5271, 62b9a258)
  • Indicate Chrome 112 & Safari 16.4 pass the cssHas support test (89ef81f8)
  • Test AJAX deprecated event aliases properly (cff28998)
  • Indicate Firefox 106+ passes the `cssSupportsSelector` test (716130e0)
  • Remove a workaround for a Firefox XML parsing issue (e7ffe1f1)
  • Fix the link to QUnit CSS file (8cf39b78)
  • Exclude tests based on compilation flags, not API presence (#5069, fae5fee8)
  • Workaround an XML parsing bug in Firefox (af1cd6f2)
  • lock colors version to 1.4.0 (9603b3c8)
  • Skip ETag AJAX tests on TestSwarm (00c060d1)
  • Allow statusText to be “success” in AJAX tests (19ced963)
  • Make Karma browser timeout larger than the QUnit one (4fd6912b)
  • Don’t remove csp.log in the cspClean action of mock.php (1019074f)
  • Load the TestSwarm listener via HTTPS (d225639a)
  • Switch background image from online file to local 1×1.jpg (482f8462)
  • Strip untypical callback parameter characters from mock.php (a7027463)
  • Make more tests run natively in Chrome & Firefox (50e8e846)
  • Fix tests for not auto-executing scripts without dataType (d38528b1)
  • Recognize callbacks with dots in the Node.js mock server (df6858df)
  • Skip the “jQuery.ajax() on unload” test in Safari (c18dc496)
  • Remove an unused local variable (82b87f6f)
  • Remove remaining obsolete jQuery.cache references (d96111e1)
  • Workaround failures in recent XSS tests in iOS 8 – 12 (11066a9e)
  • Add tests for recently fixed manipulation XSS issues (dc06d68b)
  • Use only one focusin/out handler per matching window & document (9b732043)
  • Fix flakiness in the “jQuery.ajax() – JSONP – Same Domain” test (7b0864d0)
  • Pass a number of necessary done() calls to assert.async() (364476c3)
  • Remove obsolete jQuery data tests (eb35be52)
  • Skip a “width/height on a table row with phantom borders” test in Firefox (a612733b)
  • Don’t test synchronous XHR on unload in Chrome (323575fb)
  • Stop using jQuery.find in tests (1d624c10)
  • Port changes from Sizzle (ac5f7cd8)
  • Fix a comment in testinit.js (7bdf307b)
  • update npo.js and include unminified source instead (b334ce77)
  • Restrict an event test fallback to TestSwarm (bde53edc)
  • Fix the new focusin/focusout test in IE (6f2fae7c)
  • Fix the core-js polyfill inclusion method (2e4b79ab)

Traversing

  • Fix `contents()` on `<object>`s with children in IE (ccbd6b93)
  • Fix `contents()` on `<object>`s with children (#4384, 4d865d96)
]]>
jQuery : jQuery 3.7.1 Released: Reliable Table Row Dimensions https://blog.jquery.com/2023/08/28/jquery-3-7-1-released-reliable-table-row-dimensions/ 2023-08-28T15:40:07+00:00 Timmy Willison

jQuery 3.7.1 has been released! This release fixes a regression from jQuery 3.6.0 that resulted in rounded dimensions for <tr /> elements in Chrome and Safari. Also, a (mostly) internal Sizzle method, jQuery.find.tokenize that was on the jQuery object was accidentally removed when we removed Sizzle in jQuery 3.7.0. That method has been restored.

As usual, the release is available on our cdn and the npm package manager. Other third party CDNs will probably have it soon as well, but remember that we don’t control their release schedules and they will need some time. Here are the highlights for jQuery 3.7.1.

Support Test for Table Rows

jQuery 3.6.0 introduced a change to a support test to account for a sudden failure from Firefox, which started including table borders in computed dimensions for <tr /> elements. That may be actually be correct, but Firefox is the only browser doing it. However, that new support test didn’t account for pages with * { box-sizing: border-box; } in CSS. And so, the support test failed on those pages in all browsers. The result was a fallback to use outerWidth and outerHeight, which unfortunately doesn’t return fractional values. The support test has now been fixed and previous behavior has been restored for Chrome and Safari, but Firefox and IE will continue to return integers.

Re-exposing Methods from Sizzle

jQuery has inlined most of the code from Sizzle in jQuery 3.7.0 in preparation for larger changes coming to the jQuery selector engine in the future. For the most part, there were no functional changes, but we did accidentally privatize a method that used to be public. While jQuery.find.tokenize was not documented, some code relied on it being available. That method has now been restored.

Upgrading

We do not expect compatibility issues when upgrading from a jQuery 3.0+ version. To upgrade, have a look at the new 3.5 Upgrade Guide. If you haven’t yet upgraded to jQuery 3+, first have a look at the 3.0 Upgrade Guide.

The jQuery Migrate plugin will help you to identify compatibility issues in your code. Please try out this new release and let us know about any issues you experienced.

If you can’t yet upgrade to 3.5+, Daniel Ruf has kindly provided patches for previous jQuery versions.

Download

You can get the files from the jQuery CDN, or link to them directly:

https://code.jquery.com/jquery-3.7.1.js

https://code.jquery.com/jquery-3.7.1.min.js

You can also get this release from npm:

npm install jquery@3.7.1

Slim build

Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for web animations. Along with the regular version of jQuery that includes the ajax and effects modules, we’ve released a “slim” version that excludes these modules. The size of jQuery is very rarely a load performance concern these days, but the slim build is about 6k gzipped bytes smaller than the regular version. These files are also available in the npm package and on the CDN:

https://code.jquery.com/jquery-3.7.1.slim.js

https://code.jquery.com/jquery-3.7.1.slim.min.js

These updates are already available as the current versions on npm and Bower. Information on all the ways to get jQuery is available at https://jquery.com/download/. Public CDNs receive their copies today, please give them a few days to post the files. If you’re anxious to get a quick start, use the files on our CDN until they have a chance to update.

Thanks

Thank you to all of you who participated in this release by submitting patches, reporting bugs, or testing, including Gabriela Gutierrez, Michal Golebiowski-Owczarek, Timo Tijhof, Dimitri Papadopoulos Orfanos and the whole jQuery team.

We’re on Mastodon!

jQuery now has its very own Mastodon account. We will be cross posting to both Twitter and Mastodon from now on. Also, you may be interested in following some of our team members that have Mastodon accounts.

jQuery: https://social.lfx.dev/@jquery

mgol: https://hachyderm.io/@mgol

timmywil: https://hachyderm.io/@timmywil

Changelog

Full changelog: 3.7.1

Build

  • Generate the slim build on `grunt` & run `compare_size` on it (763ade6d)
  • Make sure `*.cjs` & `*.mjs` files use UNIX line endings as well (3c18c1f3)
  • switch preferred email for timmywil (72ae577c)
  • Build: Bump actions/checkout from 3.5.2 to 3.5.3 (a370d7df)
  • Reference GitHub Actions by commit SHAs (#5266, 0ea85dad)
  • Test on Node.js 20, stop testing on Node.js 14 & 19 (b473729d)
  • Updating the 3.x-stable version to 3.7.1-pre. (64460dac)

Core

  • Fix regression in jQuery.text() on HTMLDocument objects (#5264, 44c56f87)

CSS

  • Make the reliableTrDimensions support test work with Bootstrap CSS (3.x version) (#5270, a288838c)

Deprecated

  • Define `.hover()` using non-deprecated methods (7287894f)

Docs

  • Fix typos found by codespell (4a29888c)
  • remove stale gitter badge from readme (141518e9)
  • Remove the “Grunt build” section from the PR template (992a6653)

Release

Selector

  • Only attach the unload handler in IE & Edge Legacy (#5281, 87467a6f)
  • Re-expose jQuery.find.tokenize (3.x version) (#5259, 13a870b6)

Tests

  • Disable the “:lang respects escaped backslashes” test (#5271, 5aa7d93a)
  • Skip a new `.text()` test in IE 9 (b84146ce)
]]>