Skip to content

Commit c04aa45

Browse files
committed
Merge branch 'canary' into wbinnssmith/warn-rspack
2 parents 4c205fb + a14d013 commit c04aa45

File tree

5 files changed

+103
-43
lines changed

5 files changed

+103
-43
lines changed

Diff for: docs/01-app/04-api-reference/02-components/link.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1362,11 +1362,11 @@ export function CustomLink({ children, ...props }: CustomLinkProps) {
13621362
return (
13631363
<Link
13641364
onNavigate={(e) => {
1365-
if (isBlocked) {
1365+
if (
1366+
isBlocked &&
1367+
!window.confirm('You have unsaved changes. Leave anyway?')
1368+
) {
13661369
e.preventDefault()
1367-
if (!window.confirm('You have unsaved changes. Leave anyway?')) {
1368-
e.preventDefault()
1369-
}
13701370
}
13711371
}}
13721372
{...props}
@@ -1389,11 +1389,11 @@ export function CustomLink({ children, ...props }) {
13891389
return (
13901390
<Link
13911391
onNavigate={(e) => {
1392-
if (isBlocked) {
1392+
if (
1393+
isBlocked &&
1394+
!window.confirm('You have unsaved changes. Leave anyway?')
1395+
) {
13931396
e.preventDefault()
1394-
if (!window.confirm('You have unsaved changes. Leave anyway?')) {
1395-
e.preventDefault()
1396-
}
13971397
}
13981398
}}
13991399
{...props}

Diff for: packages/next-rspack/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# next-rspack (EXPERIMENTAL)
22

33
> [!WARNING]
4-
> This package is currently experimental and actively developed and supported in Next.js`canary` branch. To use this, you must be using a published canary build of Next.js.
4+
> This package is a community effort and is currently experimental. Help improve Next.js and Rspack by providing feedback at https://github.com/vercel/next.js/discussions/77800
55
66
This plugin allows you to use [Rspack](https://rspack.dev) in place of webpack with Next.js.
77

Diff for: test/development/acceptance/hydration-error.test.ts

+89-24
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ describe('Error overlay for hydration errors in Pages router', () => {
1111
const { next } = nextTestSetup({
1212
files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')),
1313
skipStart: true,
14+
// TODO: once Next.js minimal React version is 19.1, remove this override.
15+
dependencies: {
16+
react: isReact18 ? '^18.3.1' : '^19.1.0',
17+
'react-dom': isReact18 ? '^18.3.1' : '^19.1.0',
18+
},
1419
})
1520

1621
it('includes a React docs link when hydration error does occur', async () => {
@@ -111,8 +116,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
111116
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
112117
"environmentLabel": null,
113118
"label": "Runtime Error",
114-
"source": null,
115-
"stack": [],
119+
"source": "index.js (5:9) @ Mismatch
120+
> 5 | <main className="child">{isClient ? "client" : "server"}</main>
121+
| ^",
122+
"stack": [
123+
"main <anonymous> (0:0)",
124+
"Mismatch index.js (5:9)",
125+
],
116126
}
117127
`)
118128
}
@@ -193,8 +203,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
193203
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
194204
"environmentLabel": null,
195205
"label": "Runtime Error",
196-
"source": null,
197-
"stack": [],
206+
"source": "index.js (5:20) @ Mismatch
207+
> 5 | {isClient && <main className="only" />}
208+
| ^",
209+
"stack": [
210+
"main <anonymous> (0:0)",
211+
"Mismatch index.js (5:20)",
212+
],
198213
}
199214
`)
200215
}
@@ -264,8 +279,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
264279
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
265280
"environmentLabel": null,
266281
"label": "Runtime Error",
267-
"source": null,
268-
"stack": [],
282+
"source": "index.js (4:5) @ Mismatch
283+
> 4 | <div className="parent">
284+
| ^",
285+
"stack": [
286+
"div <anonymous> (0:0)",
287+
"Mismatch index.js (4:5)",
288+
],
269289
}
270290
`)
271291
}
@@ -325,8 +345,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
325345
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
326346
"environmentLabel": null,
327347
"label": "Runtime Error",
328-
"source": null,
329-
"stack": [],
348+
"source": "index.js (4:5) @ Mismatch
349+
> 4 | <div className="parent">
350+
| ^",
351+
"stack": [
352+
"div <anonymous> (0:0)",
353+
"Mismatch index.js (4:5)",
354+
],
330355
}
331356
`)
332357
}
@@ -384,8 +409,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
384409
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
385410
"environmentLabel": null,
386411
"label": "Runtime Error",
387-
"source": null,
388-
"stack": [],
412+
"source": "index.js (3:10) @ Mismatch
413+
> 3 | return <div className="parent">{!isClient && "only"}</div>;
414+
| ^",
415+
"stack": [
416+
"div <anonymous> (0:0)",
417+
"Mismatch index.js (3:10)",
418+
],
389419
}
390420
`)
391421
}
@@ -455,8 +485,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
455485
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
456486
"environmentLabel": null,
457487
"label": "Runtime Error",
458-
"source": null,
459-
"stack": [],
488+
"source": "index.js (3:5) @ Page
489+
> 3 | <table>
490+
| ^",
491+
"stack": [
492+
"table <anonymous> (0:0)",
493+
"Page index.js (3:5)",
494+
],
460495
}
461496
`)
462497
}
@@ -520,8 +555,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
520555
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
521556
"environmentLabel": null,
522557
"label": "Runtime Error",
523-
"source": null,
524-
"stack": [],
558+
"source": "index.js (3:5) @ Page
559+
> 3 | <table>
560+
| ^",
561+
"stack": [
562+
"table <anonymous> (0:0)",
563+
"Page index.js (3:5)",
564+
],
525565
}
526566
`)
527567
}
@@ -593,8 +633,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
593633
"description": "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:",
594634
"environmentLabel": null,
595635
"label": "Runtime Error",
596-
"source": null,
597-
"stack": [],
636+
"source": "index.js (8:22) @ Mismatch
637+
> 8 | {isClient && <main className="second" />}
638+
| ^",
639+
"stack": [
640+
"main <anonymous> (0:0)",
641+
"Mismatch index.js (8:22)",
642+
],
598643
}
599644
`)
600645
}
@@ -692,8 +737,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
692737
This will cause a hydration error.",
693738
"environmentLabel": null,
694739
"label": "Runtime Error",
695-
"source": null,
696-
"stack": [],
740+
"source": "index.js (4:7) @ Page
741+
> 4 | <p>Nested p tags</p>
742+
| ^",
743+
"stack": [
744+
"p <anonymous> (0:0)",
745+
"Page index.js (4:7)",
746+
],
697747
}
698748
`)
699749
}
@@ -764,8 +814,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
764814
This will cause a hydration error.",
765815
"environmentLabel": null,
766816
"label": "Runtime Error",
767-
"source": null,
768-
"stack": [],
817+
"source": "index.js (6:11) @ Page
818+
> 6 | <div>Nested div under p tag</div>
819+
| ^",
820+
"stack": [
821+
"div <anonymous> (0:0)",
822+
"Page index.js (6:11)",
823+
],
769824
}
770825
`)
771826
}
@@ -826,8 +881,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
826881
This will cause a hydration error.",
827882
"environmentLabel": null,
828883
"label": "Runtime Error",
829-
"source": null,
830-
"stack": [],
884+
"source": "index.js (2:15) @ Page
885+
> 2 | return <div><tr></tr></div>
886+
| ^",
887+
"stack": [
888+
"tr <anonymous> (0:0)",
889+
"Page index.js (2:15)",
890+
],
831891
}
832892
`)
833893
}
@@ -898,8 +958,13 @@ describe('Error overlay for hydration errors in Pages router', () => {
898958
This will cause a hydration error.",
899959
"environmentLabel": null,
900960
"label": "Runtime Error",
901-
"source": null,
902-
"stack": [],
961+
"source": "index.js (3:32) @ Page
962+
> 3 | <p><span><span><span><span><p>hello world</p></span></span></span></span></p>
963+
| ^",
964+
"stack": [
965+
"p <anonymous> (0:0)",
966+
"Page index.js (3:32)",
967+
],
903968
}
904969
`)
905970
}

