Hacker News new | past | comments | ask | show | jobs | submit login

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 and 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.




> 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.


> 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.


> 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.


You 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.


I 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.


I 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.


For reference, jQuery is bigger than AngularJS - let that sink in.


This 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


Your users likely already have jQuery in their browser cache, given it's loaded from one of the public CDNs.


Which version and which CDN? Assuming the user's cache for a non-archival product sounds dubious.


There are only a handful of major CDNs, and jQuery has been at the same version for a very long time.


This 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: