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

Update peerDependencies in package.json #201

Closed
wants to merge 1 commit into from

Conversation

MichaelDeBoey
Copy link
Contributor

@jaydenseric
Copy link
Owner

Thanks for the suggestion, but there are a few reasons not to do it this way.

@jaydenseric
Copy link
Owner

Sorry, pressed "Comment" early, reasons coming…

@jaydenseric
Copy link
Owner

Semver for peerDependencies should be quite similar conceptually for that of dependencies and devDependencies. If you did ">=0.12.3" in dependencies, when a future major version with breaking changes is out, you wouldn't want to automatically pull in those breaking changes. For peer dependencies, we don't want to automatically declare support for major versions with breaking changes.

Note that some package managers (including future npm) install peerDependencies automatically, and there are npx scripts and other utilities that install peer dependencies automatically. We need to be careful to only declare support for major versions know to be compatible.

Regarding the verbose syntax of the current value. Normally I use semver range syntax (-), instead of the verbose || chain:

https://github.com/jaydenseric/graphql-upload/blob/a3b7b31406aa47567ced0b60eea1cd764db8932c/package.json#L45

Although, in this case we matched exactly the peer dependency Apollo Client declares. This package doesn't actually use graphql; here is an explanation why the peer dep was recently added to this package: #196 .

@MichaelDeBoey MichaelDeBoey deleted the patch-1 branch July 14, 2020 12:13
@MichaelDeBoey
Copy link
Contributor Author

@jaydenseric apollo-client just merged my PR (apollographql/apollo-client#6594) to do it in their repo too.

@jaydenseric
Copy link
Owner

Thanks for sharing, but I'm quite sure they've made a mistake.

@jaydenseric jaydenseric changed the title Update package.json Update peer dependencies Jul 14, 2020
@MichaelDeBoey MichaelDeBoey changed the title Update peer dependencies Update peerDependencies in package.json Jul 14, 2020
jaydenseric added a commit to hoangvvo/apollo-upload-client that referenced this pull request Jul 14, 2020
@benjamn
Copy link

benjamn commented Jul 15, 2020

Yep, this was a mistake for Apollo Client. Thanks for the explanation @jaydenseric!

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

Successfully merging this pull request may close these issues.

None yet

3 participants