jQuery, a widely used JavaScript library by web developers for working with web pages, has officially released version 4.0, the project’s first major update in almost a decade.
One of the breaking changes is the removal of support for Internet Explorer 10 and older. Support for IE 11 remains for now, but only partially, as the project plans to phase it out completely in jQuery 5.0.
In addition, support has been dropped for Edge Legacy, very old Firefox releases, early iOS versions, and the Android Browser. Projects that still rely on these environments are advised to remain on the jQuery 3.x series.
On the security side, jQuery 4.0 adds support for Trusted Types, allowing HTML wrapped in TrustedHTML objects to be safely passed to jQuery manipulation methods under strict Content Security Policy configurations. In addition, most asynchronous script loading now relies on dynamically created <script> elements instead of inline scripts, with limited exceptions.
Internally, the jQuery source code has completed its migration from AMD modules to ES modules. The project now uses Rollup for packaging, making the source directly compatible with modern build tools and workflows and usable via <script type="module"> in supported browsers.
As expected, a number of long-deprecated APIs have been removed. These include utility methods such as jQuery.isArray, jQuery.parseJSON, jQuery.trim, jQuery.now, and several CSS-related internals. In all cases, native browser APIs provide direct replacements.
Additional internal cleanup includes the removal of push, sort, and splice from the jQuery prototype.
jQuery 4.0 also changes the order of focus-related events to match the current W3C specification. In light of this, the library no longer overrides native browser behavior, meaning event sequences now follow the standardized order used by modern browsers.
Finally, the slim build has been reduced further by removing Deferreds and Callbacks, bringing it to roughly 19.5 KB gzipped. Native Promises can replace most Deferred usage in supported browsers. Projects that still require IE 11 support should continue using the full build or add a Promise polyfill.
For more information and a detailed list of all changes, see the announcement.
