Skip to content

Commit 8d1fc6e

Browse files
paulpopusAlessioGr
andauthored
feat!: bump next canary to 104 and update withPayload for new config (#7541)
We are now bumping up the Next canary version to `15.0.0-canary.104` and `react` and `react-dom` to `^19.0.0-rc-06d0b89e-20240801`. Your new dependencies should look like this: ``` "next": "15.0.0-canary.104", "react": "^19.0.0-rc-06d0b89e-20240801", "react-dom": "^19.0.0-rc-06d0b89e-20240801", ``` --------- Co-authored-by: Alessio Gravili <alessio@gravili.de>
1 parent 62744e7 commit 8d1fc6e

File tree

18 files changed

+204
-182
lines changed

18 files changed

+204
-182
lines changed

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"devDependencies": {
9797
"@jest/globals": "29.7.0",
9898
"@libsql/client": "0.6.2",
99-
"@next/bundle-analyzer": "15.0.0-canary.53",
99+
"@next/bundle-analyzer": "15.0.0-canary.104",
100100
"@payloadcms/eslint-config": "workspace:*",
101101
"@payloadcms/eslint-plugin": "workspace:*",
102102
"@payloadcms/live-preview-react": "workspace:*",
@@ -131,15 +131,15 @@
131131
"lint-staged": "15.2.7",
132132
"minimist": "1.2.8",
133133
"mongodb-memory-server": "^9.0",
134-
"next": "15.0.0-canary.53",
134+
"next": "15.0.0-canary.104",
135135
"open": "^10.1.0",
136136
"p-limit": "^5.0.0",
137137
"playwright": "1.43.0",
138138
"playwright-core": "1.43.0",
139139
"prettier": "3.3.2",
140140
"prompts": "2.4.2",
141-
"react": "^19.0.0-rc-6230622a1a-20240610",
142-
"react-dom": "^19.0.0-rc-6230622a1a-20240610",
141+
"react": "^19.0.0-rc-06d0b89e-20240801",
142+
"react-dom": "^19.0.0-rc-06d0b89e-20240801",
143143
"rimraf": "3.0.2",
144144
"semver": "^7.5.4",
145145
"sharp": "0.32.6",
@@ -153,8 +153,8 @@
153153
"typescript": "5.5.4"
154154
},
155155
"peerDependencies": {
156-
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
157-
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610"
156+
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
157+
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801"
158158
},
159159
"engines": {
160160
"node": "^18.20.2 || >=20.9.0",

packages/live-preview-react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"payload": "workspace:*"
4242
},
4343
"peerDependencies": {
44-
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
45-
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610"
44+
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
45+
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801"
4646
},
4747
"publishConfig": {
4848
"exports": {

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
},
9595
"peerDependencies": {
9696
"graphql": "^16.8.1",
97-
"next": "^15.0.0-canary.53",
97+
"next": "^15.0.0-canary.104",
9898
"payload": "workspace:*"
9999
},
100100
"engines": {

packages/next/src/views/Document/index.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import type { AdminViewComponent, AdminViewProps, EditViewComponent } from 'payload'
22

33
import { DocumentInfoProvider, EditDepthProvider, HydrateClientUser } from '@payloadcms/ui'
4-
import { RenderCustomComponent, formatAdminURL , isEditing as getIsEditing } from '@payloadcms/ui/shared'
4+
import {
5+
RenderCustomComponent,
6+
formatAdminURL,
7+
isEditing as getIsEditing,
8+
} from '@payloadcms/ui/shared'
59
import { notFound, redirect } from 'next/navigation.js'
10+
import { deepCopyObjectSimple } from 'payload'
611
import React from 'react'
712

813
import type { GenerateEditViewMetadata } from './getMetaBySegment.js'
@@ -208,7 +213,15 @@ export const Document: React.FC<AdminViewProps> = async ({
208213
permissions={permissions}
209214
/>
210215
)}
211-
<HydrateClientUser permissions={permissions} user={user} />
216+
{/**
217+
* After bumping the Next.js canary to 104, and React to 19.0.0-rc-06d0b89e-20240801" we have to deepCopy the permissions object (https://github.com/payloadcms/payload/pull/7541).
218+
* If both HydrateClientUser and RenderCustomComponent receive the same permissions object (same object reference), we get a
219+
* "TypeError: Cannot read properties of undefined (reading '$$typeof')" error when loading up some version views - for example a versions
220+
* view in the draft-posts collection of the versions test suite. RenderCustomComponent is what renders the versions view.
221+
*
222+
* // TODO: Revisit this in the future and figure out why this is happening. Might be a React/Next.js bug. We don't know why it happens, and a future React/Next version might unbreak this (keep an eye on this and remove deepCopyObjectSimple if that's the case)
223+
*/}
224+
<HydrateClientUser permissions={deepCopyObjectSimple(permissions)} user={user} />
212225
<EditDepthProvider
213226
depth={1}
214227
key={`${collectionSlug || globalSlug}${locale?.code ? `-${locale?.code}` : ''}`}

packages/next/src/withPayload.js

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,20 @@ export const withPayload = (nextConfig = {}) => {
1818
env: {
1919
...(nextConfig?.env || {}),
2020
},
21+
outputFileTracingExcludes: {
22+
...(nextConfig?.outputFileTracingExcludes || {}),
23+
'**/*': [
24+
...(nextConfig?.outputFileTracingExcludes?.['**/*'] || []),
25+
'drizzle-kit',
26+
'drizzle-kit/api',
27+
],
28+
},
29+
outputFileTracingIncludes: {
30+
...(nextConfig?.outputFileTracingIncludes || {}),
31+
'**/*': [...(nextConfig?.outputFileTracingIncludes?.['**/*'] || []), '@libsql/client'],
32+
},
2133
experimental: {
2234
...(nextConfig?.experimental || {}),
23-
outputFileTracingExcludes: {
24-
'**/*': [
25-
...(nextConfig.experimental?.outputFileTracingExcludes?.['**/*'] || []),
26-
'drizzle-kit',
27-
'drizzle-kit/api',
28-
],
29-
},
30-
outputFileTracingIncludes: {
31-
'**/*': [
32-
...(nextConfig.experimental?.outputFileTracingIncludes?.['**/*'] || []),
33-
'@libsql/client',
34-
],
35-
},
3635
turbo: {
3736
...(nextConfig?.experimental?.turbo || {}),
3837
resolveAlias: {

packages/payload/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"pretest": "pnpm build"
8585
},
8686
"dependencies": {
87-
"@next/env": "^15.0.0-canary.53",
87+
"@next/env": "^15.0.0-canary.104",
8888
"@payloadcms/translations": "workspace:*",
8989
"@swc-node/core": "1.13.1",
9090
"@swc-node/sourcemap-support": "0.5.0",

packages/plugin-form-builder/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
},
6363
"peerDependencies": {
6464
"payload": "workspace:*",
65-
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
66-
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610"
65+
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
66+
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801"
6767
},
6868
"publishConfig": {
6969
"exports": {

packages/plugin-search/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
},
5656
"peerDependencies": {
5757
"payload": "workspace:*",
58-
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
59-
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610"
58+
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
59+
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801"
6060
},
6161
"publishConfig": {
6262
"exports": {

packages/plugin-sentry/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
},
5959
"peerDependencies": {
6060
"payload": "workspace:*",
61-
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
62-
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610"
61+
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
62+
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801"
6363
},
6464
"publishConfig": {
6565
"exports": {

packages/plugin-seo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
"@payloadcms/translations": "workspace:*",
6565
"@payloadcms/ui": "workspace:*",
6666
"payload": "workspace:*",
67-
"react": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610",
68-
"react-dom": "^19.0.0 || ^19.0.0-rc-6230622a1a-20240610"
67+
"react": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801",
68+
"react-dom": "^19.0.0 || ^19.0.0-rc-06d0b89e-20240801"
6969
},
7070
"publishConfig": {
7171
"exports": {

0 commit comments

Comments
 (0)