-
Notifications
You must be signed in to change notification settings - Fork 673
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
Move Emotion and MDX packages to peerDeps #1867
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/systemui/theme-ui/8fMZ6Yf9pT7wW2dLr8bLwsCFKDFZ |
Any prediction when this is getting merged? We keep tripping over it every few months when someone tries to upgrade packages. |
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.
Just some imports I am not fully sure about
@Swizec, I'll reluctantly say soon™. It's been a while since somebody messaged about this problem so I hoped other libs updated to Emotion 11 and it's not occuring so often 😓 |
@hasparus we recently ran into it because everything updated to latest. But it was like emotion 11.6.0 in one place and 11.5.0 in another 💩 Made up example version numbers but something like that. We had to carefully ensure everything used the exact same version and it was a pain to figure out what the problem was. |
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.
(was asked by @hasparus to take a look at this PR)
LGTM
🚀 PR was released in |
Having Emotion and MDX packages in dependencies leads to a bunch of problems that repeatedly popped up over last few years.
In general, if something depends on a React context, we can't really hide it as dependency from the user, as a version conflict can lead to a context mismatch (we pass the theme to context, but it's read from another one).
We install Emotion for the user, but the abstraction leaks — without knowing that we use Emotion these context mismatch errors can be absurdly hard to debug.
Changes in this PR:
@emotion/react
and@emotion/styled
to peer deps.npm install
guildelines to include peerDeps.Connected issues:
Release notes
BREAKING CHANGE:
@emotion/react
and@mdx-js/react
were moved to peerDependencies oftheme-ui
,@theme-ui/mdx
and@theme-ui/sidenav
and must be installed separately. This is a revert of change from Theme UI v0.3, and it's meant to help solve version clashes and context mismatch bugs on user side. Connected issues: #1793, #1531, #1530, #1388, #1345, #1130.📦 Published PR as canary version:
0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0
✨ Test out this PR locally via:
npm install @theme-ui/color-modes@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/color@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/components@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/core@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/css@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/custom-properties@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/editor@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install gatsby-plugin-theme-ui@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install gatsby-theme-style-guide@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install gatsby-theme-ui-layout@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/match-media@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/mdx@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/parse-props@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-base@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-bootstrap@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-bulma@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-dark@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-deep@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-funk@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-future@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-polaris@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-roboto@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-sketchy@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-swiss@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-system@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-tailwind@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/preset-tosh@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/presets@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/prism@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/sidenav@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/style-guide@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/tailwind@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/theme-provider@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install theme-ui@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 npm install @theme-ui/typography@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 # or yarn add @theme-ui/color-modes@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/color@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/components@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/core@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/css@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/custom-properties@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/editor@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add gatsby-plugin-theme-ui@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add gatsby-theme-style-guide@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add gatsby-theme-ui-layout@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/match-media@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/mdx@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/parse-props@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-base@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-bootstrap@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-bulma@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-dark@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-deep@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-funk@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-future@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-polaris@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-roboto@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-sketchy@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-swiss@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-system@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-tailwind@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/preset-tosh@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/presets@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/prism@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/sidenav@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/style-guide@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/tailwind@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/theme-provider@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add theme-ui@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0 yarn add @theme-ui/typography@0.13.0--canary.1867.408bee0d2d84fbaf22e6f2ca925d50f4c82ad1db.0