-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[next] fix re-mapping logic for index prefetches (#10750)
Follow-up to #10734 -- but considers that the static prefetch associated with `/` might be inside of a dir such as `index/index.prefetch.rsc`. To avoid any future matching conflicts, this PR updates to prefix all static prefetches
- Loading branch information
Showing
7 changed files
with
148 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@vercel/next": patch | ||
--- | ||
|
||
fix re-mapping logic for index prefetches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 16 additions & 7 deletions
23
packages/next/test/fixtures/00-app-dir-root-catch-all/app/[[...slug]]/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,27 @@ | ||
import Link from 'next/link'; | ||
|
||
export default function Page(props) { | ||
return ( | ||
<p>catch-all {JSON.stringify(props.params || {})}</p> | ||
) | ||
<div> | ||
<p>catch-all {JSON.stringify(props.params || {})}</p> | ||
<Link href="/">Link to /</Link> | ||
<Link href="/index">Link to /index</Link> | ||
</div> | ||
); | ||
} | ||
|
||
export function generateStaticParams() { | ||
return [ | ||
{ | ||
slug: [''] | ||
slug: [''], | ||
}, | ||
{ | ||
slug: ['index'], | ||
}, | ||
{ | ||
slug: ['first'] | ||
} | ||
] | ||
slug: ['first'], | ||
}, | ||
]; | ||
} | ||
|
||
export const revalidate = 0 | ||
export const revalidate = 0; |
27 changes: 27 additions & 0 deletions
27
packages/next/test/fixtures/00-app-dir-root-catch-all/app/nested/[[...slug]]/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Link from 'next/link'; | ||
|
||
export default function Page(props) { | ||
return ( | ||
<div> | ||
<p>catch-all {JSON.stringify(props.params || {})}</p> | ||
<Link href="/nested">Link to /</Link> | ||
<Link href="/nested/index">Link to /index</Link> | ||
</div> | ||
); | ||
} | ||
|
||
export function generateStaticParams() { | ||
return [ | ||
{ | ||
slug: [''], | ||
}, | ||
{ | ||
slug: ['index'], | ||
}, | ||
{ | ||
slug: ['first'], | ||
}, | ||
]; | ||
} | ||
|
||
export const revalidate = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters