Live data from Hacker News

The impact of removing jQuery on our web performance

insidegovuk.blog.gov.uk

171–180 of 283 posts

Re: The impact of removing jQuery on our web performance

#171
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?

A lot of things are starting to look the same, owing to the availability of ready-to-use templates by Mantine, antdesign, Material UI, etc.

For small projects, you almost don't need frontend chops anymore to deliver nifty looking goods.

I was kind of stunned to learn that even Apple uses MUI.

Re: The impact of removing jQuery on our web performance

#173
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 (…

> They have to descent all the way to 2G to see any meaningful difference

Somewhat shockingly according to https://www.cambridgewireless.co.uk/news/cw-journal/why-2g-w... 12% of mobile network connections in the UK are still on 2G? That's surprisingly high usage, and would definitely be worth optimizing. Although usage that high would then explain why 2G shutdown is still 10 years(!) away for the UK.

Phones still on 2G also seem likely the be phones that don't have the best of web browsers, so cold visits may still be more representative than it seems like it should be.

Re: The impact of removing jQuery on our web performance

#174

At the end he said a certain cohort of users, but how many users were actually in that cohort? JQuery is an older technology. I find it hard to believe something made to work on older hardware / internet is affecting performance that much. We have 5G and stupid fast chips in phones now. I’m skeptical. Performance issues are usually database queries or code compiling / “waking up” some server function.

Can I point you to this blog post from edent, on the importance of making government websites work for everyone: https://shkspr.mobi/blog/2021/01/the-unreasonable-effectiven...

This quote really hammers the authors point home, I remembered this article on this alone:

> But the GOV.UK pages are written in simple HTML. They are designed to be lightweight and will work even on rubbish browsers. They have to. This is for everyone.

Re: The impact of removing jQuery on our web performance

#175
post #115

Earlier quoted context omitted.

Every local councill has a different payment system for colecting councill tax, and all of them fail in novel and unpredictable ways. Last time they collected my name and address over the phone and got both of them wrong. Then they were sending letter to a person that doesn't exist, to an address that doesnt exist, never used my email or phone number, didn't respond to my email, but still told me it's my fault!

I had the fun experience of my local (UK, major city) council sending debt collectors after me for non-payment of council tax while simultaneously (literally same week) asking what bank account to send the several thousand pounds they owed me for overpayment - because they failed to acknowledge that despite having moved address, I was still the same person, and their systems treated each address as an account not eac…

You pay council tax on your address, not on an individual basis. So if you moved house and didn't tell them, they quite reasonably would have counted the payments towards your old address, not your new one.

Re: The impact of removing jQuery on our web performance

#176
post #57

Earlier quoted context omitted.

You have to really do some extra work to make this happen "nicely". Swapping out parts of the page without jerking the user around is a difficult problem, especially if you aren't working with fixed sizes of elements. And creating a "skeleton" system of placeholders during loading is a whole other set of state you have to build out and maintain. I find most sites using this kind of progressive loading are completely…

I remember how it was good practice to assign width and height to tags. The idea being the browser would know how to render the things around the picture without needing to download the picture first, preventing the page from jumping around as the quicker and lighter HTML was downloaded and rendered first.

I use aspect ratio for this now that it's supported in CSS. It might be my favorite CSS feature since flex.

Re: The impact of removing jQuery on our web performance

#177

Earlier quoted context omitted.

jQuery is more convenient to use than vanilla JS. Vanilla JS is too verbose. If only jQuery was modular and didn't require to load 300 or 400 Kb of code. Also it is difficult to find non-jQuery library of a good quality. For example, I was looking for a small library to send and receive JSON via HTTP, and ended up writing my own wrapper around XMLHttpRequest (fetch() is a poor choice, it is not supported well in olde…

fetch() can definitely be aborted, and what "older browsers" don't support fetch? You must be talking maybe about Internet Explorer 11, the only older browser that is still somewhat used (in Japan and public/old infra) that doesn't support it? https://caniuse.com/fetch

Since the gov.uk page is talking about 2G users, I'd imagine that "old browsers" here means "whatever Nokia shipped over a decade ago"

Re: The impact of removing jQuery on our web performance

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

Re: The impact of removing jQuery on our web performance

#179

Earlier quoted context omitted.

If you are mainly using jquery for its DOM manipulation¹ rather than for browser compatibility² or things that didn't exist consistently in older browsers³ then there are much smaller libraries that do that job which may be worth looking into. https://github.com/fabiospampinato/cash or https://github.com/franciscop/umbrella to give a couple of examples. Some explicitly support IE11 so you are not dropping as much sup…

I'm a big jQuery fan. Some new frameworks that do DOM binding are just too "magic". Sometimes there is close to zero js code for a page, which, while cool, means it's hard to find out what to do to add new featues when the default behaviour is not what you want. With Jquery it seems the balance of writing code to make page active, and not writing too much code, is correct. I guess I prefer reading code than docs.

Yeah, for what little front-end dev I do these days I prefer to keep the abstraction a bit more at the jQuery level.

Quite a few of the mini-jQuery libraries, like the ones I linked to, are doing just that and allowing the sort of DOM manipulation it does but without all the other stuff.

Re: The impact of removing jQuery on our web performance

#180

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.
Post reply on HN