Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming United Kingdom

Why Gov.UK Stopped Using jQuery (web.dev) 88

The head of the UK government's digital transformation unit recently announced a change to the nation's government services site gov.uk: they've "removed jQuery as a dependency for all frontend apps, meaning 32 KB of minified and compressed JavaScript was removed" for everything from selecting elements to attaching event listeners....

Nearly 84% of mobile pages used jQuery in 2021, points out a new essay at Gov.UK — before explaining why they decided not to: jQuery was an instrumental tool in a time when we really needed a way to script interactivity in a way that smoothed over the differing implementations of stuff like event handling, selecting elements, animating elements, and so on.

The web is better because of jQuery — not just because it has such incredible utility, but because its ubiquity led to making what it provided part of the web platform itself. Nowadays, we can do just about anything jQuery can do in vanilla JavaScript... It really begs the question: Do we really need jQuery today? That's a question that GOV.UK has answered with a resounding "no"....

This is a big deal when it comes to the user experience, because GOV.UK provides services and information online for The United Kingdom at scale. Not everyone is tapping away on their 2022 MacBook Pro on a rip-roarin' broadband connection. GOV.UK has to be accessible to everyone, and that means keepin' it lean.... dependencies matter when it comes to performance. Don't shortchange your users if the web platform can easily do the job a framework can.

This level of commitment to the user experience from a institution that works at the scale GOV.UK does is commendable. I can only hope others follow in their footsteps.

This discussion has been archived. No new comments can be posted.

Why Gov.UK Stopped Using jQuery

