Skip to content
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

refactor(react-ui-kit): Emotion v11 migration #3349

Closed
wants to merge 8 commits into from
Closed

refactor(react-ui-kit): Emotion v11 migration #3349

wants to merge 8 commits into from

Conversation

Yserz
Copy link
Contributor

@Yserz Yserz commented Nov 27, 2020

Emotion provides a good amount of compatibility from v10 to v11 but there are some areas that need to be migrated.
https://emotion.sh/docs/emotion-11

The main change from our perspective is the renaming of the @emotion/core package to @emotion/react.

import {COLOR} from '../Identity/colors';
import {filterProps} from '../util';

// Apply custom theme to Emotion so TypeScript can pick it up in the css prop
declare module '@emotion/react' {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theme needs to be augmented in order to have correct typing for the css prop theme parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -36,6 +36,9 @@ module.exports = {
resolve: {
alias: {
'@wireapp/react-ui-kit': path.resolve(__dirname, 'src'),
// Needed until libs have support for emotion v11
// https://github.com/infinum/emotion-normalize/pull/12
'@emotion/core': '@emotion/react',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to redirect calls from @emotion/core to @emotion/react until emotion-normalize supports it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atomrc
Copy link
Contributor

atomrc commented Oct 4, 2022

Superseeded by #4254

@atomrc atomrc closed this Oct 4, 2022
@atomrc atomrc deleted the emotion-11 branch October 18, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants