▲ | simonw 4 days ago | |||||||||||||||||||||||||||||||
I see lockfiles as something you use for applications you are deploying - if you run something like a web app it's very useful to know exactly what is being deployed to production, make sure it exactly matches staging and development environments, make sure you can audit new upgrades to your dependencies etc. This article appears to be talking about lockfiles for libraries - and I agree, for libraries you shouldn't be locking exact versions because it will inevitably pay havoc with other dependencies. Or maybe I'm missing something about the JavaScript ecosystem here? I mainly understand Python. | ||||||||||||||||||||||||||||||||
▲ | kaelwd 4 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
The lockfile only applies when you run `npm install` in the project directory, other projects using your package will have their own lockfile and resolve your dependencies using only your package.json. | ||||||||||||||||||||||||||||||||
▲ | 4 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
[deleted] | ||||||||||||||||||||||||||||||||
▲ | aidenn0 4 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
I think you missed the point of the article. Consider Application A, that depends on Library L1. Library L1 in turn depends on Library L2: A -> L1 -> L2 They are saying that A should not need a lockfile because it should specify a single version of L1 in its dependencies (i.e. using an == version check in Python), which in turn should specify a single version of L2 (again with an == version check). Obviously if everybody did this, then we wouldn't need lockfiles (which is what TFA says). The main downsides (which many comments here point out) are: 1. Transitive dependency conflicts would abound 2. Security updates are no longer in the hands of the app developers (in my above example, the developer of A1 is dependent on the developer of L1 whenever a security bug happens in L2). 3. When you update a direct dependency, your transitive dependencies may all change, making what you that was a small change into a big change. (FWIW, I put these in order of importance to me; I find #3 to be a nothingburger, since I've hardly ever updated a direct dependency without it increasing the minimum dependency of at least one of its dependencies). | ||||||||||||||||||||||||||||||||
|