Live data from Hacker News

jQuery 3.6.0

blog.jquery.com

241–250 of 292 posts

Re: jQuery 3.6.0

#241
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 still use it all the time because document.querySelector is nowhere nearly as good as $, and it's extremely verbose to create a nested tree of nodes in vanilla JS.

I've really forgetten how to do things without jQuery. If anyone knows a framework that is less verbose than jQuery please tell me!

Re: jQuery 3.6.0

#242
post #60

Earlier quoted context omitted.

Technically that breaks, you want: document.querySelectorAll('.my-class-selector').forEach(el => el.classList.add('active')) Personally I use the native APIs because they aren't that hard to use (most of them, anyways) and I tend to be OCD about bundle sizes, but to each their own, I suppose.

BTW, NodeList.prototype.forEach is not available on every browsers that supports querySelector/querySelectorAll, such as IE11: https://caniuse.com/mdn-api_nodelist_foreach So you need to be careful about writing code like that if you want to avoid jQuery.

We just don’t bother supporting IE11.

Re: jQuery 3.6.0

#243

Earlier quoted context omitted.

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

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

considering the size of frameworks like react, it's basically a "nothing" download. I've seen people spend more bandwidth on rounded corners.

Re: jQuery 3.6.0

#244

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

The reality was you where almost never getting a cached version anyway. There are so many versions of jQuery in use over so many CDNs that the chance of a user already having the exact version and cdn that you use is almost nothing.

We looked into this several years ago and found that most of our users had likely encountered and cached the several most popular versions on CDNs. There was a power law distribution in effect.

In the last five years, the release schedule has slowed, so there was a convergence onto fewer versions in the wild, but at the same time, users were visiting fewer sites that used CDN versions (and fewer sites in general.)

Re: jQuery 3.6.0

#245
post #93
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 help teach an introductory programming class to high school students. We still use jQuery to teach basic programming concepts, because it helps students add basic interactivity to a web page without a) the overhead of learning a full framework like React, or b) exposing them to the insanity of web APIs. Check out the curriculum if you're interested: https://github.com/itscodenation/curriculum-20-21 If you just want…

I've written a number of small apps for testing at my company with basically jquery+html+rust backend "web server" and it works quite well if you're not trying to get too fancy.

Re: jQuery 3.6.0

#246

Earlier quoted context omitted.

I'm exactly arguing against this Webpack, Typescript, React, etc approach to web development. I'm more productive in PHP + jQuery, a lot due to familiarity, of course, but I'm also a huge believer in a simple stack. If you've 20+ mutually dependent inputs, maybe you need a better UI, not a complex state management framework. If your browser is ultimately executing an untyped crazy dynamic language, is it worth trying…

At Work, we‘re building web applications that need to be accessed by hundreds of editors with thousands of pages. Most of them share an essential bundle of components. Are you telling me a project that complicated can be built using just jquery? Also, what‘s bad about typescript?

It can, sure, but having coding conventions is essential, which those frameworks/linters help to enforce.

But we've been doing projects with millions of pages way before React :)

Checkout Wikipedia, which, by the way, uses jQuery, of course. And PHP.

>Also, what‘s bad about typescript?

It tries to turn the very dynamic JavaScript into something it will never be and no amount of contortion can hide it. Unless it stops being a superset of JavaScript in the future, but I don't see that coming.

Re: jQuery 3.6.0

#247
post #133

Earlier quoted context omitted.

This. I was a happy Rails dev but html over the wire wasn’t cutting it at the club anymore. So I had to switch to React and now I’m married. Just kidding. My wife loves Rails.

Jokes on you, html over the wire is HOT NEW SH*T. https://hotwire.dev/

server-side blazor does similar.

Re: jQuery 3.6.0

#248
post #229

Earlier quoted context omitted.

on jQuery 4.0 roadmap page: https://github.com/jquery/jquery/milestone/7 , it seems having no progress in two full years.

Looks pretty active to me https://github.com/jquery/jquery/milestone/7?closed=1

Thanks! I will lean towards jquery more than vuejs as long as jquery is actively developed.

Re: jQuery 3.6.0

#249

Frontend has been a pain in the ass for me for quite a while as someone trying to learn frontend development. jQuery's concise syntax beats everyone, I hope Javascript can adapt it someday, truly a KISS design gem. However I do need write code to do data-binding myself, which is important for interactivity. Vuejs can be used to replace jQuery however it does not have the simple syntax, you do get data-binding for fre…

I remember the first time I used VueJS after being a long time JQuery developer. It was incredible how much power VueJS and similar frameworks put in your hand using such simple concepts. Not having to add event listeners to everything and manually re triggering things is revolutionary. I was building dynamic UIs with ease that would have been massive and bug prone jobs in jquery.

do you use the full spa framework, or just use vuejs like jquery(use script to include it in each page)? whenever you have to do vuejs full SPA framework it comes with quite some concepts which takes (a lot) time to digest and stay up to date.

Re: jQuery 3.6.0

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

I once used it for a proof of concept for computer worm type message on a sort of message board. Used to re-generate the source code to be added to new messages.
Post reply on HN