3 ms·
Even after migrating to ES modules, jQuery is still somewhat bloated. It is 27 kB (minified + gzipped) [0]. In comparison, Preact is only 4.7 kB [1]. [0]: http
by maxloh 9mo ago
Even after migrating to ES modules, jQuery is still somewhat bloated. It is 27 kB (minified + gzipped) [0]. In comparison, Preact is only 4.7 kB [1].
[0]: https://bundlephobia.com/package/jquery@4.0.0 https://bundlephobia.com/package/jquery@4.0.0
[1]: https://bundlephobia.com/package/preact@10.28.2 https://bundlephobia.com/package/preact@10.28.2
- onion2k 9mo agojQuery does a lot more though, and includes support older browsers.
- ZeroAurora 9mo agoOfficially they state they only support 2 latest versions of chrome. But considering their support of IE11, that's actually a lot.
- halapro 9mo ago> includes support older browsers Which is entirely the issue. Supporting a browser for the 10 users who will update jQuery in 2025 is insane.
- mejutoco 9mo agoBreaking backwards compatibility to turn 27kb into less because of "bloat" makes less sense to me.
- shevy-java 9mo agoIt is definitely more than 10 users.
- halapro 9mo ago12
- topspin 9mo ago> Preact is only 4.7 kB Is there some outlier place where people using virtual DOM frameworks don't also include 100-200kb of "ecosystem" in addition to the framework? I suppose anything is possible, but I've never actually seen it. I have seen jQuery only sites. You get a lot for ~27kB.
- downsplat 9mo agoI do that when I need to make a simple SPA. Plain Vue plus a few tiny add-ons of my own.
- ttoinou 9mo agoLook at Deno + Fresh which is based on preact. You can do a lot with preact only
- leptons 9mo agoI use Preact for a very lean build for a front-end that lives in a small embedded MCU flash ROM. Gziped the whole front-end is about 25KB, including SVG images baked-in to the preact gzip file. I'm very careful about the libraries I include and their impact on the overall payload size. I had started with a simple front-end that was using jQuery to quickly prototype the device controls, but quickly exceeded my goal of keeping the front-end at under 40KB total gzipped. The problem is needing more than just jQuery, we also needed jQueryUI to help with the front-end, or build out similar complex components ourselves. And as soon as the jQuery code became non-trivial, it was clear that Preact made much more sense to use. Our payload is quite a bit smaller yhan the jQuery prototype was.