mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #520] [MERGED] Ignore @slot and _private dirs in metadata scan #641
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#641
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/520
Author: @NathanDrake2406
Created: 3/13/2026
Status: ✅ Merged
Merged: 3/13/2026
Merged by: @james-elicx
Base:
main← Head:fix/metadata-scan-ignore-private-slot-dirs📝 Commits (3)
d6bae05Ignore @slot and _private dirs in metadata scan40f629cDisambiguate metadata routes under invisible segmentsc47142dExclude @children from metadata suffixing📊 Changes
2 files changed (+74 additions, -9 deletions)
View changed files
📝
packages/vinext/src/server/metadata-routes.ts(+39 -6)📝
tests/metadata-routes.test.ts(+35 -3)📄 Description
Summary
This keeps
scanMetadataFiles()aligned with the app router's URL semantics. Metadata under parallel route slots no longer leaks@slotinto public URLs, and metadata inside_privatefolders is ignored entirely.What Changed
_privatedirectories while scanning metadata files@slotdirectories like route groups for URL constructiontests/metadata-routes.test.tsWhy It Matters
The app router already treats
_privatefolders as non-routable and@slotsegments as invisible in URL space. Metadata scanning had drifted from that behavior and could emit invalid routes like/_private/iconand/@modal/icon.Risks Or Limits
This only changes metadata directory traversal. Metadata file matching and dynamic-vs-static precedence are unchanged.
Verification
pnpm test tests/metadata-routes.test.tspnpm test tests/app-router.test.ts -t "scanMetadataFiles"Closes #519
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.