Skip to content

Expand peerDependencies range for react #336

@mosofsky

Description

@mosofsky

Is your feature request related to a problem? Please describe.

Currently react-digraph 7.x and 8.x contain an old version of react as peer dependencies in their package.json, for example:

  "peerDependencies": {
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "d3": "^5.16.0"
  },

source: https://github.com/uber/react-digraph/blob/v8.0.0-beta.8/package.json

Describe the solution you'd like

Test with react 17 and if everything works, expand the range like this:

  "peerDependencies": {
    "react": "^16.12.0 || ^17.0.0",
    "react-dom": "^16.12.0  || ^17.0.0",
    "d3": "^5.16.0"
  },

This OR syntax is discussed at https://stackoverflow.com/questions/47309598/make-your-npm-package-support-multiple-versions-of-peer-depedency and there's a nice tool at https://semver.npmjs.com/ for verifying that it works.

Describe alternatives you've considered

The alternative is for me just to ignore the yarn install warnings I get and pray they're not a problem:

warning " > [email protected]" has incorrect peer dependency "react@^16.12.0".
warning " > [email protected]" has incorrect peer dependency "react-dom@^16.12.0".
warning " > [email protected]" has unmet peer dependency "d3@^5.16.0".

Additional context

React 17 was released on October 20, 2020 and the release notes are here https://reactjs.org/blog/2020/10/20/react-v17.html and more breaking changes are described at https://reactjs.org/blog/2020/08/10/react-v17-rc.html#other-breaking-changes . If none of these matter, then it would be great to expand the peerDependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions