jQuery 4.0 trims legacy code, drops deprecated APIs, migrates to ES modules, and more
jQuery 4.0 is now available, marking the first major update to this influential JavaScript library in almost a decade. Released 20 years after its initial introduction, this update focuses on streamlining and modernizing the codebase. The new version removes a range of legacy features, trims deprecated APIs, eliminates internal-only prototype methods, and sheds rarely used internal parameters.
Following these internal changes, jQuery 4.0 drops support for Internet Explorer 10 and older, as well as Edge Legacy, older Android Browser, Firefox versions earlier than the last two (except Firefox ESR), and iOS versions earlier than the last three. This shift requires developers to update their browser compatibility targets but helps modernize web projects.
Alongside these removals, jQuery adds support for Trusted Types, enabling developers to use TrustedHTML as input for manipulation methods without violating strict Content Security Policy requirements. The migration from Asynchronous Module Definition (AMD) to ECMAScript (ES) modules makes jQuery compatible with modern build systems and development environments.
Finally, focus event ordering now follows World Wide Web Consortium (W3C) specifications, and the slim build is even smaller due to the removal of Deferreds and Callbacks. jQuery 4.0 is available for download now, 11 months after the first beta was released.