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

Use React 19 #3291

Merged
merged 54 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
12de7a9
Use React 19
Andarist Dec 10, 2024
c4c06d4
Specify TS 5.0 as min TS version in most dtslint tests
Andarist Dec 10, 2024
ed8213d
try patching dtslint
Andarist Dec 10, 2024
dd2e711
update lockfile
Andarist Dec 10, 2024
ed1823f
fixed TS error
Andarist Dec 10, 2024
4e49e28
dedupe `@types/react`
Andarist Dec 10, 2024
a46a081
update react testing library
Andarist Dec 10, 2024
a6cc13f
add `@testing-library/dom`
Andarist Dec 11, 2024
5f3a38e
migrate tests
Andarist Dec 12, 2024
ed9538e
migrate more
Andarist Dec 12, 2024
ea9a228
moar
Andarist Dec 12, 2024
d3957b6
moar
Andarist Dec 12, 2024
11002c5
fix
Andarist Dec 12, 2024
2853c3a
more
Andarist Dec 12, 2024
a9142b3
more
Andarist Dec 12, 2024
2fbf0e3
more
Andarist Dec 12, 2024
b42fcfe
more
Andarist Dec 12, 2024
570f8d7
more
Andarist Dec 12, 2024
45f4a22
more
Andarist Dec 12, 2024
245185a
more
Andarist Dec 12, 2024
883ba0c
more
Andarist Dec 12, 2024
c3d4d20
fix
Andarist Dec 12, 2024
4ebcc12
migrate more tests
Andarist Dec 12, 2024
f7d5d69
moar
Andarist Dec 12, 2024
d0ea8cd
moar
Andarist Dec 12, 2024
a055fc8
moar
Andarist Dec 12, 2024
e52d3e6
moar
Andarist Dec 12, 2024
138227a
moar
Andarist Dec 12, 2024
229812d
more
Andarist Dec 12, 2024
1ad40d2
more
Andarist Dec 12, 2024
aa49a2e
more
Andarist Dec 12, 2024
2d6717f
tweak
Andarist Dec 12, 2024
8deec1f
more converted tests
Andarist Dec 12, 2024
8082f02
fix thing
Andarist Dec 12, 2024
fb2f0c4
fix
Andarist Dec 12, 2024
35b151c
tweak
Andarist Dec 12, 2024
6511abc
fixed test
Andarist Dec 12, 2024
9e3912b
tweaks
Andarist Dec 12, 2024
bd315a1
unskip 2 tests
Andarist Dec 12, 2024
de74f25
unskip again
Andarist Dec 12, 2024
5f411c7
stuff
Andarist Dec 13, 2024
a9cf700
fix streams
Andarist Dec 13, 2024
65735bc
skip some tests
Andarist Dec 13, 2024
88873ec
tweak
Andarist Dec 13, 2024
04f6467
fix things
Andarist Dec 13, 2024
1c8ad31
fix snap
Andarist Dec 13, 2024
76e4586
fixed snapshot indent
Andarist Dec 14, 2024
b4a7248
fixed extra snapshot issue
Andarist Dec 14, 2024
9b62fd2
strip-ansi
Andarist Dec 14, 2024
ab928db
Require TS 5.1
Andarist Dec 14, 2024
9717107
`useInsertionEffect` directly in `Global`
Andarist Dec 14, 2024
3b7df11
keep old peer dep range in `use-insertion-effect-with-fallbacks`
Andarist Dec 15, 2024
ede88b8
add changeset
Andarist Dec 15, 2024
2d7a7ee
fixed lockfile
Andarist Dec 15, 2024
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
6 changes: 6 additions & 0 deletions .changeset/amaranth-owls-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/styled': major
'@emotion/react': major
---

Dropped support for older React versions. React 19 becomes the only compatible version with this package.
10 changes: 0 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ jobs:
- name: Check Types
run: yarn tsc:all

test_react18:
name: Test React 18
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/ci-setup

- name: Run Tests with React 18
run: yarn test:react18:ci

