A "fun" game: in the prettyprinted bundle, hit Ctrl-f, then search for `Object.assign ||` How many matches?
-
Show this thread
-
-
Replying to @matthewcp @slightlylate
Object.assign || means there’s polyfills, I suppose.
2 replies 0 retweets 0 likes -
Replying to @mikesherov @matthewcp
Yep. And current toolchains seem to re-include the literal text of the polyfill instead of ref-ing it (the way they do for the inevitable Promise or regenerator runtime bloat). It's hilarious how many copies some files have.
1 reply 0 retweets 1 like -
This because we usually are bundling bundles (exclude: /node_modules/) and our tools can't/don't/won't unbundle code to ensure that OUR bundle just has one copy of the packages further down the tree, right?
1 reply 0 retweets 2 likes -
...and this is why NPM is a disaster for frontend.
2 replies 0 retweets 3 likes -
Not really a disaster. You can dedupe in Webpack or any bundler if you know what you’re doing. For Webpack at least, you can do: alias: { 'name-of-package': 'node_modules/name-of-package' } So that even transitive uses of the package reference the top level one.
1 reply 0 retweets 1 like -
This _would_ work great is more packages weren't bundled and compiled already in the `main` entry. And, thanks for the suggestion! But, also sad that this sort of collapsing can't be the default of a tool as opposed to the "when you know what you're doing" option.
1 reply 0 retweets 2 likes -
Nested dependencies is a flexible choice, can’t do it by default. Also, I agree with you pre bundling isn’t great but tide is slowly shifting now that modules is everywhere.
1 reply 0 retweets 1 like -
You can't dedupe what a module pre-transpiled, and NPM continues (at this far too late date) to lack a way to publish minimally transpiled code alongside "fully compatible" artifacts
3 replies 0 retweets 1 like
So yes, disaster. NPM's sins are the now-traditional SV omission-based ambivalence towards ecosystem health, but those of us who see the whole chain know to apportion some responsibility there too.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.