Stay on 3.x for now
3.7.1 → 3.8.0
Choose this if you need the fixes now and a required browser or plugin still blocks the major upgrade. Run regression tests before merging.
3.8.0 release tagMove to the active branch
3.7.1 → 4.1.0
Choose this if you can validate the major upgrade now. Use the full build if your app or its plugins need jQuery.Deferred.
Both shipped on and include a selector security fix. jQuery plans to limit future 3.x maintenance to critical security and bug fixes. Active development is on 4.x. Official announcement
Three checks before you merge
- Browsers
-
Run your smoke tests in the browsers your app supports. jQuery 4.x supports IE11 in standards mode and Edge IE mode with the IE11 document mode. An IE9, IE10 or Edge Legacy requirement points to 3.x. Browser support
If your app reads
jqXHR.responseURL, exercise an actual redirect with modern XHR and handle a missing value. IE11 and the script and JSONP transports leave it unset. 4.1.0 release notes - Plugins
-
Check the exact plugin versions you ship. Search your code and plugins for
$.expr[":"],$.expr.filtersandpush,sortorsplicecalled on jQuery collections. 3.8.0 formally deprecates these APIs. 4.x removes them. Use$.expr.pseudosfor custom pseudos. 3.8.0 release notes · 4.0 upgrade guideFor a 4.x migration, load uncompressed Migrate 4.x after jQuery in staging. Run plugin initialization and the user flows that exercise each plugin. Resolve the warnings, then remove Migrate and rerun those flows. Migrate steps
- Builds
-
Check the script URL or bundler import and inspect the loaded file on the page you plan to ship. Keep the build flavor constant if the goal is only a version bump. The 4.x slim build omits Ajax and effects, plus Callbacks, Deferred and the queue module. Test the APIs your app and plugins actually call against the intended artifact. Build downloads · Slim build changes
Same release, different file
We loaded each official 4.1.0 file locally and ran the same expressions. The full build could create a Deferred. The slim build threw at that specific call.
> jQuery.fn.jquery 4.1.0 > typeof jQuery.Deferred function > jQuery.Deferred().state() pending
> jQuery.fn.jquery 4.1.0+slim > typeof jQuery.Deferred undefined > jQuery.Deferred().state() TypeError: jQuery.Deferred is not a function
Tested in Chrome on macOS with each unminified file loaded from disk.