Skip to content

Commit 16ec1e7

Browse files
feat: React 19 support (#390)
Co-authored-by: Felix Habib <fhabib@seek.com.au>
1 parent 67006f0 commit 16ec1e7

File tree

16 files changed

+3813
-3858
lines changed

16 files changed

+3813
-3858
lines changed

.changeset/new-hairs-appear.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'playroom': minor
3+
---
4+
5+
Update `react` and `react-dom` peer dependency ranges to include `^19`

.changeset/odd-bats-lie.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'playroom': patch
3+
---
4+
5+
Remove `react-use` dependency

cypress/e2e/editor.cy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('Editor', () => {
2121
});
2222

2323
it('autocompletes', () => {
24-
typeCode('<F{enter} c{enter}={downarrow}{enter} />', 100);
24+
typeCode('<F{enter} c{enter}={downarrow}{enter} />', 150);
2525
assertFirstFrameContains('Foo');
2626
assertCodePaneContains('<Foo color="blue" />');
2727
});

lib/makeWebpackConfig.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ module.exports = async (playroomConfig, options) => {
3030
}
3131
);
3232
const { version } = JSON.parse(pkgContents);
33-
isLegacyReact = !(version.startsWith('18') || version.startsWith('0.0.0'));
33+
isLegacyReact = !(
34+
version.startsWith('18') ||
35+
version.startsWith('19') ||
36+
version.startsWith('0.0.0')
37+
);
3438
} catch (e) {
3539
throw new Error('Unable to read `react-dom` package json');
3640
}

package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
"@types/base64-url": "^2.2.0",
7474
"@types/codemirror": "^5.60.5",
7575
"@types/prettier": "^2.7.1",
76-
"@types/react": "^18.0.26",
77-
"@types/react-dom": "^18.0.9",
76+
"@types/react": "^19.0.10",
77+
"@types/react-dom": "^19.0.4",
7878
"@vanilla-extract/css": "^1.9.2",
7979
"@vanilla-extract/css-utils": "^0.1.3",
8080
"@vanilla-extract/dynamic": "^2.1.2",
@@ -102,11 +102,10 @@
102102
"portfinder": "^1.0.32",
103103
"prettier": "^2.8.1",
104104
"prop-types": "^15.8.1",
105-
"re-resizable": "^6.10.0",
105+
"re-resizable": "^6.11.2",
106106
"react-docgen-typescript": "^2.2.2",
107107
"react-helmet": "^6.1.0",
108108
"react-transition-group": "^4.4.5",
109-
"react-use": "^17.4.0",
110109
"read-pkg-up": "^7.0.1",
111110
"scope-eval": "^1.0.0",
112111
"sucrase": "^3.34.0",
@@ -120,7 +119,7 @@
120119
"@actions/core": "^1.10.0",
121120
"@changesets/cli": "^2.25.2",
122121
"@octokit/rest": "^19.0.5",
123-
"@testing-library/cypress": "^10.0.1",
122+
"@testing-library/cypress": "^10.0.3",
124123
"@types/jest": "^29.2.4",
125124
"@types/node": "^18.11.9",
126125
"@types/react-helmet": "^6.1.6",
@@ -132,15 +131,15 @@
132131
"husky": "^8.0.2",
133132
"jest": "^29.3.1",
134133
"lint-staged": "^15.2.2",
135-
"react": "^18.0.1",
136-
"react-dom": "^18.0.1",
134+
"react": "^19.0.0",
135+
"react-dom": "^19.0.0",
137136
"serve": "^14.1.2",
138137
"start-server-and-test": "^1.15.2",
139138
"surge": "^0.23.1"
140139
},
141140
"peerDependencies": {
142-
"react": "^17 || ^18",
143-
"react-dom": "^17 || ^18"
141+
"react": "^17 || ^18 || ^19",
142+
"react-dom": "^17 || ^18 || ^19"
144143
},
145144
"engines": {
146145
"node": ">=18.12.0"

0 commit comments

Comments
 (0)