Live data from Hacker News

jQuery 3.6.0

blog.jquery.com

111–120 of 292 posts

Re: jQuery 3.6.0

#111
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…

[deleted]

Re: jQuery 3.6.0

#112
post #110

Earlier quoted context omitted.

> IMO, React doesn't bring much to the table in this regard while adding a lot of complexity and heft. Strongly disagree with this. In any complex web application with a lot of components, specially ones where a lot of fixed components can live for a while, React is definitely a massive improvement over vanilla JS or something like Backbone which allows wild west. Imagine state coming from sockets, rest APIs etc wit…

That's more like redux and company...

Yeah, but redux etc gained traction with React, and together they make SPAs good.

Re: jQuery 3.6.0

#113
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…

Firefox and Safari use partitioned caches, and Chrome is following with the feature behind an experiment flag for now. The argument that it's probably cached from a CDN is just about dead.

Re: jQuery 3.6.0

#114
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…

>most likely already cached from CDN.

I don't believe any major browser allows sites to share 3rd party caches anymore.

Previous HN discussion: https://news.ycombinator.com/item?id=24894135

Re: jQuery 3.6.0

#115
post #74
post #24

Earlier quoted context omitted.

If called on a Function it returns the source of the function, which allows for all sorts of meta programming.

If memory serves, a real world example was Angular doing a toString then injecting dependencies before calling eval on the new code. To be honest, I don’t know that there’s ever a good reason to use it in production as it almost always involves performance and security problems.

> involves performance [...] problems

Except when it solves them! https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to...

Re: jQuery 3.6.0

#116
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 write a lot of B2B apps that have tabular data views. For all of its quirks, DataTables (https://datatables.net) does a great job and with the right plugins offers all the features my customers expect (re-ordering/resizing columns, column based search, fixed headers, fixed columns, item selection, etc.) DataTables requires jQuery.

Lots of other vanilla JS table plugins out there but I can't find one with all of those features that work when they are all on.

Re: jQuery 3.6.0

#117
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…

I used to write a lot of JQuery, and I've switched to Vue three years ago. Occasionally I have to go back and write more JQuery, and it makes my head hurt.

edit: why the dowvotes? are we not allowed to share our experiences now?

Re: jQuery 3.6.0

#118

Earlier quoted context omitted.

Your example does not work. querySelectorAll returns array and you can't write `array.classList.add("...")`, because array does not have that property. You need to iterate over that array. And that's exactly why jQuery is so much more convenient over native API: you can just treat collections of elements like an element and jQuery will iterate for you if necessary. Another jQuery advantage is pseudo-selectors which d…

Just a nitpick, but querySelectorAll returns a NodeList. This can bite at times, for example IE supports Array.forEach, but not NodeList.forEach

Yeah this gets me every time. You can .forEach a NodeList, but can't .map. I usually end up wrapping it in an array and calling map on it like [...theNodeList].map(...)

Re: jQuery 3.6.0

#119
post #22

Earlier quoted context omitted.

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…

There's no need to complicate static sites with jQuery. All it does can be achieved with vanilla.

> All it does can be achieved with vanilla.

Well, yes. Every JS library can be written in vanilla JS. The point of jQuery, React, etc. is to make it easier for the programmer to reason about what is going on while avoiding bugs.

Re: jQuery 3.6.0

#120

Earlier quoted context omitted.

> When you just want to add a small bit of interaction to a mostly-static site Then I'd reach for Alpine. Very lightweight, and I can use the fetch API instead of $.ajax.

Jquery has been around for 14 years. That framework..16 months. You want to be as confident as possible you can bump to a new version on your old site in 4 years if you have to? Use Jquery.

Or just fork Alpine and fix it. It’s javascript, not rocket science.
Post reply on HN