3 ms·
> The project I'm working on has over 1000 modules in it's dependency tree. Why is that a number you care about? Is it causing you actual problems during devel
by lmm 9y ago
> The project I'm working on has over 1000 modules in it's dependency tree.
Why is that a number you care about? Is it causing you actual problems during development, or are you just offended that it's a big number?
- lozenge 9y ago1000 opportunities for semver to go wrong. And what happens if dependencies pin different versions of their dependencies? The code is duplicated in the JS bundle?
- throwanem 9y agoBoth versions appear there, yes. Not ideal, but I'd be interested to hear what you regard as more optimal behavior in the context of a dependency graph like the one you assume. (Dependency bloat can be a real thing, sure. But if I have to choose between adding a dependency on a solid, well-built module and spending the time to reinvent the same complex wheel all by myself, I'm going to pick the option that gets me more quickly to done, 100% of the time. I'm paid to bring business value, and while minimizing technical debt where it counts is a big part of that, spending unbounded time to satisfy my own peculiar notion of software perfectibility is most emphatically not.)
- PeterisP 9y agoIf you're distributing software, that means that you need to verify the source each of the 1000 dependencies, check if the licence is appropriate, and verify that there aren't any current published vulnerabilities in the version that you're using. Doing this bare minimum of due diligence is easy if you have 10 dependencies, but quite costly for a 1000.
- Sacho 9y agoI don't see how the number of dependencies is important here, instead of their size. You can trivially automate license checks. The number is misleading anyway, because many "packaged" libraries that you would normally look at as a single module are split into individual modules for perf reasons.
- always_good 9y agoBecause you need to trust 1000 different people.
- Sacho 9y agoAgain, it's not about the number of people, is it? You don't have 1000 top level dependencies, so you're not trusting 1000 entities. If you're really talking about people, companies that produce libraries have hundreds of employees - do you "trust" them all? No, what you're talking about is establishing a web of trust, and you can do that in JS as well. Use a framework, use a library that combines a set of tools together. There's nothing particularly different about JS in this regard - there are plenty of large-scale development shops(Google, Facebook, Mozilla, Yahoo, Netflix..) which offer code, alongside a healthy open source community. You choose what to use.
- always_good 9y ago1000 transitive dependencies is not the same as a single dependency with 1000 employees. For one, I highly doubt each employee can `npm publish`. Consider the destructiveness of someone malicious befriending the left-pad developer, taking the project over, and doing a malicious push. I'd say the scale of the potential destruction in so many tiny, few-eyeballed modules is unique to the npm ecosystem for better or worse. It's one of the security downsides of the ecosystem especially in the online casino space where I work. For example, getting an online casino's `npm ls` (full depth) would be a good place to start. The scale of transitive deps we're talking about when compared to any other ecosystem is quite excessive, but also just how tiny many of those deps are.
- Sacho 9y ago> Consider the destructiveness of someone malicious befriending the left-pad developer, taking the project over, and doing a malicious push. Not different from someone befriending a corporate employee and asking them to insert some malicious code into the codebase. You still rely on a web of trust - in the company's case, the code reviewers, in the open source example, the maintainers of the libraries that use left-pad. I don't think this argument really holds, I don't know what you're comparing it against that's different.
- datashaman 9y agohttps://dependencyci.com https://dependencyci.com