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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/preview/ThemedCanvas.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { ClassNames } from "@emotion/core";
import { ClassNames } from "@emotion/react";
import { colors } from "../../src/colors";
import { assertUnreachable } from "../../src/shared/assertUnreachable";
import { Canvas } from "@storybook/addon-docs/dist/blocks/Canvas";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## Getting started

```shell
npm install @apollo/space-kit @emotion/core @emotion/cache framer-motion
npm install @apollo/space-kit @emotion/react @emotion/cache framer-motion
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

globals: {
"ts-jest": {
diagnostics: false,
Expand Down
221 changes: 167 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@
"@babel/preset-env": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@babel/traverse": "^7.12.1",
"@emotion/cache": "^10.0.29",
"@emotion/core": "^10.1.1",
"@emotion/cache": "^11.1.3",
"@emotion/jest": "^11.2.0",
"@emotion/react": "^11.1.5",
"@rollup/plugin-babel": "^5.2.1",
"@storybook/addon-docs": "^6.1.17",
"@storybook/react": "^6.1.17",
Expand Down Expand Up @@ -140,7 +141,6 @@
"formik": "^2.2.5",
"framer-motion": "1.6.8",
"jest": "^26.5.3",
"jest-emotion": "^10.0.32",
"jest-util": "^26.5.2",
"less": "^3.9.0",
"node-fetch": "^2.6.0",
Expand All @@ -165,8 +165,8 @@
"yup": "^0.31.0"
},
"peerDependencies": {
"@emotion/cache": ">10.0.29",
"@emotion/core": ">10.1.0",
"@emotion/cache": "^11.0.0",
"@emotion/react": "^11.0.0",
"react": ">16",
"react-dom": ">16",
"framer-motion": ">1.6"
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function CJS() {
),
external: [
"@emotion/cache",
"@emotion/core",
"@emotion/react",
"@popperjs/core",
"@popperjs/core/lib/utils/computeAutoPlacement",
"@popperjs/core/lib/utils/detectOverflow",
Expand Down Expand Up @@ -100,7 +100,7 @@ function CJS() {
"@babel/preset-react",
{
runtime: "classic",
importSource: "@emotion/core",
importSource: "@emotion/react",
},
],
],
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractTooltip/abstractTooltip/TippyStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "../../../node_modules/tippy.js/dist/tippy.css";
import React from "react";
import { base } from "../../typography";
import { colors } from "../../colors";
import { Global, css } from "@emotion/core";
import { Global, css } from "@emotion/react";

export const TippyStyles: React.FC = () => (
<Global
Expand Down
2 changes: 1 addition & 1 deletion src/AlertBanner/AlertBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @jsx jsx */
import { jsx } from "@emotion/core";
import { jsx } from "@emotion/react";
import React, { CSSProperties, useMemo } from "react";
import PropTypes from "prop-types";

Expand Down
2 changes: 1 addition & 1 deletion src/AlertCard/AlertCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @jsx jsx */
/** @jsxFrag React.Fragment */
import { jsx, ClassNames } from "@emotion/core";
import { jsx, ClassNames } from "@emotion/react";
import React, { CSSProperties, Fragment, useMemo } from "react";
import PropTypes from "prop-types";
import classnames from "classnames";
Expand Down
4 changes: 2 additions & 2 deletions src/Button/Button.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { act, render, screen } from "@testing-library/react";
import { IconShip2 } from "../icons/IconShip2";
import React from "react";
import userEvent from "@testing-library/user-event";
import { matchers } from "jest-emotion";
import { matchers } from "@emotion/jest";
import { colors } from "../colors";

// Add the custom matchers provided by 'jest-emotion'
// Add the custom matchers provided by '@emotion/jest'
expect.extend(matchers);

test("default button renders", () => {
Expand Down
Loading