mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #735] feat(prerender): support layout-level generateStaticParams #806
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#806
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/735
Author: @raed04
Created: 4/1/2026
Status: 🔄 Open
Base:
main← Head:feat/layout-generate-static-params-567📝 Commits (1)
a4e39dafeat(prerender): support layout-level generateStaticParams (#567)📊 Changes
4 files changed (+221 additions, -100 deletions)
View changed files
📝
packages/vinext/src/build/prerender.ts(+13 -17)📝
packages/vinext/src/entries/app-rsc-entry.ts(+65 -12)📝
tests/__snapshots__/entry-templates.test.ts.snap(+0 -30)📝
tests/prerender.test.ts(+143 -41)📄 Description
Summary
Closes #567
Layout files at dynamic segments (e.g.
app/[category]/layout.tsx) can exportgenerateStaticParamsto provide parent params for nested child routes. Previously only page-level exports were scanned, silently skipping layout-only dynamic segments.generateStaticParamsMapcode-gen to emit layout-level entries by walking each route'slayouts[]andlayoutTreePositions[], with deduplication and page-entry priorityrouteIndexguard inresolveParentParams— checkstaticParamsMapdirectly so layout-only prefixes are resolved[]decodeRouteSegmentfor static segments to matchconvertSegmentsToRoutePartsbehaviorrouteIndexparameter and Map construction fromprerenderAppresolveParentParamstests covering layout-only parents, mixed page/layout, null pass-through, catch-all parents, error propagation, and three-level nestingChanged files
packages/vinext/src/entries/app-rsc-entry.tsgenerateStaticParamsMap: page entries then layout entriespackages/vinext/src/build/prerender.tsresolveParentParamssimplified signature, null pass-through fixtests/__snapshots__/entry-templates.test.ts.snaptests/prerender.test.tsrouteIndexFromhelperTest plan
resolveParentParamsunit tests passentry-templatessnapshot tests passvp checkpasses on all changed files (lint + types + format)generateStaticParams🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.