Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

• that’s a solved problem: packages shouldn’t bundle CLI tools. Sindre Sorhus has been separating “CLI” from “API” for many years. “Unused dependencies” in general isn’t a solvable problem because a dependency might only be used if a certain parameter is passed. By the time that piece of code is reached, you either have it installed or it’s too late.

• that’s an issue that never got solved for the same reason: “package.json is never going away so we won’t add more ways to do the same thing” — ok so node/npm is going to suck forever, fantastic.



I think feature dependencies are better modeled than simple package splitting.

> For example, let’s say we have added some serialization support to our library, and it requires enabling a corresponding feature

> In this example, enabling the serde feature will enable the serde dependency. It will also enable the serde feature for the rgb dependency, but only if something else has enabled the rgb dependency.

https://doc.rust-lang.org/cargo/reference/features.html

It sounds better to install foo { features = serde } than foo, @foo/serde, and @bar/serde.


Npm has optional dependencies and there are libraries that error when you use a code push that requires them. Features would formalize that pattern and improve it with clear errors, and composability.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: