fix(router-generator): respect explicit virtual route siblings#6458
Merged
schiller-manuel merged 1 commit intomainfrom Jan 22, 2026
Merged
fix(router-generator): respect explicit virtual route siblings#6458schiller-manuel merged 1 commit intomainfrom
schiller-manuel merged 1 commit intomainfrom
Conversation
Contributor
📝 WalkthroughWalkthroughThe PR records explicit virtual parent paths on route nodes during flattening and updates the generator to prefer those explicit parents when resolving parent-child relationships, preventing path-prefix auto-nesting for routes declared as siblings in virtual configs. Changes
Sequence Diagram(s)sequenceDiagram
participant Config as Virtual Config
participant FS as getRouteNodes.flattenTree
participant Generator as generator.handleNode
participant Map as routeNodesByPath / prefixMap
Config->>FS: produce virtual node tree
FS->>FS: flattenTree(node, parentRoutePath)\nset node._virtualParentRoutePath (non-root)
FS->>Generator: emit node list (with _virtualParentRoutePath)
Generator->>Map: lookup node._virtualParentRoutePath in routeNodesByPath
alt found in routeNodesByPath
Map-->>Generator: parentRoute from routeNodesByPath
else not found
Map->>Map: fallback lookup via prefixMap
Map-->>Generator: parentRoute from prefixMap
end
Generator->>Generator: assign node.parent and compute downstream paths
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
|
View your CI Pipeline Execution ↗ for commit b048734
☁️ Nx Cloud last updated this comment at |
9ec88bb to
479d556
Compare
479d556 to
b048734
Compare
naoya7076
pushed a commit
to naoya7076/router
that referenced
this pull request
Feb 15, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserve virtual-config parentage during flattening and prefer it during parent resolution so sibling routes like /posts and /posts/$id stay siblings
fixes #5822
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.