Skip to content
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

chore(packages): lock dependencies versions #958

Merged
merged 10 commits into from Jun 15, 2019
Merged

Conversation

dhruvdutt
Copy link
Member

@dhruvdutt dhruvdutt commented Jun 11, 2019

What kind of change does this PR introduce?
Pin dependencies

Did you add tests for your changes?
N/A

If relevant, did you update the documentation?
N/A

Summary
Locking dependencies as per discussed on #697

Does this PR introduce a breaking change?
No

Other information
Closes #697

@dhruvdutt dhruvdutt changed the title chore(package): lock dependencies chore(package): lock dependencies versions Jun 11, 2019
@webpack-bot
Copy link

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@dhruvdutt dhruvdutt changed the title chore(package): lock dependencies versions chore(packages): lock dependencies versions Jun 11, 2019
Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the npm run docs and npm run format commands working correctly?

@dhruvdutt
Copy link
Member Author

Yes, both are working fine.

Screenshot 2019-06-12 at 6 31 51 PM

@dhruvdutt
Copy link
Member Author

@evenstensberg Let me know if anything else is needed. Let's get this merged. 🚀

@ematipico ematipico merged commit f0f12c9 into webpack:master Jun 15, 2019
@milesj
Copy link

milesj commented Jun 27, 2019

Why was this change allowed? Now all downstream consumers are going to have duplicates of all their modules since these are fixed versions.

@ematipico
Copy link
Contributor

ematipico commented Jun 28, 2019

Mainly because of this event: https://snyk.io/blog/malicious-code-found-in-npm-package-event-stream/

We believe all libs should lock their versions of the dependencies to low down the likelihood of these events.

@evenstensberg
Copy link
Member

Bazel and Angular is doing the same thing, this is ok

@dhruvdutt
Copy link
Member Author

webpack, webpack-cli are anyways going to be devDependencies for most applications so it shouldn't matter anyway.

@milesj
Copy link

milesj commented Jun 28, 2019

@ematipico That's nice and all but that can easily be avoided without having to lock all dependencies.

You're now in the scenario where this package will never receive any bug fixes for transitive deps without the package deps being manually updated. So unless you're going to do a dependency audit on a weekly basis, this does more harm than good.

@ematipico
Copy link
Contributor

ematipico commented Jun 28, 2019

@ematipico That's nice and all but that can easily be avoided without having to lock all dependencies.

How?

This is the power and the weakness of npm. If we need a fix, we can simply set a bot and that would help. On the other hand an hacked package takes a lot (even a month) to get detected. I believe it's better to be safe and secure. But if you have other solutions, let's evaluate them!

@milesj
Copy link

milesj commented Jun 28, 2019

@evenstensberg Unless it's part of a build process, most of their packages in the GitHub source use ^ versions. Same goes for React, Vue, Babel, and more.

@ematipico I could say the same thing about pinned versions... How do you know the version you pinned to is safe and secure? What if it's revealed a month later to also be problematic? This argument goes both ways but is also a personal opinion. So I suppose this discussion is over.

Ironically I will now have to pin this to a previous version.

@ematipico
Copy link
Contributor

React and Vue don't have direct dependencies.

Anyway feel free to terminate the discussion, although I asked you what's your alternative solution!

The event-stream issue was caused because a person took advantage of unpinned dependencies (of dependencies, etc.) and people lost money! What's the less evil?

@milesj
Copy link

milesj commented Jun 28, 2019

@ematipico

  • Not use NPM packages for such minor functionality.
  • Rely only on NPM packages from more credible owners (like orgs, foundations, etc).
  • Pin untrusted packages, not all of them.

I'm hoping with the new GitHub registry, a lot of these problems will go away as the artifacts now sit alongside the source code and are verified and signed before publishing. Bad actors will always be thing but being entirely proactive isn't a perfect solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lock versions of the dependencies
6 participants