Skip to content

Commit 35f961f

Browse files
authored
feat!: next.js 15, react 19, react compiler support (#6429)
**BREAKING:** - bumps minimum required next.js version from `14.3.0-canary.68` to `15.0.0-rc.0` - bumps minimum required react and react-dom versions to `19.0.0 `(`19.0.0-rc-f994737d14-20240522` should be used) - `@types/react` and `@types/react-dom` have to be bumped to `npm:types-react@19.0.0-beta.2` using overrides and pnpm overrides, if you want correct types. You can find an example of this here: https://github.com/payloadcms/payload/pull/6429/files#diff-10cb9e57a77733f174ee2888587281e94c31f79e434aa3f932a8ec72fa7a5121L32 ## Issues - Bunch of todos for our react-select package which is having type issues. Works fine, just type issues. Their type defs are importing JSX in a weird way, we likely just have to wait until they fix them in a future update.
1 parent 85bfca7 commit 35f961f

File tree

89 files changed

+1483
-1094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1483
-1094
lines changed

.swcrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"syntax": "typescript",
88
"tsx": true,
99
"dts": true
10+
},
11+
"transform": {
12+
"react": {
13+
"runtime": "automatic",
14+
"pragmaFrag": "React.Fragment",
15+
"throwIfNamespace": true,
16+
"development": false,
17+
"useBuiltins": true
18+
}
1019
}
1120
},
1221
"module": {

next.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export default withBundleAnalyzer(
1616
typescript: {
1717
ignoreBuildErrors: true,
1818
},
19+
experimental: {
20+
reactCompiler: false
21+
},
1922
async redirects() {
2023
return [
2124
{

package.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
"@types/node": "20.12.5",
103103
"@types/prompts": "^2.4.5",
104104
"@types/qs": "6.9.14",
105-
"@types/react": "18.3.2",
105+
"@types/react": "npm:types-react@19.0.0-beta.2",
106+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
106107
"@types/semver": "^7.5.3",
107108
"@types/shelljs": "0.8.15",
108109
"add-stream": "^1.0.0",
@@ -132,7 +133,7 @@
132133
"lint-staged": "^14.0.1",
133134
"minimist": "1.2.8",
134135
"mongodb-memory-server": "^9.0",
135-
"next": "14.3.0-canary.68",
136+
"next": "15.0.0-rc.0",
136137
"node-mocks-http": "^1.14.1",
137138
"nodemon": "3.0.3",
138139
"open": "^10.1.0",
@@ -144,8 +145,8 @@
144145
"prettier": "^3.0.3",
145146
"prompts": "2.4.2",
146147
"qs": "6.11.2",
147-
"react": "^18.3.1",
148-
"react-dom": "^18.3.1",
148+
"react": "^19.0.0-rc-f994737d14-20240522",
149+
"react-dom": "^19.0.0-rc-f994737d14-20240522",
149150
"read-stream": "^2.1.1",
150151
"rimraf": "3.0.2",
151152
"semver": "^7.5.4",
@@ -166,8 +167,8 @@
166167
"yocto-queue": "^1.0.0"
167168
},
168169
"peerDependencies": {
169-
"react": "^18.2.0 || ^19.0.0",
170-
"react-dom": "^18.2.0 || ^19.0.0"
170+
"react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
171+
"react-dom": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522"
171172
},
172173
"engines": {
173174
"node": ">=18.20.2",
@@ -180,6 +181,8 @@
180181
"uuid": "3.4.0"
181182
},
182183
"overrides": {
184+
"@types/react": "npm:types-react@19.0.0-beta.2",
185+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
183186
"copyfiles": "$copyfiles",
184187
"cross-env": "$cross-env",
185188
"dotenv": "$dotenv",
@@ -194,6 +197,10 @@
194197
"playwright@1.43.0": "patches/playwright@1.43.0.patch"
195198
}
196199
},
200+
"overrides": {
201+
"@types/react": "npm:types-react@19.0.0-beta.2",
202+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
203+
},
197204
"workspaces:": [
198205
"packages/*",
199206
"test/*"

packages/create-payload-app/.swcrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"syntax": "typescript",
88
"tsx": true,
99
"dts": true
10+
},
11+
"transform": {
12+
"react": {
13+
"runtime": "automatic",
14+
"pragmaFrag": "React.Fragment",
15+
"throwIfNamespace": true,
16+
"development": false,
17+
"useBuiltins": true
18+
}
1019
}
1120
},
1221
"module": {

packages/email-nodemailer/.swcrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"syntax": "typescript",
88
"tsx": true,
99
"dts": true
10+
},
11+
"transform": {
12+
"react": {
13+
"runtime": "automatic",
14+
"pragmaFrag": "React.Fragment",
15+
"throwIfNamespace": true,
16+
"development": false,
17+
"useBuiltins": true
18+
}
1019
}
1120
},
1221
"module": {

packages/email-resend/.swcrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"syntax": "typescript",
88
"tsx": true,
99
"dts": true
10+
},
11+
"transform": {
12+
"react": {
13+
"runtime": "automatic",
14+
"pragmaFrag": "React.Fragment",
15+
"throwIfNamespace": true,
16+
"development": false,
17+
"useBuiltins": true
18+
}
1019
}
1120
},
1221
"module": {

packages/email-resend/.swcrc-build

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
"syntax": "typescript",
1212
"tsx": true,
1313
"dts": true
14+
},
15+
"transform": {
16+
"react": {
17+
"runtime": "automatic",
18+
"pragmaFrag": "React.Fragment",
19+
"throwIfNamespace": true,
20+
"development": false,
21+
"useBuiltins": true
22+
}
1423
}
1524
},
1625
"module": {

packages/live-preview-react/.swcrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"syntax": "typescript",
88
"tsx": true,
99
"dts": true
10+
},
11+
"transform": {
12+
"react": {
13+
"runtime": "automatic",
14+
"pragmaFrag": "React.Fragment",
15+
"throwIfNamespace": true,
16+
"development": false,
17+
"useBuiltins": true
18+
}
1019
}
1120
},
1221
"module": {

packages/live-preview-react/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
},
3636
"devDependencies": {
3737
"@payloadcms/eslint-config": "workspace:*",
38-
"@types/react": "18.3.2",
38+
"@types/react": "npm:types-react@19.0.0-beta.2",
39+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2",
3940
"payload": "workspace:*"
4041
},
4142
"peerDependencies": {
42-
"react": "^18.2.0 || ^19.0.0",
43-
"react-dom": "^18.2.0 || ^19.0.0"
43+
"react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
44+
"react-dom": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522"
4445
},
4546
"publishConfig": {
4647
"exports": {
@@ -53,5 +54,9 @@
5354
"main": "./dist/index.js",
5455
"registry": "https://registry.npmjs.org/",
5556
"types": "./dist/index.d.ts"
57+
},
58+
"overrides": {
59+
"@types/react": "npm:types-react@19.0.0-beta.2",
60+
"@types/react-dom": "npm:types-react-dom@19.0.0-beta.2"
5661
}
5762
}

packages/live-preview-react/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"emitDeclarationOnly": true,
77
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
88
"rootDir": "./src" /* Specify the root folder within your source files. */,
9-
"jsx": "react"
9+
"jsx": "react-jsx"
1010
},
1111
"exclude": [
1212
"dist",

0 commit comments

Comments
 (0)