Upgrading jquery 3 to 4
Breaking3.7.1 → 4.0.0Breaking19Platform2Deprecated3New9Changed35Fixed40Other221
BreakingUpgrade verdict
19 breaking changes and 2 platform requirement changes.
In plain terms
- Requests for JSON are no longer silently converted to JSONP.
- Calling toggleClass with a boolean or undefined argument is no longer supported.
- Removes the opacity CSS hook.
- Drops the root parameter of jQuery.fn.init.
Must act Top 5 of 24 that need code or config changes
What you must change
Breaking19
Drops the automatic json to jsonp promotion logic.
Drops the toggleClass(boolean|undefined) signature.
toggleClass()Removes the opacity CSS hook.
opacityDrops the root parameter of jQuery.fn.init.
jQuery.fn.initRemoves private copies of push, sort and splice from the jQuery prototype.
pushsortspliceRemoves deprecated jQuery APIs.
Renames getStackHook to getErrorHook in Deferred.
getStackHookgetErrorHookRemoves jQuery.trim.
jQuery.trimRemoves jQuery.fx.interval.
jQuery.fx.intervalRemoves the event.which shim.
event.whichRemoves jQuery.event.global.
jQuery.event.globalStops auto-executing scripts unless a dataType is provided.
dataTypeStops automatically adding "px" to properties, with a few exceptions.
Moves the factory to separate exports.
Uses named exports in
src/.Migrates from AMD to ES modules.
Stops shimming focusin and focusout events.
focusinfocusoutMakes jQuery.htmlPrefilter an identity function.
jQuery.htmlPrefilterDrops support for legacy pseudos and tests custom pseudos.
Platform2
Drops support for IE <11, iOS <11, Firefox <65, Android Browser and PhantomJS.
Drops support for Node 10.
Deprecations to plan for
Deprecated3
Deprecates Ajax event aliases and moves them into the deprecated module.
Deprecates jQuery.trim.
jQuery.trimProperly deprecates jQuery.expr[":"] and jQuery.expr.filters.
jQuery.expr[":"]jQuery.expr.filters