forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable static generation on interception routes (vercel#61004)
### What & Why? Interception routes depend on contextual information that are provided via request headers. Specifically it needs to know about the `Next-Router-State-Tree` when generating the interception route RSC data, which isn't available at build time. This doesn't currently cause any usage issues, but it erroneously emits static files & RSC payloads that the client router won't be able to use and will instead fallback to a dynamic request. I removed some special case in an existing test since this fix also resolves a discrepancy in behavior when PPR is turned on ### How? This excludes interception routes from `appStaticPaths` at builds which currently determines which pages should be statically generated. Closes NEXT-2190
- Loading branch information
Showing
9 changed files
with
108 additions
and
46 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
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
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/interception-route-prefetch-cache/app/baz/@modal/(.)modal/page.tsx
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,3 @@ | ||
export default function Page() { | ||
return <div>Interception Modal</div> | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/interception-route-prefetch-cache/app/baz/@modal/default.tsx
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,3 @@ | ||
export default function Page() { | ||
return null | ||
} |
8 changes: 8 additions & 0 deletions
8
test/e2e/app-dir/interception-route-prefetch-cache/app/baz/layout.tsx
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,8 @@ | ||
export default function Layout(props) { | ||
return ( | ||
<> | ||
<div>{props.children}</div> | ||
<div>{props.modal}</div> | ||
</> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/interception-route-prefetch-cache/app/baz/modal/page.tsx
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,3 @@ | ||
export default function Page() { | ||
return <div>Modal Page</div> | ||
} |
9 changes: 9 additions & 0 deletions
9
test/e2e/app-dir/interception-route-prefetch-cache/app/baz/page.tsx
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,9 @@ | ||
import Link from 'next/link' | ||
|
||
export default function Page() { | ||
return ( | ||
<div> | ||
<Link href="/baz/modal">Open Interception Modal</Link> | ||
</div> | ||
) | ||
} |
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