3 ms·
That's because there's no point including an entire library if you only need a few functions. It means that your deployed bundle is much smaller, which means th
by whostolemyhat 7y ago
That's because there's no point including an entire library if you only need a few functions. It means that your deployed bundle is much smaller, which means that users don't need to download unused code and waste time/bandwidth (ie a good thing).
Tree shaking still isn't that great or widely available, so separate packages mean you can do this manually.
- fhennig 7y agoIf there is a set of standard libraries, wouldn't they be cached in the browser anyways?
- filleduchaos 7y ago> Tree shaking still isn't that great or widely available This sounds like an opinion based on the state of web development a decade ago. In 2020 on the other hand the Google Closure Compiler has been a mature project for years, and even projects not explicitly focused on dead code elimination (bundlers like Webpack and Rollup) do a decently thorough job of cutting out unnecessary code with the right plugins.