mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #806] Shim next/root-params module with runtime getters #178
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#178
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?
Originally created by @github-actions[bot] on GitHub (Apr 9, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/806
Summary
Next.js added generated type definitions for
next/root-params, which provides runtime getter functions for root layout parameters. The module already existed at runtime but now has build-time type generation that produces aroot-params.d.tsfile under.next/types.Upstream
github.com/vercel/next.js@46e2114ea2What changed
next/root-paramsexports async getter functions (e.g.,lang(),locale()) for each root param discovered from App Router root layouts.next/types/root-params.d.tsis produced duringnext build,next dev, andnext typegenstring,string[], orundefineddepending on whether they're optional, catch-all, or missing from some rootsexperimental.rootParamsorcacheComponentsis truenext-env.d.tsvia an ESM importImpact on vinext
vinext needs to:
next/root-paramsto the shim map inresolveIdso imports resolve correctlyapp/directories for routing, it can detect root layout params and generate the appropriate getter functionsnext-env.d.tsequivalentThis is primarily relevant for App Router apps that use root-level dynamic segments (e.g.,
app/[lang]/layout.tsx). The runtime behavior is the higher priority; type generation can follow later.