Skip to content

Commit 319d335

Browse files
authored
feat: improve turbopack compatibility (#11376)
This PR introduces a few changes to improve turbopack compatibility and ensure e2e tests pass with turbopack enabled ## Changes to improve turbopack compatibility - Use correct sideEffects configuration to fix scss issues - Import scss directly instead of duplicating our scss rules - Fix some scss rules that are not supported by turbopack - Bump Next.js and all other dependencies used to build payload ## Changes to get tests to pass For an unknown reason, flaky tests flake a lot more often in turbopack. This PR does the following to get them to pass: - add more `wait`s - fix actual flakes by ensuring previous operations are properly awaited ## Blocking turbopack bugs - [X] vercel/next.js#76464 - Fix PR: vercel/next.js#76545 - Once fixed: change `"sideEffectsDisabled":` back to `"sideEffects":` ## Non-blocking turbopack bugs - [ ] vercel/next.js#76956 ## Related PRs #12653 #12652
1 parent 2b40e0f commit 319d335

File tree

167 files changed

+1854
-4675
lines changed

Some content is hidden

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

167 files changed

+1854
-4675
lines changed

examples/form-builder/src/components/icons/Check/index.module.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@
33
width: var(--base);
44

55
.stroke {
6-
stroke-width: 1px;
6+
stroke-width: 2px;
77
fill: none;
88
stroke: currentColor;
99
}
10-
11-
&:local() {
12-
.stroke {
13-
stroke-width: 2px;
14-
}
15-
}
1610
}

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@
9999
"test:e2e:headed": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 DISABLE_LOGGING=true playwright test --headed",
100100
"test:e2e:prod": "pnpm prepare-run-test-against-prod && pnpm runts ./test/runE2E.ts --prod",
101101
"test:e2e:prod:ci": "pnpm prepare-run-test-against-prod:ci && pnpm runts ./test/runE2E.ts --prod",
102+
"test:e2e:prod:ci:turbo": "pnpm prepare-run-test-against-prod:ci && pnpm runts ./test/runE2E.ts --prod --turbo",
103+
"test:e2e:turbo": "pnpm runts ./test/runE2E.ts --turbo",
102104
"test:int": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
103105
"test:int:postgres": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=postgres DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
104106
"test:int:sqlite": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" NODE_NO_WARNINGS=1 PAYLOAD_DATABASE=sqlite DISABLE_LOGGING=true jest --forceExit --detectOpenHandles --config=test/jest.config.js --runInBand",
@@ -120,17 +122,17 @@
120122
"devDependencies": {
121123
"@jest/globals": "29.7.0",
122124
"@libsql/client": "0.14.0",
123-
"@next/bundle-analyzer": "15.3.0",
125+
"@next/bundle-analyzer": "15.3.2",
124126
"@payloadcms/db-postgres": "workspace:*",
125127
"@payloadcms/eslint-config": "workspace:*",
126128
"@payloadcms/eslint-plugin": "workspace:*",
127129
"@payloadcms/live-preview-react": "workspace:*",
128130
"@playwright/test": "1.50.0",
129131
"@sentry/nextjs": "^8.33.1",
130132
"@sentry/node": "^8.33.1",
131-
"@swc-node/register": "1.10.9",
132-
"@swc/cli": "0.6.0",
133-
"@swc/jest": "0.2.37",
133+
"@swc-node/register": "1.10.10",
134+
"@swc/cli": "0.7.7",
135+
"@swc/jest": "0.2.38",
134136
"@types/fs-extra": "^11.0.2",
135137
"@types/jest": "29.5.12",
136138
"@types/minimist": "1.2.5",
@@ -145,8 +147,6 @@
145147
"cross-env": "7.0.3",
146148
"dotenv": "16.4.7",
147149
"drizzle-kit": "0.28.0",
148-
"drizzle-orm": "0.36.1",
149-
"escape-html": "^1.0.3",
150150
"execa": "5.1.1",
151151
"form-data": "3.0.1",
152152
"fs-extra": "10.1.0",
@@ -156,7 +156,7 @@
156156
"lint-staged": "15.2.7",
157157
"minimist": "1.2.8",
158158
"mongodb-memory-server": "^10",
159-
"next": "15.3.0",
159+
"next": "15.3.2",
160160
"open": "^10.1.0",
161161
"p-limit": "^5.0.0",
162162
"playwright": "1.50.0",
@@ -169,7 +169,7 @@
169169
"shelljs": "0.8.5",
170170
"slash": "3.0.0",
171171
"sort-package-json": "^2.10.0",
172-
"swc-plugin-transform-remove-imports": "3.1.0",
172+
"swc-plugin-transform-remove-imports": "4.0.4",
173173
"tempy": "1.0.1",
174174
"tstyche": "^3.1.1",
175175
"tsx": "4.19.2",
@@ -186,7 +186,6 @@
186186
"copyfiles": "$copyfiles",
187187
"cross-env": "$cross-env",
188188
"dotenv": "$dotenv",
189-
"drizzle-orm": "$drizzle-orm",
190189
"graphql": "^16.8.1",
191190
"mongodb-memory-server": "$mongodb-memory-server",
192191
"react": "$react",

packages/create-payload-app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"url": "https://payloadcms.com"
1717
}
1818
],
19+
"sideEffects": false,
1920
"type": "module",
2021
"exports": {
2122
"./types": {
@@ -60,7 +61,7 @@
6061
"dependencies": {
6162
"@clack/prompts": "^0.7.0",
6263
"@sindresorhus/slugify": "^1.1.0",
63-
"@swc/core": "1.10.12",
64+
"@swc/core": "1.11.29",
6465
"arg": "^5.0.0",
6566
"chalk": "^4.1.0",
6667
"comment-json": "^4.2.3",

packages/db-mongodb/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/db-postgres/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"url": "https://payloadcms.com"
1818
}
1919
],
20+
"sideEffects": false,
2021
"type": "module",
2122
"exports": {
2223
".": {
@@ -85,10 +86,10 @@
8586
"uuid": "10.0.0"
8687
},
8788
"devDependencies": {
88-
"@hyrious/esbuild-plugin-commonjs": "^0.2.4",
89+
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
8990
"@payloadcms/eslint-config": "workspace:*",
9091
"@types/to-snake-case": "1.0.0",
91-
"esbuild": "0.24.2",
92+
"esbuild": "0.25.5",
9293
"payload": "workspace:*"
9394
},
9495
"peerDependencies": {

packages/db-sqlite/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/db-vercel-postgres/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"url": "https://payloadcms.com"
1818
}
1919
],
20+
"sideEffects": false,
2021
"type": "module",
2122
"exports": {
2223
".": {
@@ -85,11 +86,11 @@
8586
"uuid": "10.0.0"
8687
},
8788
"devDependencies": {
88-
"@hyrious/esbuild-plugin-commonjs": "^0.2.4",
89+
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
8990
"@payloadcms/eslint-config": "workspace:*",
9091
"@types/pg": "8.10.2",
9192
"@types/to-snake-case": "1.0.0",
92-
"esbuild": "0.24.2",
93+
"esbuild": "0.25.5",
9394
"payload": "workspace:*"
9495
},
9596
"peerDependencies": {

packages/drizzle/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/email-nodemailer/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/email-resend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"eslint-plugin-jest-dom": "5.5.0",
3737
"eslint-plugin-jsx-a11y": "6.10.2",
3838
"eslint-plugin-perfectionist": "3.9.1",
39-
"eslint-plugin-react-compiler": "19.0.0-beta-e993439-20250405",
39+
"eslint-plugin-react-compiler": "19.1.0-rc.2",
4040
"eslint-plugin-react-hooks": "0.0.0-experimental-d331ba04-20250307",
4141
"eslint-plugin-regexp": "2.7.0",
4242
"globals": "16.0.0",

packages/graphql/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
}
1818
],
1919
"type": "module",
20+
"sideEffects": false,
2021
"exports": {
2122
".": {
2223
"import": "./src/index.ts",

packages/live-preview-react/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/live-preview-vue/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/live-preview/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
}
1919
],
2020
"type": "module",
21+
"sideEffects": false,
2122
"exports": {
2223
".": {
2324
"import": "./src/index.ts",

packages/next/package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"url": "https://payloadcms.com"
1717
}
1818
],
19+
"sideEffects": [
20+
"*.scss",
21+
"*.css"
22+
],
1923
"type": "module",
2024
"exports": {
2125
".": {
@@ -104,22 +108,22 @@
104108
"uuid": "10.0.0"
105109
},
106110
"devDependencies": {
107-
"@babel/cli": "7.26.4",
108-
"@babel/core": "7.26.7",
109-
"@babel/preset-env": "7.26.7",
110-
"@babel/preset-react": "7.26.3",
111-
"@babel/preset-typescript": "7.26.0",
112-
"@next/eslint-plugin-next": "15.3.0",
111+
"@babel/cli": "7.27.2",
112+
"@babel/core": "7.27.3",
113+
"@babel/preset-env": "7.27.2",
114+
"@babel/preset-react": "7.27.1",
115+
"@babel/preset-typescript": "7.27.1",
116+
"@next/eslint-plugin-next": "15.3.2",
113117
"@payloadcms/eslint-config": "workspace:*",
114118
"@types/busboy": "1.5.4",
115119
"@types/react": "19.1.0",
116120
"@types/react-dom": "19.1.2",
117121
"@types/uuid": "10.0.0",
118-
"babel-plugin-react-compiler": "19.0.0-beta-e993439-20250405",
119-
"esbuild": "0.24.2",
122+
"babel-plugin-react-compiler": "19.1.0-rc.2",
123+
"esbuild": "0.25.5",
120124
"esbuild-sass-plugin": "3.3.1",
121125
"payload": "workspace:*",
122-
"swc-plugin-transform-remove-imports": "3.1.0"
126+
"swc-plugin-transform-remove-imports": "4.0.4"
123127
},
124128
"peerDependencies": {
125129
"graphql": "^16.8.1",

packages/next/src/elements/DocumentHeader/Tabs/Tab/index.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '~@payloadcms/ui/scss';
2+
13
@layer payload-default {
24
.doc-tab {
35
display: flex;

packages/next/src/elements/DocumentHeader/Tabs/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../scss/styles.scss';
1+
@import '~@payloadcms/ui/scss';
22

33
@layer payload-default {
44
.doc-tabs {

packages/next/src/elements/DocumentHeader/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../scss/styles.scss';
1+
@import '~@payloadcms/ui/scss';
22

33
@layer payload-default {
44
.doc-header {

packages/next/src/elements/Nav/NavWrapper/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../../scss/styles.scss';
1+
@import '~@payloadcms/ui/scss';
22

33
@layer payload-default {
44
.nav {

packages/next/src/elements/Nav/index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../scss/styles.scss';
1+
@import '~@payloadcms/ui/scss';
22

33
@layer payload-default {
44
.nav {

0 commit comments

Comments
 (0)