JavaScript News

JQuery 4.0.0 Beta Released with Important Deprecations and Breaking Changes

 Timmy Wilison recently announced the beta release of jQuery 4.0. The new version of jQuery is a large release with numerous bug fixes, performance improvements, and some breaking changes. IE<11 browsers are no longer supported, many APIs have been removed, jQuery aligns the ordering of focus events on that of browsers, and now supports FormData.

Willison explained the rationale behind the major release:

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.

jQuery 4.0 drops support for IE<11 and older browsers (including Edge Legacy, iOS <11, Firefox <65, and Android Browser). jQuery 5.0 is poised to remove support for IE11.

jQuery 4.0 drops removed some APIs that have already been deprecated in previous releases (e.g., cssNumbercssPropsisArrayisFunctionisWindowisWindowisNumericparseJSONnodeNametrim). Internal-use APIs pushsort, and splice are deprecated in favor of the methods available on JavaScript’s Array prototype.

Focus events focusinfocusoutfocus, and blur events now trigger in the same order as the latest versions of modern browsers. All browsers except IE will follow the current W3C specification (updated in 2023), which prescribes the following ordering of events: blurfocusoutfocusfocusin.

jQuery 5.0 is expected to further review event design. jQuery.ajax adds support for binary data, including FormData.

While jQuery saw its first release in 2006, 17 years ago, it remains an undying feature of the Web landscape. According to npm trends, the number of downloads of the library has been continuously increasing on average.

One Reddit user welcomed the new release:

I’m a WordPress developer so I greatly appreciate the new update. It’s the first major release in the last 8 years I think.

While developers may directly use the library in their webpage, jQuery is also a dependency of many other libraries and tools (e.g., WordPress, Drupal, Cypress). Part of the jQuery npm downloads increase may thus be explained by the increase in popularity of related dependent packages. As a Reddit user commented:

Folks might be surprised that Cypress uses and exposes jQuery.

Developers are encouraged to review the release note, which contains the full list of related breaking changes, improvements, and bug fixes.

Avatar

Shakeel Shahid

About Author

Leave a comment

Your email address will not be published. Required fields are marked *

You may also like

JavaScript News

AdonisJS v6 Released: TypeScript, ESM, and Beyond

AdonisJS, a Node.js web application framework, has released its latest major release AdonisJS v6. Notable highlights include a transition to ECMAScript Modules
JavaScript News

The Guardian Creates a Newsroom Collaboration Tool Using Serverless, React and GraphQL

The Guardian created Pinboard, a discussion and asset-sharing tool integrated into a variety of content management platforms used by the company. The