-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(router-generator): respect explicit virtual route siblings #6458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 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
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.