Live data from Hacker News

The impact of removing jQuery on our web performance

insidegovuk.blog.gov.uk

231–240 of 283 posts

Re: The impact of removing jQuery on our web performance

#231

Earlier quoted context omitted.

Won’t work Browser caches are partitioned by origin so if a.com and b.com both use jquery from c.com then two copies of jquery will be cached one with a key of a.com/c.com and another with b.com/c.com

Have browsers always done this? I thought and heard that using a JS library from CDN is beneficial when users already have that same cached JS library from visiting other sites. But you're saying that's not a thing? So what's the benefit of using a CDN for jquery then?

No, they have not always done this. But the supposed caching benefits of CDNs have always been overstated.

Re: The impact of removing jQuery on our web performance

#232
post #4

Has anyone noticed how all UK government websites like https://www.gov.uk/ , https://www.nhs.uk/ , https://tfl.gov.uk/ , https://coronavirus.data.gov.uk/ have the same look-and-feel and the same UX? Are there more such examples of countries that have uniform UX for their government websites?

It does have a big downside - some departments like Highways England and Land Registry had their own, more sophisticated sites.

The new standardised GOV.UK sites are missing features and content.

There's a sense of dumbing down to fit the design standards.

Re: The impact of removing jQuery on our web performance

#233
post #188
post #154

The team at gov.uk is doing an excellent job regarding web performance, credit where credit is due. In many ways role model behavior. Still, the results are such a stretch as to not have that much meaning. They have to descent all the way to 2G to see any meaningful difference, and I'm assuming they are cold visits (typical in lab-based testing). For those exceptional users, this creates a difference from very poor (…

12 seconds down to 9 seconds is not negligible. What is negligible is 12 down to 11.999 seconds because you prematurely optimized. And even for "normal" users, shaving milliseconds matter. The general idea is that a UI should respond within 100ms to feel instantaneous. More than 1s and you interrupt the flow of thought. According to Google research, increasing page load time from 1s to 3s increases bounce rate by 32%…

Are you able to share what you referenced as google research? I would love to dig into that.

Re: The impact of removing jQuery on our web performance

#234

Earlier quoted context omitted.

Try new stuff every once in a while. You might be surprised

There's a JS library called New Stuff? For me, I use Jquery because it works. Light and low impact. Syntax is good for readability.

jQuery has its own syntax?

Re: The impact of removing jQuery on our web performance

#235

Earlier quoted context omitted.

That still is a best practice. That "jumping around" is now referred to as "CLS" -- Cumulative Layout Shift -- one of the "Core Web Vitals" metrics used to quantify performance-related UX.

I sometmes like CLS, it makes it look like things are happening instead of feeling like a wait time. I recently used a simple templating mechanism elem = jquery.clone() ... elem.slideDown() And this renders bits of the page moving them as it does it; slideDown() is in jquery core. It used to be popular before that biz of rendering grey squares first got invented

Layout shift feels fairly terrible when you're navigating to an element that is at the bottom of the page (via #id) or simply refreshing the page. There is literally nothing more annoying than clicking the wrong link because the layout shifted under the cursor at just the wrong moment. CLS is also known as "jank" for a reason.

Re: The impact of removing jQuery on our web performance

#236
post #188
post #154

The team at gov.uk is doing an excellent job regarding web performance, credit where credit is due. In many ways role model behavior. Still, the results are such a stretch as to not have that much meaning. They have to descent all the way to 2G to see any meaningful difference, and I'm assuming they are cold visits (typical in lab-based testing). For those exceptional users, this creates a difference from very poor (…

12 seconds down to 9 seconds is not negligible. What is negligible is 12 down to 11.999 seconds because you prematurely optimized. And even for "normal" users, shaving milliseconds matter. The general idea is that a UI should respond within 100ms to feel instantaneous. More than 1s and you interrupt the flow of thought. According to Google research, increasing page load time from 1s to 3s increases bounce rate by 32%…

I think you misunderstood the comment you replied to. Their point wasn't that 12s to 9s is a negligible improvement generally. The point was that the improvement only applied to a tiny fraction of their users and it was still a bad experience, precisely because it was so far from 1s.

Re: The impact of removing jQuery on our web performance

#237
post #78

Earlier quoted context omitted.

I'm with you on fetch() requests not being able to be aborted, but I didn't think there were any other reasons to use XMLHttpRequest over fetch in 2022. I've been fetch() only for a few years as this point - what older browsers are you targeting that don't support fetch()?

Internet Explorer and older browsers support is important too. You must support browsers released within last 10 years and fetch is too new and experimental for this. I don't want to use something just because it is new and has no clear advantages over older technology.

Microsoft dropped support for IE in June 2022. https://caniuse.com/fetch shows that fetch() is now at 96.99% support for global users.

If you still need to support old IE you can use a library like https://github.com/github/fetch

Re: The impact of removing jQuery on our web performance

#238

Earlier quoted context omitted.

I wouldn’t read too much into 2G figures meaning 2G-only phones (or 3G). In my experience once you get out of populated areas connections often drop to 2G, even on my 5G capable iPhone. It’s mostly a coverage issue not a handset issue.

That's somewhat surprising. The US, which has plenty of rural areas with cell coverage, phased out 2G basically entirely over the past few years (only T-Mobile has a 2G network at all in the US now, and it's due to be sunset at the end of the year) Heck the US's 3G networks are all shutdown already, too, except for Verizon which is due to be turned off at the end of the year. Canada, also no stranger to rural areas,…

> The US, which has plenty of rural areas with cell coverage, phased out 2G basically entirely over the past few years (only T-Mobile has a 2G network at all in the US now,

There's still big gaps. My parents live in the middle of nowhere. Their service isn't classified as 2G but the 5G service is so spotty and the signal is so weak it might as well be. The US has a documented history of producing data to avoid serving these areas, same thing with internet.

Re: The impact of removing jQuery on our web performance

#239
post #154

The team at gov.uk is doing an excellent job regarding web performance, credit where credit is due. In many ways role model behavior. Still, the results are such a stretch as to not have that much meaning. They have to descent all the way to 2G to see any meaningful difference, and I'm assuming they are cold visits (typical in lab-based testing). For those exceptional users, this creates a difference from very poor (…

Exactly. It was cute for a few years, but these jQuery bashing thoughtpieces are so worn out now. As React and the long tail of frameworks slides into it's twilight years, it's clear in retrospect that jQuery was just a much more responsible and sound architecture (mostly because it cleaved to standards) than any of the things that spawned the 1000 "why I'm leaving jQuery for _this_" blogposts every day.

[deleted]

Re: The impact of removing jQuery on our web performance

#240

Honestly if they'd just used jQuery instead of React all the way through they'd be loading a lot less JS and performance would be vastly better on those slow old devices. After all, jQuery was made for the slow old devices, in the time they were not slow or old. The real problem is that jQuery is not new and shiny, and nobody wants to be doing jQuery in 2022.

In addition to which, jQuery was actual useful - React is just pure overhead with no real functionality.

[deleted]
Post reply on HN