mirror of
https://github.com/cloudflare/vinext.git
synced 2026-09-14 19:04:59 +08:00
fix(interception): address codex review issues in sibling intercept implementation
- Pass effectiveParams to resolveAppPageHead so generateMetadata/generateViewport sees the intercepted route's params instead of the source route's params - Rename SIBLING_INTERCEPT_SLOT_NAME from __page to __vinext_sibling_intercept to prevent collision with a user @__page parallel route directory - Restore middleware-rewrite fixture link without locale prefix so the interception-dynamic-segment-middleware spec exercises the intended middleware rewrite path
This commit is contained in:
@@ -367,7 +367,7 @@ function createAppRouteGraphDefaultId(slotId: string): string {
|
||||
return `default:${slotId}`;
|
||||
}
|
||||
|
||||
const SIBLING_INTERCEPT_SLOT_NAME = "__page";
|
||||
const SIBLING_INTERCEPT_SLOT_NAME = "__vinext_sibling_intercept";
|
||||
function createAppRouteGraphSiblingInterceptSlotId(sourcePattern: string): string {
|
||||
return createAppRouteGraphSlotId(SIBLING_INTERCEPT_SLOT_NAME, sourcePattern);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ export async function buildPageElements<
|
||||
routeSegments: route.routeSegments ?? [],
|
||||
slots: route.slots ?? null,
|
||||
}),
|
||||
params,
|
||||
params: effectiveParams,
|
||||
routePath: route.pattern,
|
||||
routeSegments: route.routeSegments ?? null,
|
||||
searchParams,
|
||||
|
||||
@@ -4,7 +4,9 @@ export default async function Page({ params }: { params: Promise<{ locale: strin
|
||||
const { locale } = await params;
|
||||
return (
|
||||
<div>
|
||||
<Link href={`/interception-mw/${locale}/foo/p/1`} id="link-foo-p-1">
|
||||
{/* Link without locale — middleware rewrites /interception-mw/foo/p/1
|
||||
to /interception-mw/en/foo/p/1 so interception fires */}
|
||||
<Link href="/interception-mw/foo/p/1" id="link-foo-p-1">
|
||||
Foo
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user