-
Notifications
You must be signed in to change notification settings - Fork 14
AR-2143 Update to emotion 11 #317
base: main
Are you sure you want to change the base?
Conversation
@@ -15,7 +15,7 @@ module.exports = { | |||
}, | |||
preset: "ts-jest/presets/js-with-babel", | |||
setupFilesAfterEnv: ["<rootDir>jest/setup.js"], | |||
snapshotSerializers: ["jest-emotion"], | |||
snapshotSerializers: ["@emotion/jest/serializer"], |
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.
Note that the jest-emotion
package can no longer be used with emotion 11.
@@ -3,7 +3,7 @@ | |||
import { colors, ShadedColor } from "../colors"; | |||
import type { Property, SimplePseudos } from "csstype"; | |||
import { base } from "../typography"; | |||
import { ClassNames, jsx, ObjectInterpolation } from "@emotion/core"; | |||
import { ClassNames, jsx, CSSObject } from "@emotion/react"; |
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.
ObjectInterpolation
is no longer re-exported from the @emotion/react
package. It is available through @emotion/serialize
(which is a dep of @emotion/react
), but I didn't want to depend on a child dep, or ask people to include @emotion/serialize
as a peer dep. That being said, the only difference between ObjectInterpolation
and CSSObject
is that ObjectInterpolation
uses generics, but in this case we were using a generic of undefined
anyways, so it shouldn't matter.
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.
👍
1ac3d1a
to
de95a8a
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.
Sorry it took me so long to get to this; it looks great @hwillson . There was one regression related to how the css
prop worked that I've resolved.
I'm going to merge this after https://github.com/mdg-private/studio-ui/pull/3847 is merged so we don't block any Space Kit updates for Studio UI.
package.json
Outdated
"version": "8.16.1", | ||
"version": "9.0.0", |
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.
I'm going to remove this @hwillson ; the version will be bumped automatically on release.
The `css` prop doesn't work in the default props, so we have to do it elsewhere.
b818ff5
to
233b92f
Compare
This PR updates to emotion 11, following their recommended migration steps. I've had to bump the major version of
@apollo/space-kit
, since we're recommending people install emotion as a peer dep, which means requiring the new@emotion/react
package is a breaking change. Thanks!Blocked by https://github.com/mdg-private/studio-ui/pull/3847
📦 Published PR as canary version:
8.17.4-canary.317.8728.0
✨ Test out this PR locally via: