Live data from Hacker News

jQuery 3.6.0

blog.jquery.com

191–200 of 292 posts

Re: jQuery 3.6.0

#191
post #6

Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…

>Do people still use jQuery? Oh yes. Everyday. Still love it. >…Javascript document api via document.querySelector, and document.querySelectorAll The jQuery API is still (and probably aways will be) far superior to the native DOM (terser, composable, more expressive, etc). >…smaller footprint libraries like lodash jQuery is ≈30k gziped and most likely already cached from CDN. >…has fallen out of favor of more compreh…

"The jQuery API is still (and probably aways will be) far superior to the native DOM"

The jQuery API really is so well done. I stopped using jQuery, but implemented a simple script (jSugar.js) that exposes many basic jQuery things but is really just a wrapper for native DOM operations. It only operates on individual DOM nodes. Any looping should be done using your JS loop of choice (forEach, for loop, which, etc).

The script started out really small. I've slowly added more and more as I need more functionality for some projects.

https://gist.github.com/pseudosavant/b86eedd9960ade958d49447...

Re: jQuery 3.6.0

#192
I sometimes look at react, and these modern frameworks and wish they had a same nice API as jQuery. I still profoundly remember how much simple it was compared to Prototype.js, and how simple it was to do a zebra stripes on table. I am still looking for that next piece of revolutionary simple library that will bring the joy of jQuery with modern concepts and simplicity.

Re: jQuery 3.6.0

#193
post #145

Earlier quoted context omitted.

Well, you are still getting less server load and faster response times across the globe, right?

> …and faster response times across the globe, right? Unfortunately not. There is no benefit to leaving your critical files on anyone else’s infrastructure: https://csswizardry.com/2019/05/self-host-your-static-assets...

As someone who is well experienced in web dev, that was a great article! Not so easy to find online, keep up the good work and I’ve become a fan

Re: jQuery 3.6.0

#194
post #6

Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…

> What is the current use-case for jQuery?

WordPress ships with it, so using jQuery often doesn't require any extra footprint. I still prefer vanilla calls for admin-only code, but jQuery has better compatibility for user-facing pages.

Re: jQuery 3.6.0

#195

Earlier quoted context omitted.

> jQuery is ≈30k gziped and most likely already cached from CDN. This part isn't so true in reality anymore, due to revised browser caching systems[1]. Doesn't mean you shouldn't use jQuery, just that part of the benefits of a centralized CDN are no longer a factor and it's a lot more sensible to self-host. 1: https://www.stefanjudis.com/notes/say-goodbye-to-resource-ca...

One thing that doesn't help jquery's case is that it and its plugin ecosystem isn't modular, making it impossible to trim the code size below the minified size via dead code elimination or even es6 partial imports. It would be nice to see more fluent DOM apis like jquery, but having 1st class support for es6 modules so you can import only the functionality you need in your final bundle

ZeptoJS has a modular build tool, allowing you to select only the desired modules

https://zeptojs.com/

Re: jQuery 3.6.0

#196
post #6

Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…

> there are rowser compatibility issues that jQuery solved

Current browser support[1] isn't really _that_ great. I know it used to be, but I'm not sure that's a legit selling point these days. Not that it's bad, but I hear that argument come up a lot.

[1]: https://jquery.com/browser-support/

Re: jQuery 3.6.0

#197
I think a lot of the comments in this thread that are critical of SPAs are thinking about them wrong.

SPAs aren't (shouldn't be) a replacement for websites.

They are a fantastic option for replacing native apps (PWAs).

Moving from walled garden native apps to the open web is good for everyone except the app stores.

Re: jQuery 3.6.0

#198

Earlier quoted context omitted.

> jQuery is ≈30k gziped and most likely already cached from CDN. This part isn't so true in reality anymore, due to revised browser caching systems[1]. Doesn't mean you shouldn't use jQuery, just that part of the benefits of a centralized CDN are no longer a factor and it's a lot more sensible to self-host. 1: https://www.stefanjudis.com/notes/say-goodbye-to-resource-ca...

One thing that doesn't help jquery's case is that it and its plugin ecosystem isn't modular, making it impossible to trim the code size below the minified size via dead code elimination or even es6 partial imports. It would be nice to see more fluent DOM apis like jquery, but having 1st class support for es6 modules so you can import only the functionality you need in your final bundle

Cash supports partial builds:

https://github.com/fabiospampinato/cash/blob/master/docs/par...

Re: jQuery 3.6.0

#199
post #22
post #6

Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…

I think a lot! For example, the new https://www.whitehouse.gov uses jQuery. When you just want to add a small bit of interaction to a mostly-static site, jQuery can help. There's a current trend to complicate things with a JAM stack that really don't need to be complicated. I've seen people propose something like [NodeJS/Ruby/PHP backend] -> GraphQL API -> React Frontend -> static html Where really they could have ju…

> When you just want to add a small bit of interaction to a mostly-static site, jQuery can help.

For very small amounts, perhaps, but honestly, even then I think it has limitations. As an anecdote, about six months ago, I needed to add a couple of dynamic forms to a static site. The forms were a simple contact us, and a mailing list sign up form, and only needed to handle the states of Open->Submitting->Thanks|Failed->Open, while preventing double submissions, etc.

I wrote the first one in jQuery (site was already using it due to the theming), and making sure handled all the various edge cases, and fixing one bug didn't cause another was far harder and time consuming than it should be.

Out of frustration, I wrote the other form in VueJS, and hacked the whole form in about an hour or two. My take away was that anything involving state in jQuery can get overly complicated very quickly.

Re: jQuery 3.6.0

#200
post #6

Do people still use jQuery? I thought the biggest advantage of this library back in the day was css selector access of DOM nodes (back when we only had getElementById, getElementsByClassName, and getElementsByTagName). This has been rolled into the Javascript document api via document.querySelector, and document.querySelectorAll. Also there are browser compatibility issues that jQuery solved but a lot of these are so…

> Do people still use jQuery?

A ton.

jQuery is still holding up the client side code of a lot of projects I've worked on and doing a pretty decent job at it.

Sure they could be rewritten to not use it but there really hasn't been a business reason to do it.

Though I personally wouldn't use it on a new project moving forward that's for sure.

Post reply on HN