Skip to content

Commit 9ab2113

Browse files
committed
feat: support React 19
1 parent 69a1ec0 commit 9ab2113

7 files changed

Lines changed: 202 additions & 186 deletions

File tree

.github/workflows/test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false # Continue other combos even if one fails
1212
matrix:
1313
node: [20, 22, 24]
14-
react: ["18.2.0"] # TODO: Add "19.2.1" when ready
14+
react: ["18.2.0", "19.2.3"]
1515

1616
steps:
1717
- name: "Checkout"

packages/pages-components/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"peerDependencies": {
5050
"lexical": "~0.38.2",
5151
"mapbox-gl": "^2.9.2",
52-
"react": "^18.2.0",
53-
"react-dom": "^18.2.0"
52+
"react": "^18.2.0 || ^19.2.3",
53+
"react-dom": "^18.2.0 || ^19.2.3"
5454
},
5555
"devDependencies": {
5656
"@playwright/test": "^1.55.1",
@@ -101,4 +101,4 @@
101101
"classnames": "^2.5.1",
102102
"luxon": "^3.7.2"
103103
}
104-
}
104+
}

packages/pages-components/vite.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ export default defineConfig(() => ({
1414
formats: ["es"] as LibraryFormats[], // typescript is unhappy without this forced type definition
1515
},
1616
rollupOptions: {
17-
external: ["react", "react-dom", "mapbox-gl"],
17+
external: [
18+
"react",
19+
"react-dom",
20+
"mapbox-gl",
21+
"react/jsx-runtime",
22+
"react/jsx-dev-runtime",
23+
],
1824
output: {
1925
globals: {
2026
react: "React",

pnpm-lock.yaml

Lines changed: 183 additions & 174 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test-sites/pages-components-starter/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ dist/
33
node_modules/
44
playwright-report/
55
sites-rendered-output/
6-
deno.lock
6+
deno.lock
7+
test-results/

test-sites/pages-components-starter/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
},
1818
"dependencies": {
1919
"@yext/pages-components": "workspace:*",
20-
"react": "^17.0.2",
21-
"react-dom": "^17.0.2"
20+
"react": "^18.2.0",
21+
"react-dom": "^18.2.0"
2222
},
2323
"devDependencies": {
2424
"@playwright/test": "^1.57.0",
2525
"@types/node": "^20.9.1",
26-
"@types/react": "^17.0.2",
27-
"@types/react-dom": "^17.0.2",
26+
"@types/react": "^18.2.0",
27+
"@types/react-dom": "^18.2.0",
2828
"@vitejs/plugin-react": "^4.3.3",
2929
"@yext/pages": "^1.2.7",
3030
"typescript": "^5.3.3",
3131
"vite": "^5.4.19"
3232
}
33-
}
33+
}

test-sites/pages-components-starter/scripts/test-matrix-local.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if ! command -v nvm >/dev/null 2>&1; then
1010
fi
1111

1212
NODE_VERSIONS=("20" "22" "24")
13-
REACT_VERSIONS=("18.2.0") # TODO: Add "19.2.1"
13+
REACT_VERSIONS=("18.2.0" "19.2.3")
1414

1515
INITIAL_NODE_VERSION=$(node -v)
1616
echo "🔍 Detected initial Node version: $INITIAL_NODE_VERSION"

0 commit comments

Comments
 (0)