1. 25
  1. 8

    Adding any dependency comes with the cost of complexity and file size, but jQuery is not that large: the default build is 30K minified/compressed,

    It’s kinda large.

    If all you care about is having a nicer interface, just use zepto or another light jquery alternative

    1. 4

      Zepto seems inactive: issues are not responded to, PRs are not merged or commented on. jQuery is still very much alive in this regard.

      The best-case advantage seems to be going from 30K to about 11K transfer size. In my case it’s actually going from 23K to 11K since I use a jQuery build which removes some parts I don’t use. These are pretty small gains even on slower connections.

      1. 1

        I believe there are new kids on the block that are even smaller. I haven’t needed to use one for a while, but if I did that’s what I’d be looking for, especially for anything meant to be used on mobile.

        1. 1

          I use intercooler.js for progressive enhancement, which requires either jQuery or Zepto. The catch is that it doesn’t work with the default build of Zepto; it needs the data extension added. I don’t have the file sizes handy, but that certainly narrows the benefit.

        2. 2

          I agree with the statement from the article that coming from bundles in > 1MB territory 30KB shouldn’t be the end of the world. And if it is, you can always switch to a lighter alternative.

        3. 7

          What’s more, if browsers simply bundled every 3.x version of jQuery and replaced the versioned official CDN requests with a cached copy, it would essentially be part of the JS stdlib. Perhaps also if Resig were more involved with standards bodies, as this is how Crockford ensured that JSON eventually made it in.

          An aside: I believe the main reason this never happened is because jQuery picked such an odd global (window.$). If they had picked window.qq (e.g. “quick query”) or window.$dom, I think someone in the browser community would have pushed for canonizing it. Meanwhile, somehow Crockford got browsers to implement Object.seal(), which I’m convinced has only a handful of users.

          1. 1

            jQuery sliders are inaccessible to screen readers and haven’t been fixed after 10 years, despite proposed fixes being posted. x-ref https://bugs.jqueryui.com/ticket/4739

            1. 5

              It’s a bit confusing because the names are so similar, but that’s jQuery-UI, which is a UI library built on top of jQuery by the same organisation. It has no direct relation to jQuery.

              Personally I never liked jQuery-UI by the way, and felt that trying to emulate desktop windows in the browser was never a good idea. The project also seems very inactive: there were a few commits last month, but the last one before that was over 2 years ago.

              1. 1

                Thank you for the clarification on the structure of the code. jQuery-UI is listed as a related project on https://jquery.com/ and the copyright for https://jqueryui.com/ is held by the same entity, the jQuery Foundation.

            Stories with similar links:

            1. Why I'm still using jQuery in 2019 authored by inactive-user 4 years ago | 45 points | 24 comments