Comment by maxloh
20 hours 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].
20 hours 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].
> 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.
I 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.
Look at Deno + Fresh which is based on preact. You can do a lot with preact only
I do that when I need to make a simple SPA. Plain Vue plus a few tiny add-ons of my own.
jQuery does a lot more though, and includes support older browsers.
Officially they state they only support 2 latest versions of chrome. But considering their support of IE11, that's actually a lot.
> includes support older browsers
Which is entirely the issue. Supporting a browser for the 10 users who will update jQuery in 2025 is insane.
Breaking backwards compatibility to turn 27kb into less because of "bloat" makes less sense to me.
It is definitely more than 10 users.
1 reply →