this post was submitted on 22 Jul 2023
43 points (100.0% liked)

Programming

13226 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 1 year ago
MODERATORS
 

This seem quite counter intuitive and to be bloating the project: i'm trying to install tsdoc linter, but npm adds like other 50 packages alongside with it, is this the expected behaviour? Why is it so?

A project that could easily be 5MB ends up being like 60MB

you are viewing a single comment's thread
view the rest of the comments
[–] JakenVeina@lemm.ee 6 points 1 year ago

In my mind, it's arisen as a result of two things about the JS ecosystem:

A) JS doesn't have a standard BCL, like most languages. It has the DOM API, for interacting with the browser, but it has almost no functionality baked in that is just there for the sake of it. There's a few exceptions in more recent years, like Map and Set, but most menial tasks still involve rolling your own implementation, or pulling in a 3rd party one.

B) Almost everyone places delivery size as the most-important concern in web apps, so that actively encourages (or at least, it used to, less so now that tree shaking is a big thing) developers to package things up at the tiniest possible granularity, in order to prevent applications being built with a ton of code that isn't being used. Ironically, at scale, this effort had the exact opposite of the desired effect.