New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What do you think of lockfiles? #479
Comments
|
The purpose of lockfile is to lock the explicit package version and checksum, since package.json doesn't do that (like |
|
The lockfile defeats the whole purpose of the caret |
|
Just FYI, Sindre let me know on Twitter that he doesn’t intend to commit the
|
|
@sonicdoe yeah that's the reason i ask him here. maybe he can explain a bit more here |
|
@luftywiranda13 I think he don't intent to commit it for the packages, and I think it shouldn't be also. The package should be flexible and shouldn't lock the user from using newer packages it depends on. |
|
@dangh but i have a specific concern behind this as the reason why post him a question here, but let's just wait for Sindre to answer first then maybe we can discuss it 😄 |
|
Lockfiles for apps, but not for packages. Lockfiles are great for apps where you want a controlled reproducible environment, but for packages this doesn't make much sense. The |
It's a much needed rewrite with many nice features, but it's currently way too buggy for actual usage: npm/npm#16991 I'm staying on npm v4 for now. |
|
If you 👎 my comment, please tell me how I'm wrong (with technical arguments). |
Lockfiles are good for apps, not packages. See sindresorhus/ama#479 (comment).
Lockfiles are good for apps, not packages. See sindresorhus/ama#479 (comment).
|
I just found this article on the yarn blog regarding lockfiles : they explain why (in their opinion) lockfiles should also be committed for libraries. |
|
I think adding a lockfile for any project is extremely valuable as it reduces the amount of unknowns when debugging issues. More knowledge is more valuable than less in my opinion. Theoretically if someone comes in with a breaking change after installing a package as a dependency you can have them locally install the package (having the lockfile manage the dependencies), symlink to the local with the expected dependencies, and check if the problem still exists. If so, then you've easily narrowed down what the problem could be. Granted there may be a better way to detect if versions being out of sync are the problem, but I still contest that there is value to knowing what depedencies are expected than not. Especially since when a bug is found and debugging needs to happen, there is a number of reasons the package collaborators won't have the same versions of dependencies at the time the bug was caught compared to the time when they released the last version of the package that is potentially introducing the bug. With a lockfile you can at least look at the dependencies at the time that version was released (as opposed to whatever it is you have installed locally). The amount of unknowns grows rapidly with the amount of unique collaborators and their environments. Plus if you also switched development environments regularly (work vs home computer), it is possible (though probably rare) that one environment falls out of sync with another environment when you are not using lockfiles which could potentially introduce a hard to track down bug during package development. More known data makes inevitable failure easier to track down and squash. That's my philosophy. |
As recommended here: sindresorhus/ama#479 (comment)
|
@sindresorhus I found your argument very compelling, and was opening a pull request to one of the libraries I maintain to |
Lockfiles for apps, but not for packages. sindresorhus/ama#479 (comment)
Lockfiles for apps, but not for packages. sindresorhus/ama#479 (comment)
Seemingly not suitable for packages. sindresorhus/ama#479 (comment)
|
I'm wondering what you think about node.js CLI modules. Those can be considered "apps" because they are installed globally and are run from the command line (and not included in another node project which has its own lockfile.) I see that your CLI modules don't provide any |
|
@mifi I don't think they're exactly like apps. You don't install apps with |
According to the comment(sindresorhus/ama#479 (comment)), only application projects should have lockfiles.
According to the comment(sindresorhus/ama#479 (comment)), only application projects should have lockfiles.
According to the comment(sindresorhus/ama#479 (comment)), only application projects should have lockfiles.
Lockfiles are good for apps, not packages. See sindresorhus/ama#479 (comment).
Hello Sindre!
In the latest npm (version 5), it creates package-lock.json by default. Yes same like yarn for now.
What do you think of it? Should we commit the lockfile to git or is it better to get it ignored?
And also what do you think about the latest npm itself? Does it miss something?
Thanks, great day!
The text was updated successfully, but these errors were encountered: