-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
React: Allow Storybook packages to use React 17.x #12908
Conversation
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.
LGTM
cfbcf94
to
0fe4063
Compare
0fe4063
to
28b6001
Compare
28b6001
to
32c2ea9
Compare
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.
Great stuff @mrmckeb! Fingers crossed 🤞
deduping is an optimization, and we can't rely on it. After this change, it's quite possible that React 17 will be installed for those packages even if user app is on 16. |
I believe #11628 was a mistake BTW #11492 should no longer be an issue with NPM 7: https://github.com/npm/rfcs/blob/latest/implemented/0025-install-peer-deps.md |
@Hypnosphi why do you think was #11628 a mistake? |
Agreed @Hypnosphi, this is not something we can rely on. We need to fix this properly by moving to peer-dependencies again. We discussed this in-depth on a few calls, but we needed to get out a quick fix and then look at how to fix this long-term. Also, this should no longer be an issue when everyone is on React 17+: |
@shilman @mrmckeb please take a look at the example repository. It's not like you can use components from different versions in a single React tree. You just can nest one React tree inside another. Actually, it was possible before as well, but you could encounter issues with event propagation |
I think you had to do the same for react-dom, now I get a bunch of these:
|
Argh. Good call @vespakoen 🤦 |
ok, @shilman so this allows for react 17, but does not yet change the monorepo to it. (no lockfile changes) |
Issue: #12408
What I did
This PR "unlocks" Storybook packages from the 16.x branch, meaning that during installation, npm/Yarn can dedupe and have only one React version installed.
How to test
After installation, listing dependencies should now only show one version of React installed.