3 ms·
In a “modern” JS project, the vast majority of dependencies are normally development dependencies. When you see so many generally 90% of it comes from dev/build
by charrondev 6y ago
In a “modern” JS project, the vast majority of dependencies are normally development dependencies. When you see so many generally 90% of it comes from dev/build time dependencies like webpack, typescript, linters, etc.
If you write hello world in rust, you wouldn’t act as if the generated binary has all of the runtime dependencies of of the compiler, unit test framework, formatted, etc. So why does JavaScript get the same treatment?
- ogre_codes 6y ago> So why does JavaScript get the same treatment? Because very frequently sites with minimal functionality have large piles of javascript. Web sites which should take milliseconds to launch take seconds instead. Some of this is ad-tech, but a lot of sites are overloaded with junk before the ad-tech gets stacked on top of it. Look at moment.js, the most used date library on the web. It is exceptionally common for people to add a library like that to a site to add a few basic bits of date parsing. (And yes I know moment is being sunsetted). Even if you assume these big piles of code do nothing once they are loaded, passing around and parsing big chunks of Javascript every time you launch a web page is a waste. Though as someone else pointed out above, web pages are not a big contributor to Global warming. It's just a frustrating, time consuming waste in most cases.