4 ms·
youmightnotneedjquery.com is often held up as an example of why jQuery is obsolete, but if you look at the examples a bit more closely, you'll notice problems.
by EB66 7y ago
youmightnotneedjquery.com is often held up as an example of why jQuery is obsolete, but if you look at the examples a bit more closely, you'll notice problems.
I spent all of five minutes glancing through the example list and noticed their `replaceWith` doesn't provide the functionality that jQuery offers -- it doesn't take into account event handlers bound to DOM elements. Also, their `extend` does a shallow merge, not a deep merge. Furthermore, the YMNNJ examples are often far more verbose and less expressive than the jQuery examples.
I don't particularly understand the rush to rip jQuery out of everything. It seems like a lot of people are doing it just because it's the trending thing to do. There are some things that jQuery does very well -- even in today's world where modern web dev is dominated by SPA components.
I'm the maintainer of https://github.com/elliotnb/observable-slim https://github.com/elliotnb/observable-slim and https://github.com/elliotnb/nimbly https://github.com/elliotnb/nimbly -- the latter of which is an SPA component framework whose core requires jQuery. It uses jQuery to update DOM nodes with `replaceWith`, merge deeply nested objects with `extend`, among other things. Nimbly components are not required to use jQuery -- only the framework core uses it. Aside from the eliminating the extra 69KB footprint from adding jQuery slim min, I don't see any reason to rush to rip jQuery out of the Nimbly core. On the contrary, using jQuery helped us get the framework built faster and helped us keep the code expressive and easy-to-follow.
- masklinn 7y ago> youmightnotneedjquery.com is often held up as an example of why jQuery is obsolete, but if you look at the examples a bit more closely, you'll notice problems. Surely that's their entire point? They provide the link as evidence that > it's intellectually dishonest to claim that all of the non-jQuery techniques are as ergonomic to implement as jQuery idioms Not as evidence that you don't need jquery.
- peteforde 7y agoYou could be right... but you're definitely the first person I've seen suggest this. It would be a Sixth Sense twist, given the domain name. youprobablystillwantjquery.com is still available at the time of this writing.
- extra88 7y agoI took masklinn's comment to mean that your point in sharing the youmightnotneedjquery.com was to show evidence of problems using vanilla JS instead of jQuery, not that that's the point of the site existing. The site has plenty of examples of vanilla requiring writing multiple lines compared to one jQuery line, which I took to be your point regarding "ergonomics." EB66 seems more focused on a subtler point regarding the site, that their vanilla examples don't do everything the jQuery version does.
- peteforde 7y agoI like your reading better than my own. I've re-read a few times and it's still written in an ambiguous way, so I don't feel completely silly.
- EB66 7y ago> Surely that's their entire point? They provide the link as evidence that. I'm not following your point. The point of YMNNJ is that you can use their examples to quickly replace bits of jQuery code. I've identified that a few of their examples (possibly more) are not equivalent replacements -- demonstrating that jQuery is indeed needed. Your second quote doesn't come from me. It's misleading the way you quoted it in response to my post.
- masklinn 7y ago> I'm not following your point. The point of YMNNJ is that you can use their examples to quickly replace bits of jQuery code. That doesn't mean that's how the person you responded to uses it. > Your second quote doesn't come from me. The second quote comes from the comment you responded to, I'm pointing out that its author specifically used YMNNJ to demonstrate that not using jquery can be significantly less convenient and ergonomic than using it.
- deleted 7y ago[deleted]
- Bahamut 7y agoFor reference, jQuery is bigger than AngularJS - let that sink in.
- bauerd 7y agoYour users likely already have jQuery in their browser cache, given it's loaded from one of the public CDNs.
- austincheney 7y agoWhich version and which CDN? Assuming the user's cache for a non-archival product sounds dubious.
- GordonS 7y agoThere are only a handful of major CDNs, and jQuery has been at the same version for a very long time.
- ndnxhs 7y agoThis gets posted a lot but there are so many versions of jquery on so many different cdns that very rarely is it the case. I saw some research on it and it was in the single digit percentage of times.
- vanderZwan 7y agoThis is a bit disingenuous without actual numbers: jQuery minified is 83 KiB, 30 KiB transferred with gzip. The new slim version knocks that down to 70 and 24 KiB, respectively. For almost any website that has actual use-cases for it, it's not going to be the data bottleneck. Plus most websites have way more severe bloat elsewhere to worry about