Comments Filter:
  • by Schoenlepel ( 1751646 ) on Saturday May 21, 2022 @03:25PM (#62555092)

    Why are we still using it in web browser and *shudder* server software?

    There are countless problems with it. Why not use another language, for web front-end... like brainfuck. Brainfuck has (iirc) only 8 statements, each one character long.

    Another option is whitespace. There's lots of room for comments in that language.

  • Welcome to the UK (Score:4, Interesting)

    by civ2junky ( 414061 ) on Saturday May 21, 2022 @03:42PM (#62555112) Homepage

    I can assure you, being a resident of the UK, that this doubtlessly disenfranchises more people than it takes care of. While our broadband rollout is appalling our economy and education are second to everyone. Basically, old browsers and old computers will rule out more people than 32K of compressed javascript. The government of the UK hates the working class. They have a success mechanism revolving around exploiting their fears and as such see every opportunity to increase those fears. Lack of access and education breeds stupidity, stupidity breeds fear, fear breeds the easily led. This is the Tory mantra. They are almost literally the Sith of politics. Almost no one hear can see or hear it, they're caught up in the wrangles between left and right, often in the same party. Often in engineered controversy, manufactured and employed. Tick tock. We're a hairs breadth away from facism over here. A prime minister that can evade any controversy isn't even regarded as blatant.

    • The GOV.UK domain and sites are independent of any specific political party?

      Been around for many years ...

      And surely removing unused dependencies from web access only adds to the accessibility/servcies for all thing, not detracts?

      • by mjwx ( 966435 )

        The GOV.UK domain and sites are independent of any specific political party?

        Been around for many years ...

        And surely removing unused dependencies from web access only adds to the accessibility/servcies for all thing, not detracts?

        This. OP has clearly never had to use any other government's online (or offline) services. When I moved to the UK I found the GOV.UK sites, everything from HMVI to DWP to even the DVLA to be simple and easy to use. Just accept that the British are fastidious about forms and make sure you follow all instructions when filling them out. This is a lot better than Australia, who's government IT projects are never finished piles of crap that cost 3 times as much as they needed to (govt contract in Oz == License

    • by narcc ( 412956 )

      Why? jQuery didn't exactly help when it came to legacy browser support, and could even make the problem worse. Not that it matters now, as it dropped "support" for older browsers a long time ago. Anyone writing to standards should have no problems writing code that works just just as well on a new computer as one that's 10 years old without the help of a half-assed bloated library written by an incompetent who was still struggling to learn the basics.

    • by Kremmy ( 793693 )
      We long ago reached a point where older machines and the Web just don't get along. It's just not worth the effort to write things to a decade old standard anymore. Let the old machines die. They deserve their rest.
      • Nothing wrong with old machines. It's old software running on them which is the problem. Even on a 32 bit machine from a decade or more ago, you can certainly run a modern browser... just not with the operating system originally installed on it all those years ago.

    • by Ed_1024 ( 744566 )

      What has that got to do with gov.uk? Having had to use a large selection of other countries government web portals as I travelled a lot during the pandemic, the UK one stood out as being the easiest to use and most responsive by a long way. It provides a consistent interface for virtually everything a UK citizen needs to do online, which is more than I can say for the USA, for example, and is set up for maximum accessibility and speed.

      There are lots of things wrong in GB but gov.uk is not one of them, IMO.

  • Comment removed (Score:5, Informative)

    by account_deleted ( 4530225 ) on Saturday May 21, 2022 @04:21PM (#62555164)
    Comment removed based on user account deletion
    • by narcc ( 412956 )

      And guess what tool allows you to support both modern and legacy browsers at once?

      What is it? It's definitely not jQuery.

    • by Kremmy ( 793693 )
      It's an abstraction layer.
      Computers are really bad about those these days, it's abstraction layers all the way down.
      Sometimes it's just better to write code without relying on abstraction layer after abstraction layer.
      Sometimes it's better to not try to support old browsers that are probably a nasty security issue on the computers running them.
      Sometimes it's better to just create a damn website without making it so complicated that it doesn't work across browsers...
      Browsers bloated in the 90s folks, weren't
    • ?I agree mostly. If a framework or tool allows you to prototype, iterate, develop, and/or debug faster, that's a win. Building a website from scratch is a slow process. Personally I use Angular and Angular Material and I can get a UI prototyped in almost no time at all, and then immediately start filling in functionality. Much better than the good ol' days when all we had was jQuery or nothing.

      The caveat I have is about performance. jQuery specifically I doubt makes much of an impact, unless they were hosti

    • by AmiMoJo ( 196126 )

      If you want half decent performance you need to parse and compile that Javascript into something more efficient, like bytecode or even native code. That's where the memory and CPU time go.

      All modern browsers do that.

  • I gather from these comments that Slashdot hates jquery, but I didn't see any actual reasons for it. IMO jquery is efficient, elegant, and useful in many situations. What specifically is wrong with it?
    • The issue is that the only people efficient and elegant are the people you ought to have passed by in the hiring process because it’s none of those things.. it’s fine for amateurs and people who don’t know the stack but not for a professional setting.
    • by Kremmy ( 793693 )
      jQuery does this thing where it takes all these totally different yet vaguely related concepts and turns them into a single operator, and pretends it did a good thing.
    • by Bahbus ( 1180627 )

      JQuery provides no tangible benefits for existing either. Its usage is for amateurs who don't know what they are doing. Hell, all of JavaScript is a convoluted shitshow of a mess. It's such a terribly designed language and I cannot wait for its death.

  • If the register is accurate, almost every other week there is some news or other about cost overruns or deadlines being extended for IT projects in UK.

    Lets see how this goes.

  • The past decade has been great for JS development being somewhat standardized, and yes, the "need" (risk-vs-reward scenario) for jQuery to handle a lot of things on multiple browsers has been diminished in that time. But the need for a jQuery like project will always exist because not all browsers will implement things exactly as intended - and that's when jQuery can save a lot of development and testing time. But let's not kid ourselves here: they still reinvented the wheel removing it from pages that we
  • You can usually tell when a site is using one or more frameworks; it's slow. Those that use native JavaScript are lean and peppy. Frameworks present gobs of extra code to load and compile on the client side, and can encourage sloppy and inefficient code design (especially jQuery). Today's compiled frameworks (like Angular) are a good solution for those who really like the convenience of frameworks, but want to avoid the client-side load. These provide all the extensive functions of frameworks, then compile

You know you've landed gear-up when it takes full power to taxi.

Working...