jQuery 4.0.0
jQuery 4.0.0 has been released — the first major version bump in nearly a decade. This release modernizes the library by removing legacy browser support, adopting ES module architecture, and implementing Trusted Types for Content Security Policy compliance. Developers should review the breaking changes below before upgrading.
Overview
jQuery 4.0.0 represents a significant modernization of the library that has powered web development for twenty years. The core team has focused on removing the accumulated baggage of Internet Explorer-era workarounds, migrating to modern JavaScript standards, and improving security posture. The release is available immediately from the jQuery CDN and npm.
Breaking Changes
- Internet Explorer <11 support removed — All IE-specific polyfills, hacks, and conditional code paths have been stripped from the codebase. jQuery 4 requires a modern, evergreen browser.
- Deprecated APIs removed — Methods that have been marked deprecated for multiple major versions have been deleted. This includes
.andSelf(),.click(),.bind()/.unbind(),.delegate()/.undelegate(), and several others. Use.on()and.trigger()instead. - Internal-only methods no longer exposed — The jQuery object no longer exposes internal utility methods that were never part of the public API. Code relying on undocumented properties will break.
- Trusted Types enforcement — jQuery now integrates with the Trusted Types API, meaning HTML injection via
.html()and similar methods requires explicit Trusted Type policies in CSP-enabled environments.
New Features
- ES module support — The jQuery source has been migrated to native ES modules. The build system now produces both UMD and ESM bundles. Import jQuery with
import $ from "jquery". - Trusted Types and CSP — Full support for Content Security Policy via Trusted Types. jQuery will no longer trigger CSP violations when using HTML manipulation methods, provided Trusted Type policies are configured correctly.
- Smaller footprint — The removal of legacy browser support and deprecated APIs results in a noticeably smaller gzipped bundle. The production build is approximately 30% smaller than jQuery 3.x.
- Modern JavaScript — The codebase now targets ES2019+, leveraging native
Map,Set,Array.from, and other modern features. This improves performance in all supported browsers.
Deprecations
- Several additional methods are now deprecated in jQuery 4.0.0 and will be removed in jQuery 5.0.0. These include legacy event shorthand methods and selector-based factory overloads. Consult the migration guide for details.
Migration Guide
The jQuery team has published a comprehensive migration guide covering every breaking change with before-and-after code examples. Key steps include replacing .bind() with .on(), auditing internal method usage, and configuring Trusted Type policies if your site uses CSP. The upgrade path from jQuery 3.x is well-documented and tested.
Fixes
- Resolved multiple edge-case memory leaks in DOM manipulation
- Fixed dimension calculations in CSS Grid and Flexbox layouts
- Corrected deferred promise chaining behavior to match the Promises/A+ specification
- Patched several XSS vectors in HTML parsing (attributed to internal security audit)