test_prod:
name: Test Prod
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/dist/index.js b/dist/index.js
index 0a9abde5fbe918397794db0c0962129cf6bec3fa..26fe2b048b7fa898282d2d9d0dbd1719384b1f60 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -8,9 +8,9 @@ const assert_1 = __importDefault(require("assert"));
var TypeScriptVersion;
(function (TypeScriptVersion) {
/** Add to this list when a version actually ships. */
- TypeScriptVersion.shipped = ["3.9", "4.0", "4.1", "4.2", "4.3", "4.4", "4.5", "4.6"];
+ TypeScriptVersion.shipped = ["3.9", "4.0", "4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7"];
/** Add to this list when a version is available as typescript@next */
- TypeScriptVersion.supported = [...TypeScriptVersion.shipped, "4.7"];
+ TypeScriptVersion.supported = [...TypeScriptVersion.shipped, "5.8"];
/** Add to this list when it will no longer be supported on Definitely Typed */
TypeScriptVersion.unsupported = [
"2.0",
8 changes: 4 additions & 4 deletions docs/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ expect.addSnapshotSerializer(createSerializer())

### Writing a test

Writing a test with `@emotion/jest` involves creating a snapshot from the `react-test-renderer`'s resulting JSON.
Writing a test with `@emotion/jest` involves creating a snapshot from the `@testing-library/react`'s result.

```jsx
import React from 'react'
import renderer from 'react-test-renderer'
import { render } from '@testing-library/react'

const Button = props => (
<button
Expand All @@ -51,7 +51,7 @@ const Button = props => (

test('Button renders correctly', () => {
expect(
renderer.create(<Button>This is hotpink.</Button>).toJSON()
render(<Button>This is hotpink.</Button>).container
).toMatchSnapshot()
})
```
Expand All @@ -67,7 +67,7 @@ exports[`Button renders correctly 1`] = `
}

<div
className="emotion-0"
class="emotion-0"
>
This is hotpink.
</div>
Expand Down
9 changes: 0 additions & 9 deletions jest-react18.config.js

This file was deleted.

19 changes: 8 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
"test:size": "npm-run-all build size",
"test:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand --watch",
"test": "jest",
"test:react18": "jest -c jest-react18.config.js",
"test:typescript": "yarn workspaces foreach --verbose --exclude emotion-monorepo run test:typescript",
"test:ci": "jest --coverage --no-cache --ci --runInBand",
"test:react18:ci": "yarn test:react18 --coverage --no-cache --ci --runInBand",
"test:dist": "yarn build && jest -c jest.dist.js --no-cache --ci --runInBand",
"test:prod": "jest -c jest.prod.js --no-cache --ci --runInBand",
"lint:check": "eslint .",
Expand Down Expand Up @@ -185,10 +183,11 @@
"@changesets/cli": "^2.27.7",
"@manypkg/cli": "^0.19.1",
"@preconstruct/cli": "^2.8.8",
"@testing-library/react": "13.0.0-alpha.5",
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.1.0",
"@types/jest": "^29.5.12",
"@types/node": "^12.20.37",
"@types/react": "18.3.12",
"@types/react": "19.0.1",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"babel-check-duplicated-nodes": "^1.0.0",
Expand Down Expand Up @@ -226,14 +225,11 @@
"polished": "^1.2.1",
"prettier": "^3.3.2",
"raf": "^3.4.0",
"react": "16.14.0",
"react-dom": "16.14.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-native": "^0.63.2",
"react-primitives": "^0.8.1",
"react-test-renderer": "16.8.6",
"react18": "npm:[email protected]",
"react18-dom": "npm:[email protected]",
"react18-test-renderer": "npm:[email protected]",
"react-test-renderer": "19.0.0",
"svg-tag-names": "^1.1.1",
"through": "^2.3.8",
"typescript": "^5.4.5",
Expand All @@ -242,6 +238,7 @@
},
"packageManager": "[email protected]",
"resolutions": {
"@definitelytyped/[email protected]": "patch:@definitelytyped/dtslint@npm%3A0.0.112#./.yarn/patches/@definitelytyped-dtslint-npm-0.0.112-1e6b842976.patch"
"@definitelytyped/[email protected]": "patch:@definitelytyped/dtslint@npm%3A0.0.112#./.yarn/patches/@definitelytyped-dtslint-npm-0.0.112-1e6b842976.patch",
"@definitelytyped/typescript-versions@^0.0.112": "patch:@definitelytyped/typescript-versions@npm%3A0.0.112#./.yarn/patches/@definitelytyped-typescript-versions-npm-0.0.112-f668f50e03.patch"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ exports[`component selector should be converted to use the emotion target classN
}

<div
className="emotion-0"
class="emotion-0"
>
<div
className="emotion-1 emotion-2"
class="emotion-1 emotion-2"
/>
</div>
`;
Loading
Loading