Diff for: test/e2e/pages-performance-mark/pages/_document.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Html, Head, Main, NextScript } from 'next/document'
33
export default function Document() {
44
return (
55
<Html>
6-
<Head />
76
<Head />
87
<body>
98
<Main />

Diff for: test/production/custom-server/custom-server.test.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { nextTestSetup } from 'e2e-utils'
22

33
const isReact18 = parseInt(process.env.NEXT_TEST_REACT_VERSION) === 18
4-
// TODO(new-dev-overlay): Remove this once new dev overlay is stable
5-
const isExperimentalReact = Boolean(process.env.__NEXT_EXPERIMENTAL_PPR)
64

75
describe('custom server', () => {
86
const { next } = nextTestSetup({
@@ -25,19 +23,17 @@ describe('custom server', () => {
2523
})
2624

2725
describe('with app dir', () => {
28-
if (!isExperimentalReact) {
29-
it('should render app with react canary', async () => {
30-
const $ = await next.render$(`/1`)
31-
expect($('body').text()).toMatch(/app: .+-canary/)
32-
})
33-
}
26+
it('should render app with react canary', async () => {
27+
const $ = await next.render$(`/1`)
28+
expect($('body').text()).toMatch(/app: .+-canary/)
29+
})
3430

3531
it('should render pages with installed react', async () => {
3632
const $ = await next.render$(`/2`)
3733
if (isReact18) {
3834
expect($('body').text()).toMatch(/pages: 18\.\d+\.\d+\{/)
3935
} else {
40-
expect($('body').text()).toMatch(/pages: 19.0.0/)
36+
expect($('body').text()).toMatch(/pages: 19\.\d+\.\d+/)
4137
}
4238
})
4339
})

0 commit comments

Comments
 (0)