3 ms·
The small dependency thing is a sad artifact of the days when most JavaScript libraries were built to run on the browser. In that context, prior to the days of
by d4mi3n 5y ago
The small dependency thing is a sad artifact of the days when most JavaScript libraries were built to run on the browser. In that context, prior to the days of mature tools to do things like tree-shaking to remove unused code, the easiest way to make things smaller was to make JS modules as small as possible so code could opt-in to subsets of a library it wanted to use.
Fast forward 5 or 8 years and we have a very fragmented ecosystem of NPM modules—some built to be used on the web, some not—built on a legacy of tiny modules and deep dependency trees.
Add on to all that the pace at which the JS and browser ecosystem moves and it’s not too surprising that things have ended up the way they are.
Teams don’t need to build projects with deep dependency trees, but it’s pretty hard to avoid them with the NPM registry in the shape it’s in.
- MrBuddyCasino 5y ago> the easiest way to make things smaller was to make JS modules as small as possible so code could opt-in to subsets of a library it wanted to use Also due to JS having a very small stdlib. Compare built-in functions to eg Kotlin, its a different world.