Skip to content

Commit 18ca83b

Browse files
authored
feat: next.js 16 support (#14456)
This PR: - updates this monorepo to use Next.js 16. Running our test suites against Next.js 16 is required to guarantee support. - updates all peerDependencies to support the latest Next.js canary. Individual Next.js 16–related fixes were made in separate, smaller PRs (listed below). As a result, the majority of the changes in this PR are focused on getting the test suite to pass. Templates will be updated in a separate PR once Next.js 16.2.0 is released.
1 parent f4e8990 commit 18ca83b

File tree

84 files changed

+7471
-8473
lines changed

Some content is hidden

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

84 files changed

+7471
-8473
lines changed

docs/performance/overview.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,9 @@ Everything mentioned above applies to local development as well, but there are a
206206

207207
### Enable Turbopack
208208

209-
<Banner type="warning">
210-
**Note:** In the future this will be the default. Use at your own risk.
211-
</Banner>
209+
In Next.js 16, turbopack is enabled by default, unless you explicitly disabled it using the `--webpack` flag.
212210

213-
Add `--turbo` to your dev script to significantly speed up your local development server start time.
211+
In Next.js 15, add `--turbo` to your dev script to significantly speed up your local development server start time.
214212

215213
```json
216214
{

next-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
import './.next/types/routes.d.ts'
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

next.config.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ const config = withBundleAnalyzer(
1515
withPayload(
1616
{
1717
basePath: process.env?.NEXT_BASE_PATH || undefined,
18-
eslint: {
19-
ignoreDuringBuilds: true,
20-
},
2118
typescript: {
2219
ignoreBuildErrors: true,
2320
},
@@ -43,7 +40,12 @@ const config = withBundleAnalyzer(
4340
]
4441
},
4542
images: {
46-
domains: ['localhost'],
43+
remotePatterns: [
44+
{
45+
hostname: 'localhost',
46+
},
47+
],
48+
qualities: [5, 50, 75, 100]
4749
},
4850
webpack: (webpackConfig) => {
4951
webpackConfig.resolve.extensionAlias = {

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"devDependencies": {
156156
"@axe-core/playwright": "4.11.0",
157157
"@libsql/client": "0.14.0",
158-
"@next/bundle-analyzer": "15.4.10",
158+
"@next/bundle-analyzer": "16.1.1-canary.35",
159159
"@payloadcms/db-postgres": "workspace:*",
160160
"@payloadcms/eslint-config": "workspace:*",
161161
"@payloadcms/eslint-plugin": "workspace:*",
@@ -169,8 +169,8 @@
169169
"@types/fs-extra": "^11.0.2",
170170
"@types/minimist": "1.2.5",
171171
"@types/node": "22.15.30",
172-
"@types/react": "19.2.1",
173-
"@types/react-dom": "19.2.1",
172+
"@types/react": "19.2.8",
173+
"@types/react-dom": "19.2.3",
174174
"@types/shelljs": "0.8.15",
175175
"axe-core": "4.11.0",
176176
"chalk": "^4.1.2",
@@ -191,7 +191,7 @@
191191
"lint-staged": "15.2.7",
192192
"minimist": "1.2.8",
193193
"mongoose": "8.15.1",
194-
"next": "15.4.10",
194+
"next": "16.1.1-canary.35",
195195
"open": "^10.1.0",
196196
"p-limit": "^5.0.0",
197197
"pg": "8.16.3",
@@ -200,8 +200,8 @@
200200
"postcss": "^8.4.49",
201201
"postcss-scss": "^4.0.9",
202202
"prettier": "3.5.3",
203-
"react": "19.2.1",
204-
"react-dom": "19.2.1",
203+
"react": "19.2.3",
204+
"react-dom": "19.2.3",
205205
"rimraf": "6.0.1",
206206
"sharp": "0.32.6",
207207
"shelljs": "0.8.5",
@@ -224,6 +224,7 @@
224224
},
225225
"pnpm": {
226226
"onlyBuiltDependencies": [
227+
"@parcel/watcher",
227228
"@sentry/cli",
228229
"@swc/core",
229230
"@vercel/git-hooks",

packages/admin-bar/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
},
4343
"devDependencies": {
4444
"@payloadcms/eslint-config": "workspace:*",
45-
"@types/react": "19.2.1",
46-
"@types/react-dom": "19.2.1",
45+
"@types/react": "19.2.8",
46+
"@types/react-dom": "19.2.3",
4747
"payload": "workspace:*"
4848
},
4949
"peerDependencies": {

packages/db-d1-sqlite/bundle.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ async function build() {
3030
tsconfig: path.resolve(dirname, './tsconfig.json'),
3131
plugins: [commonjs()],
3232
sourcemap: true,
33+
// 18.20.2 is the lowest version of node supported by Payload
34+
target: 'node18.20.2',
3335
})
3436
console.log('db-sqlite bundled successfully')
3537

packages/db-postgres/bundle.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ async function build() {
2929
tsconfig: path.resolve(dirname, './tsconfig.json'),
3030
plugins: [commonjs()],
3131
sourcemap: true,
32+
// 18.20.2 is the lowest version of node supported by Payload
33+
target: 'node18.20.2',
3234
})
3335
console.log('db-postgres bundled successfully')
3436

packages/db-postgres/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
8989
"@payloadcms/eslint-config": "workspace:*",
9090
"@types/to-snake-case": "1.0.0",
91-
"esbuild": "0.25.5",
91+
"esbuild": "0.27.1",
9292
"payload": "workspace:*"
9393
},
9494
"peerDependencies": {

packages/db-sqlite/bundle.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ async function build() {
3030
tsconfig: path.resolve(dirname, './tsconfig.json'),
3131
plugins: [commonjs()],
3232
sourcemap: true,
33+
// 18.20.2 is the lowest version of node supported by Payload
34+
target: 'node18.20.2',
3335
})
3436
console.log('db-sqlite bundled successfully')
3537

packages/db-vercel-postgres/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"@payloadcms/eslint-config": "workspace:*",
9090
"@types/pg": "8.10.2",
9191
"@types/to-snake-case": "1.0.0",
92-
"esbuild": "0.25.5",
92+
"esbuild": "0.27.1",
9393
"payload": "workspace:*"
9494
},
9595
"peerDependencies": {

0 commit comments

Comments
 (0)