Live data from Hacker News

jQuery 4.0 99% Complete

github.com

11–20 of 47 posts

Re: jQuery 4.0 99% Complete

#11
post #3
post #2

I wonder if the footprint got smaller or bigger.

It does not matter that much, relatively speaking. People include 1MB font libraries in their site without a care in the world, and force 1-2MB PNGs and JPEGs down the wire without caring. A few extra bytes in jQuery is nothing compared to that.

js and images are not directly comparable, you also need to consider that the js has to be parsed and evaluated. so it really depends: it may matter

Re: jQuery 4.0 99% Complete

#12
Is there some kind of summary available somewhere of what features are “unique” to jQuery (or at least significantly easier), and what features are now generally available as vanilla JS or CSS?

I’m not a JS developer and I just have a basic understanding of what jQuery is used for, so I’d be interested in seeing some kind of historical timeline, both to better understand why jQuery was originally created, and to understand what purpose it might fill today (legacy dependencies excluded).

Re: jQuery 4.0 99% Complete

#13
post #10

It has been a long time since I used jQuery. What exactly is the usecase today? Is it just syntactic sugar or has it changed significantly?

I think the main use case today is the dom traversal API. It makes operations like "add the 'error' class to all elements in the form" simple:

    $('#some-form').find('input').addClass('error')
Obviously you can do this in vanilla JS, but it's more cumbersome so you'll probably end up rewriting your own less complete version of jquery. There is some value to using a well worn library with public documentation that other developers can find/extend instead of a home grown solution.

With that said, I wouldn't use it for a green field project. For sites that require lots of interactivity I would pick a modern front end framework that doesn't require this kind of manual dom traversal (probably phoenix/liveview).

Re: jQuery 4.0 99% Complete

#15
post #12

Is there some kind of summary available somewhere of what features are “unique” to jQuery (or at least significantly easier), and what features are now generally available as vanilla JS or CSS? I’m not a JS developer and I just have a basic understanding of what jQuery is used for, so I’d be interested in seeing some kind of historical timeline, both to better understand why jQuery was originally created, and to unde…

https://youmightnotneedjquery.com/

Re: jQuery 4.0 99% Complete

#16
post #6

Just leaving this here since people will wonder the relevance of jQuery today. > jQuery is used by 94.5% of all the websites whose JavaScript library we know. This is 77.4% of all websites. https://w3techs.com/technologies/details/js-jquery

Chances are you have "ed" installed on your currently used machine, but I doubt it was ever opened.

With that said, I'm quite surprised that jQuery is not abandoned, barely heard about it in the past decade or so. I suspect also that it is mostly part of boilerplate coming from other libraries and frameworks, and rarely intentional.

Re: jQuery 4.0 99% Complete

#17
post #7

Earlier quoted context omitted.

Especially if it's served from a CDN, and thus likely already cached. Then again, how many folks are using jquery these days? It might be more rare than I think.

> Especially if it's served from a CDN, and thus likely already cached. Browsers no longer do cross-site resource caching. https://www.stefanjudis.com/notes/say-goodbye-to-resource-ca...

Ah, shows how much I know about front-end stuff these days!

Re: jQuery 4.0 99% Complete

#18
post #6

Just leaving this here since people will wonder the relevance of jQuery today. > jQuery is used by 94.5% of all the websites whose JavaScript library we know. This is 77.4% of all websites. https://w3techs.com/technologies/details/js-jquery

Chances are you have "ed" installed on your currently used machine, but I doubt it was ever opened. With that said, I'm quite surprised that jQuery is not abandoned, barely heard about it in the past decade or so. I suspect also that it is mostly part of boilerplate coming from other libraries and frameworks, and rarely intentional.

I write jquery almost every day for work (I work on wordpress sites)

Re: jQuery 4.0 99% Complete

#19
post #15
post #12

Is there some kind of summary available somewhere of what features are “unique” to jQuery (or at least significantly easier), and what features are now generally available as vanilla JS or CSS? I’m not a JS developer and I just have a basic understanding of what jQuery is used for, so I’d be interested in seeing some kind of historical timeline, both to better understand why jQuery was originally created, and to unde…

https://youmightnotneedjquery.com/

Perfect

Re: jQuery 4.0 99% Complete

#20
post #10

It has been a long time since I used jQuery. What exactly is the usecase today? Is it just syntactic sugar or has it changed significantly?

I think the main use case today is the dom traversal API. It makes operations like "add the 'error' class to all elements in the form" simple: $('#some-form').find('input').addClass('error') Obviously you can do this in vanilla JS, but it's more cumbersome so you'll probably end up rewriting your own less complete version of jquery. There is some value to using a well worn library with public documentation that other…

Is it that hard to:

    document.querySelectorAll("#some-form input").forEach(e => e.classList.add("error"));
Post reply on HN