Skip to content

Commit d484178

Browse files
authored
Merge branch 'canary' into patch-3
2 parents 48e7274 + ed10f7e commit d484178

File tree

255 files changed

+9641
-5886
lines changed

Some content is hidden

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

255 files changed

+9641
-5886
lines changed

.github/workflows/rspack-nextjs-build-integration-tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ jobs:
2222
integration_groups: 12
2323
e2e_timeout_minutes: 90
2424
integration_timeout_minutes: 90
25-
# Don't retry, instead of the default of twice, many of these tests are
26-
# currently failing, and it's wasteful to keep retrying them.
27-
num_retries: 0
2825
secrets: inherit

.github/workflows/rspack-nextjs-dev-integration-tests.yml

-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ jobs:
2222
integration_groups: 16
2323
e2e_timeout_minutes: 90
2424
integration_timeout_minutes: 90
25-
# Don't retry, instead of the default of twice, many of these tests are
26-
# currently failing, and it's wasteful to keep retrying them.
27-
num_retries: 0
2825
secrets: inherit

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"registry": "https://registry.npmjs.org/"
1717
}
1818
},
19-
"version": "15.3.0-canary.13"
19+
"version": "15.3.0-canary.14"
2020
}

package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,16 @@
227227
"pretty-ms": "7.0.0",
228228
"random-seed": "0.3.0",
229229
"react": "19.0.0",
230-
"react-builtin": "npm:[email protected]5398b711-20250314",
230+
"react-builtin": "npm:[email protected]db7dfe05-20250319",
231231
"react-dom": "19.0.0",
232-
"react-dom-builtin": "npm:[email protected]5398b711-20250314",
233-
"react-dom-experimental-builtin": "npm:[email protected]5398b711-20250314",
234-
"react-experimental-builtin": "npm:[email protected]5398b711-20250314",
235-
"react-is-builtin": "npm:[email protected]5398b711-20250314",
236-
"react-server-dom-turbopack": "19.1.0-canary-5398b711-20250314",
237-
"react-server-dom-turbopack-experimental": "npm:[email protected]5398b711-20250314",
238-
"react-server-dom-webpack": "19.1.0-canary-5398b711-20250314",
239-
"react-server-dom-webpack-experimental": "npm:[email protected]5398b711-20250314",
232+
"react-dom-builtin": "npm:[email protected]db7dfe05-20250319",
233+
"react-dom-experimental-builtin": "npm:[email protected]db7dfe05-20250319",
234+
"react-experimental-builtin": "npm:[email protected]db7dfe05-20250319",
235+
"react-is-builtin": "npm:[email protected]db7dfe05-20250319",
236+
"react-server-dom-turbopack": "19.1.0-canary-db7dfe05-20250319",
237+
"react-server-dom-turbopack-experimental": "npm:[email protected]db7dfe05-20250319",
238+
"react-server-dom-webpack": "19.1.0-canary-db7dfe05-20250319",
239+
"react-server-dom-webpack-experimental": "npm:[email protected]db7dfe05-20250319",
240240
"react-ssr-prepass": "1.0.8",
241241
"react-virtualized": "9.22.3",
242242
"relay-compiler": "13.0.2",
@@ -246,8 +246,8 @@
246246
"resolve-from": "5.0.0",
247247
"sass": "1.54.0",
248248
"satori": "0.12.1",
249-
"scheduler-builtin": "npm:[email protected]5398b711-20250314",
250-
"scheduler-experimental-builtin": "npm:[email protected]5398b711-20250314",
249+
"scheduler-builtin": "npm:[email protected]db7dfe05-20250319",
250+
"scheduler-experimental-builtin": "npm:[email protected]db7dfe05-20250319",
251251
"seedrandom": "3.0.5",
252252
"semver": "7.3.7",
253253
"shell-quote": "1.7.3",
@@ -289,10 +289,10 @@
289289
"@types/react": "19.0.8",
290290
"@types/react-dom": "19.0.3",
291291
"jest-snapshot": "30.0.0-alpha.6",
292-
"react": "19.1.0-canary-5398b711-20250314",
293-
"react-dom": "19.1.0-canary-5398b711-20250314",
294-
"react-is": "19.1.0-canary-5398b711-20250314",
295-
"scheduler": "0.26.0-canary-5398b711-20250314"
292+
"react": "19.1.0-canary-db7dfe05-20250319",
293+
"react-dom": "19.1.0-canary-db7dfe05-20250319",
294+
"react-is": "19.1.0-canary-db7dfe05-20250319",
295+
"scheduler": "0.26.0-canary-db7dfe05-20250319"
296296
},
297297
"patchedDependencies": {
298298

packages/create-next-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"description": "ESLint configuration used by Next.js.",
55
"main": "index.js",
66
"license": "MIT",
@@ -10,7 +10,7 @@
1010
},
1111
"homepage": "https://nextjs.org/docs/app/api-reference/config/eslint",
1212
"dependencies": {
13-
"@next/eslint-plugin-next": "15.3.0-canary.13",
13+
"@next/eslint-plugin-next": "15.3.0-canary.14",
1414
"@rushstack/eslint-patch": "^1.10.3",
1515
"@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
1616
"@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",

packages/eslint-plugin-next/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"description": "ESLint plugin for Next.js.",
55
"main": "dist/index.js",
66
"license": "MIT",

packages/font/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@next/font",
33
"private": true,
4-
"version": "15.3.0-canary.13",
4+
"version": "15.3.0-canary.14",
55
"repository": {
66
"url": "vercel/next.js",
77
"directory": "packages/font"

packages/next-bundle-analyzer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/bundle-analyzer",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"license": "MIT",

packages/next-codemod/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/codemod",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

packages/next-env/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/env",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"keywords": [
55
"react",
66
"next",

packages/next-mdx/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/mdx",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-plugin-rspack/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-rspack",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-rspack"

packages/next-plugin-storybook/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/plugin-storybook",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"repository": {
55
"url": "vercel/next.js",
66
"directory": "packages/next-plugin-storybook"

packages/next-polyfill-module/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-module",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"description": "A standard library polyfill for ES Modules supporting browsers (Edge 16+, Firefox 60+, Chrome 61+, Safari 10.1+)",
55
"main": "dist/polyfill-module.js",
66
"license": "MIT",

packages/next-polyfill-nomodule/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/polyfill-nomodule",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"description": "A polyfill for non-dead, nomodule browsers.",
55
"main": "dist/polyfill-nomodule.js",
66
"license": "MIT",

packages/next-swc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/swc",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"private": true,
55
"scripts": {
66
"clean": "node ../../scripts/rm.mjs native",

packages/next/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next",
3-
"version": "15.3.0-canary.13",
3+
"version": "15.3.0-canary.14",
44
"description": "The React Framework",
55
"main": "./dist/server/next.js",
66
"license": "MIT",
@@ -100,7 +100,7 @@
100100
]
101101
},
102102
"dependencies": {
103-
"@next/env": "15.3.0-canary.13",
103+
"@next/env": "15.3.0-canary.14",
104104
"@swc/counter": "0.1.3",
105105
"@swc/helpers": "0.5.15",
106106
"busboy": "1.6.0",
@@ -164,11 +164,11 @@
164164
"@jest/types": "29.5.0",
165165
"@mswjs/interceptors": "0.23.0",
166166
"@napi-rs/triples": "1.2.0",
167-
"@next/font": "15.3.0-canary.13",
168-
"@next/polyfill-module": "15.3.0-canary.13",
169-
"@next/polyfill-nomodule": "15.3.0-canary.13",
170-
"@next/react-refresh-utils": "15.3.0-canary.13",
171-
"@next/swc": "15.3.0-canary.13",
167+
"@next/font": "15.3.0-canary.14",
168+
"@next/polyfill-module": "15.3.0-canary.14",
169+
"@next/polyfill-nomodule": "15.3.0-canary.14",
170+
"@next/react-refresh-utils": "15.3.0-canary.14",
171+
"@next/swc": "15.3.0-canary.14",
172172
"@opentelemetry/api": "1.6.0",
173173
"@playwright/test": "1.41.2",
174174
"@storybook/addon-a11y": "8.6.0",

packages/next/src/client/components/react-dev-overlay/app/hot-reloader-client.tsx

+37-70
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,6 @@ export function waitForWebpackRuntimeHotUpdate() {
8181
return pendingHotUpdateWebpack
8282
}
8383

84-
function handleSuccessfulHotUpdateWebpack(
85-
dispatcher: Dispatcher,
86-
sendMessage: (message: string) => void,
87-
updatedModules: ReadonlyArray<string>
88-
) {
89-
resolvePendingHotUpdateWebpack()
90-
dispatcher.onBuildOk()
91-
reportHmrLatency(
92-
sendMessage,
93-
updatedModules,
94-
webpackStartMsSinceEpoch!,
95-
Date.now()
96-
)
97-
98-
dispatcher.onRefresh()
99-
}
100-
10184
// There is a newer version of the code available.
10285
function handleAvailableHash(hash: string) {
10386
// Update last known compilation hash.
@@ -160,10 +143,8 @@ function performFullReload(err: any, sendMessage: any) {
160143
}
161144

162145
// Attempt to update code on the fly, fall back to a hard reload.
163-
function tryApplyUpdates(
164-
onBeforeUpdate: (hasUpdates: boolean) => void,
165-
onHotUpdateSuccess: (updatedModules: string[]) => void,
166-
sendMessage: any,
146+
function tryApplyUpdatesWebpack(
147+
sendMessage: (message: string) => void,
167148
dispatcher: Dispatcher
168149
) {
169150
if (!isUpdateAvailable() || !canApplyUpdates()) {
@@ -173,8 +154,11 @@ function tryApplyUpdates(
173154
return
174155
}
175156

176-
function handleApplyUpdates(err: any, updatedModules: string[] | null) {
177-
if (err || RuntimeErrorHandler.hadRuntimeError || !updatedModules) {
157+
function handleApplyUpdates(
158+
err: any,
159+
updatedModules: (string | number)[] | null
160+
) {
161+
if (err || RuntimeErrorHandler.hadRuntimeError || updatedModules == null) {
178162
if (err) {
179163
console.warn(REACT_REFRESH_FULL_RELOAD)
180164
} else if (RuntimeErrorHandler.hadRuntimeError) {
@@ -184,50 +168,50 @@ function tryApplyUpdates(
184168
return
185169
}
186170

187-
const hasUpdates = Boolean(updatedModules.length)
188-
if (typeof onHotUpdateSuccess === 'function') {
189-
// Maybe we want to do something.
190-
onHotUpdateSuccess(updatedModules)
191-
}
171+
dispatcher.onBuildOk()
192172

193173
if (isUpdateAvailable()) {
194174
// While we were updating, there was a new update! Do it again.
195-
tryApplyUpdates(
196-
hasUpdates ? () => {} : onBeforeUpdate,
197-
hasUpdates ? () => dispatcher.onBuildOk() : onHotUpdateSuccess,
198-
sendMessage,
199-
dispatcher
200-
)
201-
} else {
202-
dispatcher.onBuildOk()
203-
if (process.env.__NEXT_TEST_MODE) {
204-
afterApplyUpdates(() => {
205-
if (self.__NEXT_HMR_CB) {
206-
self.__NEXT_HMR_CB()
207-
self.__NEXT_HMR_CB = null
208-
}
209-
})
210-
}
175+
tryApplyUpdatesWebpack(sendMessage, dispatcher)
176+
return
177+
}
178+
179+
dispatcher.onRefresh()
180+
resolvePendingHotUpdateWebpack()
181+
reportHmrLatency(
182+
sendMessage,
183+
updatedModules,
184+
webpackStartMsSinceEpoch!,
185+
Date.now()
186+
)
187+
188+
if (process.env.__NEXT_TEST_MODE) {
189+
afterApplyUpdates(() => {
190+
if (self.__NEXT_HMR_CB) {
191+
self.__NEXT_HMR_CB()
192+
self.__NEXT_HMR_CB = null
193+
}
194+
})
211195
}
212196
}
213197

214198
// https://webpack.js.org/api/hot-module-replacement/#check
215199
module.hot
216200
.check(/* autoApply */ false)
217-
.then((updatedModules: any[] | null) => {
218-
if (!updatedModules) {
201+
.then((updatedModules: (string | number)[] | null) => {
202+
if (updatedModules == null) {
219203
return null
220204
}
221205

222-
if (typeof onBeforeUpdate === 'function') {
223-
const hasUpdates = Boolean(updatedModules.length)
224-
onBeforeUpdate(hasUpdates)
225-
}
206+
// We should always handle an update, even if updatedModules is empty (but
207+
// non-null) for any reason. That's what webpack would normally do:
208+
// https://github.com/webpack/webpack/blob/3aa6b6bc3a64/lib/hmr/HotModuleReplacement.runtime.js#L296-L298
209+
dispatcher.onBeforeRefresh()
226210
// https://webpack.js.org/api/hot-module-replacement/#apply
227211
return module.hot.apply()
228212
})
229213
.then(
230-
(updatedModules: any[] | null) => {
214+
(updatedModules: (string | number)[] | null) => {
231215
handleApplyUpdates(null, updatedModules)
232216
},
233217
(err: any) => {
@@ -236,7 +220,7 @@ function tryApplyUpdates(
236220
)
237221
}
238222

239-
/** Handles messages from the sevrer for the App Router. */
223+
/** Handles messages from the server for the App Router. */
240224
function processMessage(
241225
obj: HMR_ACTION_TYPES,
242226
sendMessage: (message: string) => void,
@@ -288,24 +272,7 @@ function processMessage(
288272
}
289273
dispatcher.onBuildOk()
290274
} else {
291-
tryApplyUpdates(
292-
function onBeforeHotUpdate(hasUpdates: boolean) {
293-
if (hasUpdates) {
294-
dispatcher.onBeforeRefresh()
295-
}
296-
},
297-
function onSuccessfulHotUpdate(webpackUpdatedModules: string[]) {
298-
// Only dismiss it when we're sure it's a hot update.
299-
// Otherwise it would flicker right before the reload.
300-
handleSuccessfulHotUpdateWebpack(
301-
dispatcher,
302-
sendMessage,
303-
webpackUpdatedModules
304-
)
305-
},
306-
sendMessage,
307-
dispatcher
308-
)
275+
tryApplyUpdatesWebpack(sendMessage, dispatcher)
309276
}
310277
}
311278

0 commit comments

Comments
 (0)