I think the reason is that many of the problems JQuery was designed to solve (DOM manipulation, cross-browser compatibility issues, AJAX, cool effects) have now been implemented as standards, either in Javascript or CSS and many developers consider the 55k minified download not worth it.
The general argument now is that 95%+ of jQuery is now native in browsers (with arguably the remaining 5% being odd overly backward compatible quirks worth ignoring), so adding a JS dependency for them is "silly" and/or a waste of bandwidth.
Obviously, if jQuery is still your jam in 2019, that's your decision and no one is going to force you to stop using it. The approach Bootstrap is taking is interestingly backwards compatible in that the updated plugins will still register their previous jQuery APIs, even if their actual implementations will now be "vanilla" JS directly against the modern browser APIs.
I think jQuery is a good option if you're making "rich applications"; that is, normal HTML pages with some JavaScript for better UX. For many applications this is still a good approach.
If you're making an SPA, then jQuery is a bad choice for many reasons. jQuery is just a DOM wrapper, and doesn't give you any application structure, which tends to lead to pretty messy applications.
I believe Vue.js is much better option for this use case (just enhancing UX on an existing HTML page), and is similar in size while giving you much more flexibility.
jQuery is fine for spicing up a blog or something with really basic JavaScript functionality (e.g. a carousel, basic 'contact' form with validation/AJAX).
Anything more 'rich' gets confusing very, very quickly and with how accessible Vue/React/Angular are it doesn't make sense to use jQuery.
Not a total expert, but as a fan of JQuery I've read the arguments.
JQuery modifies the DOM at runtime, this means lots of node traversals and redrawings on the fly, which make it nearly impossible for the Javascript engine to optimize anything.
More modern frameworks in general use the concept of a Shadow DOM: they keep their own representation of the DOM internally and only send the full frame to the engine for rendering. It seems to be extremely more efficient and flexible.
I think you may be confusing Shadow DOM with Virtual DOM. Shadow DOM is more about encapsulation and isolation of independent DOMs, while Virtual DOM is about keeping an in memory representation of the DOM to allow for more efficient rendering. Shadow DOM is a browser API whereas Virtual DOM is implemented in frameworks.
You’re confusing the shadow DOM with the virtual DOM and if you benchmark it, the only way the virtual DOM is faster is if you’re doing a bunch of horribly inefficient interactions. I usually find the DOM to be faster by several orders of magnitude because ultimately the real DOM has to be updated so any overhead is going to be on top of the same work.
That’s not saying don’t use a virtual DOM but pick it knowing that you’re taking on a moderate degree of inefficiency in exchange for a better coding experience, consistent structure, etc.
I think it's generally considered good when you can eliminate a dependency's reliance on another dependency to function. There's nothing inherently wrong with jQuery. If the functionality and size match your needs, there shouldn't be any problem.
My sense is that jQuery and early web front-end approaches reflect how designers think. They were created by designers who understood code for other designers who didn’t so that designers could play a role in the web. Sites wanted to be unique.
New frameworks reflect how developers think. Sites want to work more than they want to look unique. In many cases, uniqueness is viewed as driving up training or onboarding cost.
andosteinmetz|7 years ago
http://vanilla-js.com/
bengotow|7 years ago
WorldMaker|7 years ago
Obviously, if jQuery is still your jam in 2019, that's your decision and no one is going to force you to stop using it. The approach Bootstrap is taking is interestingly backwards compatible in that the updated plugins will still register their previous jQuery APIs, even if their actual implementations will now be "vanilla" JS directly against the modern browser APIs.
Carpetsmoker|7 years ago
If you're making an SPA, then jQuery is a bad choice for many reasons. jQuery is just a DOM wrapper, and doesn't give you any application structure, which tends to lead to pretty messy applications.
M4v3R|7 years ago
benbristow|7 years ago
Anything more 'rich' gets confusing very, very quickly and with how accessible Vue/React/Angular are it doesn't make sense to use jQuery.
guhcampos|7 years ago
JQuery modifies the DOM at runtime, this means lots of node traversals and redrawings on the fly, which make it nearly impossible for the Javascript engine to optimize anything.
More modern frameworks in general use the concept of a Shadow DOM: they keep their own representation of the DOM internally and only send the full frame to the engine for rendering. It seems to be extremely more efficient and flexible.
barbecue_sauce|7 years ago
acdha|7 years ago
That’s not saying don’t use a virtual DOM but pick it knowing that you’re taking on a moderate degree of inefficiency in exchange for a better coding experience, consistent structure, etc.
peheje|7 years ago
mosdl|7 years ago
sundvor|7 years ago
philwelch|7 years ago
thieving_magpie|7 years ago
mch82|7 years ago
New frameworks reflect how developers think. Sites want to work more than they want to look unique. In many cases, uniqueness is viewed as driving up training or onboarding cost.