-
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
Upgrade to Emotion v11 #1261
Upgrade to Emotion v11 #1261
Conversation
The last remaining TypeScript issue is that Emotion's The Box component in
|
@dcastil I suppose box would need to specify that it does take https://github.com/emotion-js/emotion/blob/master/packages/styled/types/base.d.ts#L36 |
Thank you so much for your work here @dcastil!! |
reduces bundle of @theme-ui/mdx from 40 kB to 1 kB
@hasparus That's cool! I DMed you on Twitter. |
import { css, Theme } from '@theme-ui/css' | ||
import * as React from 'react' | ||
import deepmerge from 'deepmerge' | ||
import packageInfo from '@emotion/core/package.json' | ||
import packageInfo from '@emotion/react/package.json' | ||
import {} from '@emotion/react/types/css-prop' |
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.
Let's leave this a side note here. I think we should also make sx
prop types opt in (for v0.5.0? v0.6.0?), as we have users who may prefer to use @theme-ui/components
instead of JSX pragma.
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.
This would be a small breaking change, as users will have to update their emotion deps, and fix a bunch of TS errors. Do you think we should bump to v0.5.0 while merging it?
I'm aware we didn't release 0.4.0, but the rc
versions are "stable enough" and a bunch of projects are using them.
I've added a test, replaced |
You should look into creating a Discord Server! Hope you find this useful 🎉 |
Nice idea, @fcisio! |
thanks all for putting this together, this will be a big improvement to theme-ui. Just my 2 cents -- I think either a release as 0.4.0-rcX or 0.5.0 is fine. 0.5.0 is probably safer, but I also think any user on a "rc" release understands it beta-ware and can also pin to a specific "0.4.0-rcX" version for their needs, so it might feel more correct to stick to 0.4.0-rcX line. Either approach is fine IMHO. As well, the migration path from emotion 10 to emotion 11 for an app is quite simple -- to give an example, my app built with emotion 11 of ~300 components upgraded without any changes to the components going from emotion 10 to 11. The only changes I had to make was updating my import statements and the Theme type: https://emotion.sh/docs/emotion-11 |
Don't fix conflicts, I'll merge it in a bit :) |
BREAKING CHANGE: Upgrade to Emotion 11, and `csstype` 3. PR #1261. - We are now depending on `@emotion/react@11` instead of `@emotion/core@10` - `sx` prop types are still global, and we opt in for Emotion `css` prop types (This will change in the future.) - Refer to [Emotion 11 release notes](https://emotion.sh/docs/emotion-11) for more information.
Closes #1258
To dos: