-
Notifications
You must be signed in to change notification settings - Fork 622
Update package.json to modify react-is dependency #6371
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
Conversation
Remove react-is from dependencies and add to peerDependencies
🦋 Changeset detectedLatest commit: 93527df The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
@@ -218,9 +216,11 @@ | |||
"peerDependencies": { | |||
"@types/react": "18.x || 19.x", | |||
"@types/react-dom": "18.x || 19.x", | |||
"@types/react-is": "18.x || 19.x", |
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.
optional peer
size-limit report 📦
|
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.
Pull Request Overview
This PR resolves a React 19 compatibility issue by converting react-is
from a direct dependency to a peer dependency, preventing installation conflicts when Primer is used in React 19 projects. The change also updates related TypeScript type definitions and ensures proper version compatibility.
Key changes:
- Moved
react-is
and@types/react-is
from dependencies to peer dependencies with version ranges supporting both React 18.x and 19.x - Updated TypeScript type definitions for React-related packages to newer patch versions
- Added optional peer dependency metadata for
@types/react-is
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/react/package.json | Restructured dependencies to move react-is to peer dependencies and updated type definitions |
.changeset/tall-pets-obey.md | Added changeset entry documenting the peer dependency corrections |
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/392407 |
For context on removing from the queue, just was waiting for the integration PR to pass 👀 The only thing I'm worried about is adding a new Could we instead update the range on the dependency? e.g. |
🟢 golden-jobs completed with status |
NPM started installing peerDependencies by default in version 7 https://github.blog/news-insights/product-news/npm-7-is-now-generally-available/#peer-dependencies
I don't think we should be installing a version of it for consumers and 2 versions installed could cause some conflcits I think? (although they're generally backwards compat). With that said, a broader dependency might be ok - but is probably not ideal? |
Oh nice! Didn't realize that was added (thanks for sharing)
What scenarios would you expect to have two versions installed? Was trying to think through it:
Are there any that I'm missing? 👀 |
I think they generally should resolve to a single version, but I could see npm nesting one inside the pacakge instead when upgrading - I don't think it's a common case where that would happen instead of hosting, but maybe not impossible? |
Sounds good 👍 Definitely down to try this out. Thanks for making the PR! |
no problem! thank you! |
This pull request updates the dependencies in the
packages/react/package.json
file, primarily focusing on upgradingreact
-related packages and ensuring compatibility with new versions. The most significant changes include the addition and upgrade ofreact-is
and its associated type definitions, as well as adjustments to peer dependencies.Primer fails to install in a react 19 project because the dependency on react-is conflicts, by making it a peer we avoid that conflcit
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
Merge checklist