jQuery 4: I Can't Believe They Actually Did It
jQuery 4.0.0 shipped last week. I didn't expect to write about jQuery in 2026.
The project has been around since 2006. Twenty years. Most JavaScript libraries don't survive five. jQuery made it to version 4 after a decade of "you don't need jQuery" blog posts.
What Changed
jQuery 4 drops IE support entirely. No IE10, no IE11. This unlocks everything else.
Without legacy browser baggage, the team cut code that existed purely for compatibility:
- Browser detection hacks for IE quirks
- Event handling workarounds for old DOM APIs
- Animation fallbacks for browsers without CSS transitions
- jQuery.isArray() and jQuery.isFunction() (use native Array.isArray() and typeof instead)
Important
If your app still needs IE11, stay on jQuery 3.x. jQuery 4 will break.
The slim build also got slimmer. It now removes Deferreds, Callbacks, and the queue module on top of AJAX and effects.
jQuery Admits the Browser Won
What slim removes and what replaces it:
| Removed | Native Replacement |
|---|---|
$.ajax(), $.get(), $.post() |
fetch() |
.fadeIn(), .fadeOut(), .animate() |
CSS transitions, Web Animations API |
$.Deferred(), $.when() |
Native Promise, Promise.all() |
.queue(), .dequeue() |
async/await chains |
The size difference:
jQuery 4.0.0 (gzipped)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Full ████████████████████████████████████████ 27.6 KB
Slim ████████████████████████████░░░░░░░░░░░░ 19.5 KB
↑
8.1 KB saved (29%)
8KB doesn't sound like much in 2026. But those 8KB duplicate what browsers do natively. If you already use fetch() and CSS transitions, you're shipping dead code.
Tip
The slim build keeps everything people actually use jQuery for: selectors, DOM manipulation, events, and traversal. It just removes the parts the browser handles better.
Slim or Full?
Use slim if you already use fetch() and Promises, jQuery only handles DOM and events, or bundle size matters (widgets, WordPress plugins, marketing pages).
Stick with full if you have a lot of $.ajax() code you're not ready to refactor, or you need the animation queue for sequenced effects.
The Migration Path
jQuery 4 doesn't force a rewrite. Migrate gradually:
- Stop adding new
$.ajax()calls. New code usesfetch(). - Stop adding new jQuery animations. New code uses CSS transitions.
- Replace
$.Deferred()with nativePromisewhen you touch old code. - Eventually swap
jquery.min.jsforjquery.slim.min.js.
// Old: jQuery AJAX
$.ajax({
url: '/api/users',
method: 'GET',
dataType: 'json'
}).then(data => console.log(data));
// New: Native fetch
const data = await fetch('/api/users').then(r => r.json());
/* Old: jQuery fadeOut */
/* $('#box').fadeOut(300); */
/* New: CSS transition */
.box {
opacity: 1;
transition: opacity 0.3s ease;
}
.box.hidden {
opacity: 0;
}
The slim build doesn't resolve dependencies inside ?url imports. If you're loading jQuery via a script URL in an iframe or worker, test thoroughly.
Twenty Years Later
We've gone through Angular, React, Vue, Svelte, and countless build tools. jQuery just kept working.
The slim build is jQuery saying "use the platform" for what the platform does well. Keep jQuery for DOM manipulation. Use fetch() for network requests. Use CSS for animations. That's more honest than most libraries manage.
Related posts:
- Why jquery.slim.js?url Behaves Differently in Vite - Import suffixes and what they mean
- Switching from Webpack to Vite in 2025 - Modern build tooling