4 ms·
The model you describe works well enough for Bundler with a Gemfile describing desired versions which can be loose or tight, and a Gemfile.lock specifying exact
by seanp2k2 10y ago
The model you describe works well enough for Bundler with a Gemfile describing desired versions which can be loose or tight, and a Gemfile.lock specifying exact versions for all dependencies. It works much better in practice than one without the other, as in the case of package.json and non-deterministic npm.
- mirekrusin 10y agoWhy are you saying that? You can freeze npm deps if you want to. Frankly npm does something very right which is allowing diffetent versions of the same dependency in nested tree of dependencies. I dont think there is another language which allows that?
- steveklabnik 10y agoCargo allows for multiple versions of transitive dependencies as well. We attempt to flatten as much as possible though.
- Groxx 10y agoYou can hack it in a fair number of languages, but yeah, NPM's approach is pretty uncommon. E.g. in Java, you can use "Jar Jar Links" to recompile a lib into a new namespace, which can allow multiple versions to coexist. NPM does make it transparent though, which is extremely convenient, and I can't name any other language that supports that. But that's not always an option. Bower exists for a reason - all that duplication / bloat is unacceptable for browsers to download. It can also mean hell for static initialization / mutable state, because there's no longer a single owner of the global resource.