KahWee - Web Development, AI Tools & Tech Trends

Expert takes on AI tools like Claude and Sora, modern web development with React and Vite, and tech trends. By KahWee.

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, but here we are.

The project has been around since 2006. That's twenty years. Most JavaScript libraries don't survive five. The fact that jQuery made it to version 4 after a decade of "you don't need jQuery" blog posts is impressive on its own.

What jQuery 4 Actually Changed

The release drops IE support entirely. No more IE10, no more IE11. This is the most consequential change because it unlocks everything else.

Without legacy browser baggage, the team removed a lot of 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 other big change: the slim build got slimmer. It now removes Deferreds, Callbacks, and the queue module in addition to AJAX and effects.

The Slim Build: jQuery Admitting the Browser Won

Here's what slim removes and what you use instead:

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 represent code that duplicates what browsers already do natively. If you're already using 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.

When to Use Slim vs Full

Use slim when:

  • You're already using fetch() and Promises
  • jQuery is just for DOM stuff and event handling
  • Bundle size matters (shared widgets, WordPress plugins, marketing pages)

Stick with full when:

  • You have a lot of $.ajax() code and no appetite to refactor
  • You're maintaining a theme in an ecosystem where jQuery is preloaded
  • You need the animation queue for complex sequenced effects

The Migration Path

jQuery 4 doesn't force a rewrite. The practical approach:

  1. Stop adding new $.ajax() calls. New code uses fetch().
  2. Stop adding new jQuery animations. New code uses CSS transitions.
  3. Replace $.Deferred() with native Promise when you touch old code.
  4. Eventually swap jquery.min.js for jquery.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;
}

Warning

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

jQuery's survival says something about web development. We've gone through Angular, React, Vue, Svelte, and countless build tools. jQuery just kept working.

The slim build in v4 is jQuery finally saying "use the platform" for the stuff the platform does well. Keep jQuery for the DOM manipulation it's still good at. Use fetch() for network requests. Use CSS for animations.

That's a more honest posture than most libraries manage. Most would rather pretend they're still the best solution for everything.


Related posts: