This 352.8 kB react component with 8.1M million weekly downloads can go away when CSS `field-sizing` browser support expands.
Zach Leatherman 2121 replies 6868 likes1111 reposts11 quote Original on MastodonOriginal on BlueskyAlso posted to Mastodon.
21 replies
-
-
@zachleat 352KB for a script that resizes textareas? What spying is it doing with the remaining 350KB?
@zachleat “Can” doing a lot of work there
Problem is: it probably won’t. React devs seem to wear blinkers when it comes to CSS functionality. Pretty hard when you’ve had a virtual dom lobotomy 😵💫
All for it, but please, 352kb is the install size. Bundle size is 1.6kb minzipped.
Wish these tools did a better job at presenting bundled size
depends on a lot of things though, like the bundler or if deps are bundled or excluded etc..
Yeah not an easy problem. Should include non-peer deps at least
hm? bundle size isn’t the only important concern worth scrutinizing (though stating bundle size independent of dependency/library bundle cost is one of my mildest pet peeves 😅)
If someone reads:
> This 352.8 kB react component
Then the first instinct will be that 350kb will be shipped to consumers if I use that component. That’s not the case, so why frame it that way?
that's always been my biggest annoyance with package listings on NPM (and now seemingly NPMX). Yes, download size and install size in node_modules matter... but those are often radically different than bundle size shipped to the browser, and that doesn't get surfaced very well.
ahh, hmm — that’s a fair critique of my post. it looks like bundle versus install weight is a pet peeve of yours! 😅
I definitely read it as 325kb shipped to browser. I get both numbers are worth considering, but if I'm only gonna get one, I want the one that impacts the folks using my site over the one during dev.
(in this case just the fact that you can remove it is cool enough for me regardless of size impact)
I'm curious where you got 1.6kb. Is that locally with treeshaking or something?
I see 5.26kb gzipped on bundlejs
likely excluding peerdeps zachleat.github.io/bundlewhys/?...
Ahhh. That'll do it
Yeah I got it from bundlephobia which is usually too large because it doesn't do esm I think
fwiw whats actually shipped to the browser for this library is 13.6kb (5.26kb gzipped)