-
Notifications
You must be signed in to change notification settings - Fork 786
Add an optional peer dependency to react-apollo #3278
Conversation
`@types/react` should be an optional peer dependency of react-apollo. Related issue pnpm/pnpm#1928
@zkochan: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
Thanks for the PR @zkochan. Can you explain why |
This package exports a React component which is extending the React component class. When this package is required by a typescript project, compilation fails because the typing of the react component is not found. Having it as a dev dependency does not fix the issue because dev dependencies are only installed during local development. |
Got it, I see that now - Hmmm ... I'll have to think about this a bit more. If we make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @zkochan!
@hwillson With this PR included in 3.0.1, this leads to an unfortunate side effect for non TS users. When upgrading to 3.0.1, I'm either forced to install and add While neither is particularly serious, this isn't something that non TS users should need to deal with. You mentioned looking into adjusting code to break the dependency completely. Would this still be possible? |
It appears that this is an issue with the npm registry not returning the peerDependenciesMeta with the package metadata. See npm/cli#224 (comment) When the registry will be updated, you will stop seeing the warnings. Though with Yarn and pnpm there are no warnings already, I believe |
@types/react
should be an optional peer dependency of react-apollo.Related issue pnpm/pnpm#1928
Checklist: