Skip to content

Commit

Permalink
Make react an optional peer dependency
Browse files Browse the repository at this point in the history
NPM just launched optional peer dependency support via
`peerDependenciesMeta` (npm/cli#224), so
we can now leverage this to make `react` a trully optional dep,
instead of using NPM's poorly named `optionalDependencies`
(since `optionalDependencies` are really just normal
dependencies). This means people using `@apollo/client` who
aren't interested in using React won't be annoyed by missing
`react` peer dependency warnings from npm.
  • Loading branch information
hwillson committed Oct 24, 2019
1 parent 4e2e3c2 commit 2df5582
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
35 changes: 20 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@
}
],
"peerDependencies": {
"graphql": "^14.5.4"
},
"optionalDependencies": {
"graphql": "^14.5.4",
"react": "^16.8.0"
},
"peerDependenciesMeta": {
"react": {
"optional": true
}
},
"dependencies": {
"@types/zen-observable": "^0.8.0",
"@wry/equality": "^0.1.9",
Expand Down Expand Up @@ -84,7 +87,8 @@
"jest-junit": "8.0.0",
"lodash": "4.17.15",
"prop-types": "15.7.2",
"react-dom": "^16.10.2",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"rimraf": "^3.0.0",
"rollup": "1.21.2",
"rollup-plugin-commonjs": "^10.1.0",
Expand Down

0 comments on commit 2df5582

Please sign in to comment.