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

Bug: Peer dependency change between use-subscription 1.4.1 and 1.5.0 #20224

Closed
billyjanitsch opened this issue Nov 11, 2020 · 4 comments · Fixed by #20225
Closed

Bug: Peer dependency change between use-subscription 1.4.1 and 1.5.0 #20224

billyjanitsch opened this issue Nov 11, 2020 · 4 comments · Fixed by #20225
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@billyjanitsch
Copy link
Contributor

billyjanitsch commented Nov 11, 2020

React version: use-subscription@1.5.0

Steps To Reproduce

  1. Run npm install react@16.14.0 use-subscription@1.4.1.
  2. Run npm install use-subscription@1.5.0. Note the React peer dependency error.

Notably, this currently affects npm install react@16 next@10 (see vercel/next.js#18518). npm@7 will refuse to perform this installation entirely.

The current behavior

use-subscription@1.4.1 peer-depends on react@^16.8.0 whereas use-subscription@1.5.0 peer-depends on react@^17.0.0, which is generally considered a breaking change in a minor version. This might have been an oversight in how #20062 interacted with #19373?

(It's considered a breaking change because a package.json like the below should always result in a valid install.)

{
  "dependencies": {
    "react": "^16.14.0",
    "use-subscription": "^1.4.1"
  }
}

The expected behavior

Here are two potential solutions:

  • Cut a release of use-subscription@1.5.1 that peer-depends on ^16.8.0 || ^17.0.0, strictly widening the peer dep range from that of 1.4.1.
  • Cut a major release of use-subscription@2 that peer-depends on ^17.0.0, and cut a release of use-subscription@1.5.1 that reverts its peer dependency to ^16.8.0.
@billyjanitsch billyjanitsch added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Nov 11, 2020
@gaearon
Copy link
Collaborator

gaearon commented Nov 11, 2020

Happy to take a PR that fixes this by making the range more permissible. I think we need a bump after that to increase the major and simply keep use-subscription@2 17-only.

If you send a PR like this, please check if any of the other React packages had a similar problem with 17.

@billyjanitsch
Copy link
Contributor Author

billyjanitsch commented Nov 11, 2020

If you send a PR like this, please check if any of the other React packages had a similar problem with 17.

Sure, I'll send a PR.

I noticed a few similar cases in #19373 but they all seemed to be for "internal"/"experimental" packages:

  • react-cache
  • react-client
  • react-debug-tools
  • react-fetch
  • react-interactions
  • react-native-renderer
  • react-noop-renderer
  • react-server
  • react-transport-dom-relay
  • react-transport-dom-webpack

Do you care about fixing any of these since they (AFAIK) don't really have public consumers?

@billyjanitsch billyjanitsch changed the title Bug: Breaking peer dependency change between use-subscription 1.4.1 and 1.5.0 Bug: Peer dependency change between use-subscription 1.4.1 and 1.5.0 Nov 11, 2020
@billyjanitsch
Copy link
Contributor Author

(Retitling per your comment vercel/next.js#18518 (comment) and my reply vercel/next.js#18518 (comment). Sorry about that.)

@gaearon
Copy link
Collaborator

gaearon commented Nov 12, 2020

use-subscription@1.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants