I visited the homepages of the 14.8 million sites in Google’s Chrome UX Report in October.

I thought jQuery would be dead, but it’s still on 53.7% of sites, and it seems to be tied quite tightly to the platform. Webflow puts it on 97.6% of its sites, WordPress on 84.9%. For contrast, React is on 10.6% of sites.

jQuery helped me get into web development, and I guess it still gets the job done even if redundant with browser standards these days…

  • Azura The Spellkissed@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    13
    ·
    2 days ago

    To be fair, jQuery isn’t bad or outdated. Not everything on the web tries to be a webapp. If you just want to load a comments widget or handle form submission, vanilla js or jQuery can be better than frameworks that add bloat and many moving parts that could break.

    • thewebreport@programming.devOP
      link
      fedilink
      arrow-up
      3
      ·
      1 day ago

      Ran some numbers - Core Web Vital pass rates:

      • jQuery, no React - 4.17M sites - 62.2%
      • React, no jQuery - 748k sites - 65.5%

      The jQuery, no React - is mainly WordPress sites, taking that out of the equation:

      • jQuery, no React, not WordPress - 1.75M sites - 72.5%
      • jQuery, no React, WordPress - 2.42M sites - 54.8%

      So outside WordPress, jQuery sites pass more often than React sites.

      INP is where React is worse. INP is the responsiveness metric. 95% of jQuery sites have good INP, against 87% of React sites. Probably the cost of large JS bundles hydrating on load, whereas a small jQuery script costs relatively little.

      And there’s a small group of sites that run both, and predictably perform the worst of the lot with 41.8% pass rate.

      It’s not something we measure ( yet ) but does seem there’s a lot of simple brochure site that really just don’t need react, pre-rendering and a lot of the complexity that comes with it, but maybe that’s a developer convenience / preference.

    • Skullgrid@lemmy.world
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      2 days ago

      yeah, I never learnt jquery because it just seems like a re-implementation of shit that is currently supported, but some of it apparently came from jquery.

      did it have a security leak or something?

      • webhead@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        2 days ago

        I dunno but people seem really hell bent on getting rid of it for some reason. I think it’s just that web developers are constantly using some new framework and anything that’s not that they go “ew” like every single website must have the same overblown needs they do lol.

        • doughless@lemmy.world
          link
          fedilink
          arrow-up
          3
          ·
          1 day ago

          For me, the reason is because everything I used jQuery for is now available in native JavaScript. That said, React is definitely more bloated, so I’m stepping over dollars to pick up pennies.

    • tatterdemalion@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      Forgive me if I’m off base, because I have not used jquery personally, but from what I’ve read, jQuery is both redundant and has a lot of footguns. I think it’s reasonable for people to discourage its use, especially for new applications that simply don’t need it.

      • Hmm, my instinct tells me to defend myself, but honestly, you are basically right. I meant to say “not everything needs React/…”, but my comment accidentally defended jQuery instead. One cannot really recommend anymore to start developing with jQuery, that’s true. However, I wouldn’t necessarily urge existing websites to move away from it either, it’s not really that nasty. In that regard, my previous comment was confusing. jQuery kinda is outdated, but not dangerously so. There are some footguns, like using selectors with string interpolation with unsafe input (which yeeaars ago could lead to HTML injection, but even now, unsafe input might contain unexpected commas), but I wouldn’t trust the same devs who make those mistakes to make less mistakes with e.g. Angular.