github camsong/You-Dont-Need-jQuery v3.0
Release 3.0

3 hours ago

The guide now targets evergreen browsers. Every snippet that was changed is checked against jQuery 4 by a test.

Breaking: Internet Explorer is no longer supported

Snippets target the latest Chrome, Edge, Firefox, Safari and Opera. IE-specific fallbacks are gone: vendor-prefixed matchesSelector, the closest polyfill, Array.prototype.*.call, createEvent / initCustomEvent, pageYOffset, parentNode.removeChild. If you still need IE, use the last IE-compatible version or v2.0.

Native one-liners

jQuery Native
remove / insertBefore / insertAfter el.remove() / el.before() / el.after()
empty el.replaceChildren()
unwrap / replaceWith parent.replaceWith(...parent.childNodes) / el.replaceWith()
$(html) <template>
$.extend(true, …) structuredClone()
$.Deferred Promise.withResolvers()
scrollTop() window.scrollY
outerHeight() / outerWidth() el.offsetHeight / el.offsetWidth

New sections

  • Request JSON (with the response.ok gotcha), Post JSON, Abort and timeout
  • one → { once: true }, event delegation, removing several listeners at once with AbortController
  • async / await variants for always and then
  • Effects use the Web Animations API (el.animate()); slideUp / slideDown measure real height

Fixed snippets

Snippets that threw or disagreed with jQuery: nextAll / prevAll, :contains, append / prepend with HTML strings, clone (now deep), trigger, inArray, isPlainObject(null), merge, globalEval, parseHTML, Deferred, fadeOut, fadeTo, animate. Plus broken markdown, anchors and syntax errors in the README (#264).

Tests and tooling

  • Karma / webpack 1 / Babel 6 replaced with Vitest + jsdom; tests run in GitHub Actions on PRs and master
  • Travis CI config and badges removed (#263)

Translations

All 15 translations are synced with the current snippets (#268–#282).

Full changelog: v2.0...v3.0

Don't miss a new You-Dont-Need-jQuery release

NewReleases is sending notifications on new releases.