News for hackers. Stuff that matters.
Re:Size of node_modules folder when installing the top 100 p... by thrower123 on Thursday January 09, 2020 @09:51PM (#22007999)
I mean, we used to all just use jQuery and lodash. Then the cool kids decided that wasn't cool anymore, and every function should be a separate package.

I'm sure the wheel will come around again.

Re:Size of node_modules folder when installing the top 100 p... by other_herbert on Thursday January 09, 2020 @11:23PM (#22008276)
Show us this, "the wheel"
Re:Size of node_modules folder when installing the top 100 p... by other_herbert on Friday January 10, 2020 @12:46PM (#22012903)
man tough crowd :)... I thought more of you would've gotten the Futurama reference ... Fear of a bot planet.. I think..

edit no, the one with the evolution of robots and such

Re:Size of node_modules folder when installing the top 100 p... by whostolemyhat on Friday January 10, 2020 @04:22AM (#22009614)
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.

Re:Size of node_modules folder when installing the top 100 p... by filleduchaos on Friday January 10, 2020 @07:04AM (#22010386)
> 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.

Re:Size of node_modules folder when installing the top 100 p... by fhennig on Friday January 10, 2020 @06:47AM (#22010318)
If there is a set of standard libraries, wouldn't they be cached in the browser anyways?