News for hackers. Stuff that matters.
Re:You might not need jQuery (2014) by onion2k on Wednesday January 13, 2021 @11:11PM (#25771878)
I would prefer web developers accepted they need to write a few hundred lines of 'ugly' vanilla JS to drive their website than they include a 30KB library that they only really use 0.2KB of.

On the web, user experience should really be a higher priority than developer experience.

Re:You might not need jQuery (2014) by arp242 on Thursday January 14, 2021 @12:54AM (#25772640)
Hundreds of lines of ugly vanilla JS which duplicate jQuery features which aren't as well tested and probably don't handle all the edge cases.

> On the web, user experience should really be a higher priority than developer experience.

Those aren't disconnected. The more time I spend on technical implementation details, the less time I have to think about UX and/or implement things that improve UX.

Re:You might not need jQuery (2014) by robertlagrant on Thursday January 14, 2021 @03:48AM (#25773823)
If you're not seeing jQuery - as with every third party library - as something that now needs a mitigation plan in case it ever vanishes, and a security monitoring process to keep up upgraded, you're doing it wrong.
Re:You might not need jQuery (2014) by arp242 on Thursday January 14, 2021 @04:47AM (#25774296)
Why do I need a migration plan? I have jquery.js saved on my disk; that's never going to vanish, and it's not going to stop working if upstream decides to stop supporting it. And if I discover a bug then I can just fix it myself, just like any code saved on my disk.

jQuery rarely has security issues anyway; and the issues that do exist are usually low-impact. It certainly won't have any more than any code I'll write myself.

Re:You might not need jQuery (2014) by 6510 on Thursday January 14, 2021 @02:41AM (#25773363)
You just have to chose the right tool for the job and the limitations. You get something in return for doing the extra work and you get something in return for glue coding some libs. Also keep an eye on the experience points.
Re:You might not need jQuery (2014) by Dudeman112 on Thursday January 14, 2021 @06:45AM (#25775242)
If your website has two non thumbnail images in it, the 30KB library is gonna become a rounding error in the load time
Re:You might not need jQuery (2014) by dylan604 on Thursday January 14, 2021 @12:42AM (#25772558)
if the 30KB library is already cached because everyone else is using it too, then isn't it technically smaller than however many hundreds of lines of code you had to custobuild?
Re:You might not need jQuery (2014) by arp242 on Thursday January 14, 2021 @12:59AM (#25772672)
Most modern browsers don't really have global caches any more, and it's now all partitioned per-origin.

I do agree 30k is hardly worth thinking about.

Re:You might not need jQuery (2014) by satyrnein on Thursday January 14, 2021 @06:19AM (#25775031)
I think they are referring to loading it from a global CDN.
Re:You might not need jQuery (2014) by arp242 on Thursday January 14, 2021 @06:34AM (#25775159)
Re:You might not need jQuery (2014) by satyrnein on Thursday January 14, 2021 @12:32PM (#25779288)
Thanks, I didn't know that!