4 ms·
This is what I've always thought the reason was as well. The JS ecosystem (at least since NPM has been around) has been about giving you the ability to not have
by ziml77 5y ago
This is what I've always thought the reason was as well. The JS ecosystem (at least since NPM has been around) has been about giving you the ability to not have to pull in a bloated, unfocused library. The complaints people have of libraries like that aren't even exclusive to the web. People working with C++ have long taken issue with massive dependencies. If the library is shipped as a DLL, then you end up bringing along all the code inside whether you use it or not.
But methods of removing unused code do a lot to take care of the problems that people have with larger libraries. In C++, header-only libraries help with the deployment size since it will only compile in what you're using. In Javascript, tree shaking will have the same effect.
It seems that if the Javascript ecosystem isn't moving towards larger libraries, it probably should. It would be much nicer to have one large library from a trusted source instead of a thousand small ones from who knows who.
- deleted 5y ago[deleted]
- soraminazuki 5y ago> If the library is shipped as a DLL, then you end up bringing along all the code inside whether you use it or not. Chances are, only parts of it would actually be loaded into memory due to how operating systems work.
- ziml77 5y agoEven if that's the case, you're still shipping the whole library. It's not an uncommon complaint that the file size of applications is massive (here on HN anyway, outside of tech I don't know if people really take notice).