Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

AR-2143 Update to emotion 11 #317

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

AR-2143 Update to emotion 11 #317

wants to merge 5 commits into from

Conversation

hwillson
Copy link
Member

@hwillson hwillson commented Feb 20, 2021

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:

npm install @apollo/[email protected]
# or 
yarn add @apollo/[email protected]

@hwillson hwillson self-assigned this Feb 20, 2021
@hwillson hwillson added dependencies Pull requests that update a dependency file major Increment the major version when merged labels Feb 20, 2021
@@ -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"],
Copy link
Member Author

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";
Copy link
Member Author

@hwillson hwillson Feb 20, 2021

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@justinanastos justinanastos changed the title Update to emotion 11 AR-2143 Update to emotion 11 Mar 8, 2021
Copy link
Contributor

@justinanastos justinanastos left a 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",
Copy link
Contributor

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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file major Increment the major version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants