-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
fix(dev): add react & react-dom to peerDependencies
#14265
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
|
react and react-dom to @react-router/dev peer depsreact & react-dom to peerDependencies
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.
It feels a bit odd to have to add these to @react-router/dev 🤔
But I do get that an React Server Components plugin needs them
@hi-ogawa so I guess we can't just remove them upstream?
Yeah that was my initial thought as well, but it kinda does make sense since But I can also see |
|
I think
Probably they didn't cause issues only because react-router/packages/react-router-dev/vite/plugin.ts Lines 1315 to 1319 in 2df250e
|
|
@hi-ogawa Files like react-router/packages/react-router-dev/config/defaults/entry.client.tsx are default files and act as a convenience like they are in the user's codebase, so they're technically not used/needed by |
|
I've opened a PR that makes I agree with @hi-ogawa's point that |
|
Don't think this is necessary anymore 👍 |
Yarn@4is reporting that@react-router/devisn't properly fulfilling thepeerDependenciesdeclared by@vitejs/plugin-rsc:Looking at the
package.jsonfor@vitejs/plugin-rsc, that seems accurate:https://github.com/vitejs/vite-plugin-react/blob/508bed6625d899fd5123b5495fe81166f2e9fa2f/packages/plugin-rsc/package.json#L66-L67
Since
@react-router/devdoesn't needreactorreact-domitself direct asdependenciesordevDependencies, I believe the correct setup is to add them topeerDependenciesso that dependency chain can be delegated up to the consuming React Router application.