Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare a 4.0 blog post & an upgrade guide #5365

Closed
mgol opened this issue Aug 29, 2022 · 2 comments
Closed

Prepare a 4.0 blog post & an upgrade guide #5365

mgol opened this issue Aug 29, 2022 · 2 comments
Labels
Milestone

Comments

@mgol
Copy link
Member

mgol commented Aug 29, 2022

An incomplete list of items to cover:

Undocumented but still mention

The undocumented jQuery.fn.init API no longer accepts the third root parameter: #5096

@mgol mgol added this to the 4.0.0 milestone Aug 29, 2022
@mgol mgol changed the title Prepare a 4.0 upgrade guide Prepare a 4.0 blog post & an upgrade guide Nov 20, 2023
@mgol
Copy link
Member Author

mgol commented Nov 20, 2023

Moving this to the jQuery repo for easier commit/PR/issue references.

@mgol mgol transferred this issue from jquery/jquery.com Nov 20, 2023
@mgol mgol added Docs Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. labels Nov 20, 2023
@mgol
Copy link
Member Author

mgol commented Nov 20, 2023

Summary of the major 4.0.0 changes

Each list is sorted by modules alphabetically, with the exception of Core which always comes first.

Breaking changes

  • Core: Move the factory to separate exports
    • 46f6e3d
    • This is about the Node.js behavior for windowless environments where require( "jquery" )( window ) is required
  • Core: Remove deprecated jQuery APIs
    • 58f0c00
    • jQuery.isArray, jQuery.parseJSON, jQuery.nodeName, jQuery.isFunction, jQuery.isWindow, jQuery.camelCase, jQuery.type, jQuery.now, jQuery.isNumeric, jQuery.cssProps
    • Also:
  • Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJS
    • cf84696
    • Also:
      • Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)
  • Core: Remove private copies of push, sort & splice from the jQuery prototype
  • Core: Exclude callbacks & deferred modules in the slim build as well
    • fbc44f5
    • Also:
      • Build: Reduce the slim build header comment & jQuery.fn.jquery
      • Build: Explicitly exclude the queue module from the slim build
  • Core: Drop the root parameter of jQuery.fn.init (undocumented)
  • Ajax: Drop the json to jsonp auto-promotion logic
  • Ajax: Avoid CSP errors in the script transport for async requests
    • 07a8e4a
    • Make more requests use the <script src> part of the script transport
  • Ajax: Don't auto-execute scripts unless dataType provided
  • Attributes: Drop the toggleClass(boolean|undefined) signature
  • CSS: Don't automatically add "px" to properties with a few exceptions
  • CSS: Remove the opacity CSS hook
    • 865469f
    • The consequence is .css( "opacity" ) will now return an empty string for detached elements in standard-compliant browsers and "1" in IE & the legacy Edge. That behavior is shared by most other CSS properties which we're not normalizing either.
  • Data: Separate data & css/effects camelCase implementations
    • 8fae212
    • The data one no longer special-cases ms-
  • Data:Event:Manipulation: Prevent collisions with Object.prototype
    • 9d76c0b
    • Breaks code using hasOwnProperty
  • Deferred: Drop jQuery.Deferred.getStackHook (renamed since 3.7.0 to jQuery.Deferred.getErrorHook)
    • 258ca1e
    • Used to pass the original error to jQuery.Deferred.exceptionHook (previously we recommended passing stack but that breaks source maps)
  • Event: Stop shimming focusin & focusout events
  • Event: Avoid collisions between jQuery.event.special & Object.prototype
    • bcaeb00
    • Affects code calling hasOwnProperty on jQuery.event.special
  • Manipulation: Avoid concatenating strings in buildFragment
    • 9c98e4e
    • Needed for Trusted Types support - the breaking aspect of it is likely minimal
  • Manipulation: Don't remove CDATA sections from scripts
  • Selector: Drop support for legacy pseudos
  • Selector: Backport jQuery selection context logic to selector-native

Other notable changes

  • Core: Remove IE-specific support tests, rely on document.documentMode
  • Core: Migrate from AMD to ES modules 🎉
  • Core: Add exports to package.json, export slim & esm builds
  • Core:Manipulation: Add basic TrustedHTML support
  • Ajax: Support binary data (including FormData)
    • a7ed9a7
    • Possible minor breaking change: prefilters are now applied before data is converted to a string
  • Deferred: Respect source maps in jQuery.Deferred.exceptionHook
    • 0b9c503
    • Affects errors in Promise callbacks for which jQuery print errors as they are typically human error rather than an exception to handle in code
  • Selector: reduce size, simplify setDocument

@jquery jquery deleted a comment from Mooenz Jan 6, 2024
@jquery jquery locked as off-topic and limited conversation to collaborators Jan 6, 2024
@timmywil timmywil removed the Discuss in Meeting Reserved for Issues and PRs that anyone would like to discuss in the weekly meeting. label Jan 6, 2024
@timmywil timmywil closed this as completed Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants