Skip to content

Commit 83e5867

Browse files
authored
Merge branch 'canary' into fix-beforeInteractive-incorrectly-render-css
2 parents b88cf0a + 899d993 commit 83e5867

File tree

4 files changed

+65
-8
lines changed

4 files changed

+65
-8
lines changed

packages/next/src/server/lib/router-utils/resolve-routes.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ export function getResolveRoutes(
423423
// base path.
424424
if (updated) {
425425
if (hadBasePath) {
426-
normalized = path.posix.join(config.basePath, normalized)
426+
normalized =
427+
normalized === '/'
428+
? config.basePath
429+
: path.posix.join(config.basePath, normalized)
427430
}
428431

429432
// Re-add the trailing slash (if required).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Link from 'next/link'
2+
3+
export default function Other() {
4+
return (
5+
<div>
6+
<h1>Other page</h1>
7+
<Link href="/" id="go-to-home">
8+
Go to home
9+
</Link>
10+
</div>
11+
)
12+
}

test/e2e/middleware-base-path/test/index.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('Middleware base tests', () => {
3535
const $ = cheerio.load(html)
3636
expect($('.title').text()).toBe('About Page')
3737
})
38+
3839
it('router.query must exist when Link clicked page routing', async () => {
3940
const browser = await webdriver(next.url, '/root')
4041
try {
@@ -45,4 +46,15 @@ describe('Middleware base tests', () => {
4546
await browser.close()
4647
}
4748
})
49+
50+
it('should allow client-side navigation to the root', async () => {
51+
const browser = await webdriver(next.url, '/root/other')
52+
try {
53+
await browser.elementById('go-to-home').click()
54+
const title = await browser.waitForElementByCss('.title').text()
55+
expect(title).toMatch('Hello World')
56+
} finally {
57+
await browser.close()
58+
}
59+
})
4860
})

test/rspack-dev-tests-manifest.json

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,25 @@
12811281
"flakey": [],
12821282
"runtimeError": false
12831283
},
1284+
"packages/next/src/server/lib/source-maps.test.ts": {
1285+
"passed": [
1286+
"does not hide sandwiches without a lid",
1287+
"does not ignore list anonymous frames by default",
1288+
"does not ignore list anonymous frames that are not likely JS native methods",
1289+
"does not ignore list anonymous frames where the bottom is shown",
1290+
"does not ignore list if bottom is not ignore-listed",
1291+
"does not ignore list if bottom is unknown",
1292+
"does not ignore list if top is not ignore-listed",
1293+
"does not ignore list if top is unknown",
1294+
"hides big macs",
1295+
"hides big sandwiches",
1296+
"hides small sandwiches"
1297+
],
1298+
"failed": [],
1299+
"pending": [],
1300+
"flakey": [],
1301+
"runtimeError": false
1302+
},
12841303
"packages/next/src/server/lib/to-route.test.ts": {
12851304
"passed": [
12861305
"toRoute Function should remove trailing `/index`",
@@ -1895,9 +1914,12 @@
18951914
"ReactRefreshLogBox app Call stack for client error",
18961915
"ReactRefreshLogBox app Call stack for server error",
18971916
"ReactRefreshLogBox app Server component errors should open up in fullscreen",
1917+
"ReactRefreshLogBox app Should not show __webpack_exports__ when exporting anonymous arrow function",
18981918
"ReactRefreshLogBox app Should show error location for server actions in client component",
18991919
"ReactRefreshLogBox app Should show error location for server actions in server component",
1920+
"ReactRefreshLogBox app Unhandled errors and rejections opens up in the minimized state",
19001921
"ReactRefreshLogBox app boundaries",
1922+
"ReactRefreshLogBox app conversion to class component (1)",
19011923
"ReactRefreshLogBox app logbox: anchors links in error messages",
19021924
"ReactRefreshLogBox app should hide unrelated frames in stack trace with nodejs internal calls",
19031925
"ReactRefreshLogBox app should hide unrelated frames in stack trace with unknown anonymous calls",
@@ -1906,9 +1928,6 @@
19061928
"failed": [
19071929
"ReactRefreshLogBox app Can't resolve @import in CSS file",
19081930
"ReactRefreshLogBox app Import trace when module not found in layout",
1909-
"ReactRefreshLogBox app Should not show __webpack_exports__ when exporting anonymous arrow function",
1910-
"ReactRefreshLogBox app Unhandled errors and rejections opens up in the minimized state",
1911-
"ReactRefreshLogBox app conversion to class component (1)",
19121931
"ReactRefreshLogBox app css syntax errors",
19131932
"ReactRefreshLogBox app module init error not shown",
19141933
"ReactRefreshLogBox app server component can recover from error thrown in the module",
@@ -2023,16 +2042,16 @@
20232042
"test/development/acceptance-app/error-recovery.test.ts": {
20242043
"passed": [
20252044
"Error recovery app can recover from a event handler error",
2026-
"Error recovery app server component can recover from a component error"
2045+
"Error recovery app client component can recover from a component error",
2046+
"Error recovery app server component can recover from a component error",
2047+
"Error recovery app stuck error"
20272048
],
20282049
"failed": [
20292050
"Error recovery app can recover from a syntax error without losing state",
2030-
"Error recovery app client component can recover from a component error",
20312051
"Error recovery app client component can recover from syntax error",
20322052
"Error recovery app displays build error on initial page load",
20332053
"Error recovery app render error not shown right after syntax error",
20342054
"Error recovery app server component can recover from syntax error",
2035-
"Error recovery app stuck error",
20362055
"Error recovery app syntax > runtime error"
20372056
],
20382057
"pending": [],
@@ -2753,6 +2772,7 @@
27532772
"segment-explorer should handle show file segments in order",
27542773
"segment-explorer should handle special built-in not-found segments",
27552774
"segment-explorer should indicate segment explorer is not available for pages router",
2775+
"segment-explorer should render route for index page",
27562776
"segment-explorer should render the segment explorer for nested routes",
27572777
"segment-explorer should render the segment explorer for parallel routes",
27582778
"segment-explorer should render the segment explorer for parallel routes in edge runtime",
@@ -6157,6 +6177,13 @@
61576177
"flakey": [],
61586178
"runtimeError": false
61596179
},
6180+
"test/e2e/app-dir/dynamic-io/dynamic-io.console.test.ts": {
6181+
"passed": ["dynamic-io dims console calls during prospective rendering"],
6182+
"failed": [],
6183+
"pending": [],
6184+
"flakey": [],
6185+
"runtimeError": false
6186+
},
61606187
"test/e2e/app-dir/dynamic-io/dynamic-io.cookies.test.ts": {
61616188
"passed": [
61626189
"dynamic-io should be able to access cookie properties",
@@ -6305,6 +6332,7 @@
63056332
"dynamic-io should fully prerender pages that use `unstable_noStore()`",
63066333
"dynamic-io should not have route specific errors",
63076334
"dynamic-io should not log not-found errors",
6335+
"dynamic-io should not resume when client components are dynamic but the RSC render was static",
63086336
"dynamic-io should partially prerender pages that do any uncached IO",
63096337
"dynamic-io should partially prerender pages that do any uncached IO (use cache)",
63106338
"dynamic-io should partially prerender pages that take longer than a task to render",
@@ -6474,10 +6502,10 @@
64746502
"test/e2e/app-dir/error-on-next-codemod-comment/error-on-next-codemod-comment.test.ts": {
64756503
"passed": [
64766504
"app-dir - error-on-next-codemod-comment should disappear the error when you replace with bypass comment",
6505+
"app-dir - error-on-next-codemod-comment should disappear the error when you rre the codemod comment",
64776506
"app-dir - error-on-next-codemod-comment should error with inline comment as well"
64786507
],
64796508
"failed": [
6480-
"app-dir - error-on-next-codemod-comment should disappear the error when you rre the codemod comment",
64816509
"app-dir - error-on-next-codemod-comment should error with swc if you have codemod comments left"
64826510
],
64836511
"pending": [],
@@ -9517,13 +9545,15 @@
95179545
"test/e2e/app-dir/server-source-maps/server-source-maps.test.ts": {
95189546
"passed": [
95199547
"app-dir - server source maps handles invalid sourcemaps gracefully",
9548+
"app-dir - server source maps ignore-lists anonymous ssr stack frame sandwiches",
95209549
"app-dir - server source maps logged errors have a sourcemapped `cause`",
95219550
"app-dir - server source maps logged errors have a sourcemapped stack with a codeframe",
95229551
"app-dir - server source maps logged errors preserve their name",
95239552
"app-dir - server source maps stack frames are ignore-listed in ssr",
95249553
"app-dir - server source maps thrown SSR errors"
95259554
],
95269555
"failed": [
9556+
"app-dir - server source maps ignore-lists anonymous rsc stack frame sandwiches",
95279557
"app-dir - server source maps sourcemaps errors during module evaluation",
95289558
"app-dir - server source maps stack frames are ignore-listed in rsc"
95299559
],

0 commit comments

Comments
 (0)