-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(router-generator): handle deep multi-level non-nested paths with experimental non-nested paths #5779
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
WalkthroughAdds a multi-level "/non-nested/deep" route subtree for React and Solid E2E suites, new route files and tests, generator updates to track and propagate Changes
Sequence Diagram(s)sequenceDiagram
participant FS as Filesystem Scanner
participant Gen as Router Generator
participant Utils as Parent Matcher (hasParentRoute)
participant Tree as Generated Route Tree
FS->>Gen: collect route files
Gen->>Gen: derive routePath and originalRoutePath
Gen->>Utils: hasParentRoute(routes, node, routePath, originalRoutePath)
Utils->>Gen: parentRoute (uses originalRoutePath checks for non-nested)
Gen->>Tree: assemble route nodes into routeTree with originalRoutePath metadata
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Comment |
|
View your CI Pipeline Execution ↗ for commit e9c55a0
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter
@tanstack/directive-functions-plugin
@tanstack/eslint-plugin-router
@tanstack/history
@tanstack/nitro-v2-vite-plugin
@tanstack/react-router
@tanstack/react-router-devtools
@tanstack/react-router-ssr-query
@tanstack/react-start
@tanstack/react-start-client
@tanstack/react-start-server
@tanstack/router-cli
@tanstack/router-core
@tanstack/router-devtools
@tanstack/router-devtools-core
@tanstack/router-generator
@tanstack/router-plugin
@tanstack/router-ssr-query-core
@tanstack/router-utils
@tanstack/router-vite-plugin
@tanstack/server-functions-plugin
@tanstack/solid-router
@tanstack/solid-router-devtools
@tanstack/solid-router-ssr-query
@tanstack/solid-start
@tanstack/solid-start-client
@tanstack/solid-start-server
@tanstack/start-client-core
@tanstack/start-plugin-core
@tanstack/start-server-core
@tanstack/start-static-server-functions
@tanstack/start-storage-context
@tanstack/valibot-adapter
@tanstack/virtual-file-routes
@tanstack/zod-adapter
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/router-generator/tests/generator/nested-verboseFileRoutes-true/routes/blog_/$blogId/$slug_/bar.tsx (1)
1-4: Add blank line after import for consistency.The ESLint warning is valid. Other files in this directory (e.g.,
edit.tsx) include a blank line after the import statement, maintaining consistency with common style conventions.Apply this diff:
import { createFileRoute } from '@tanstack/react-router' + export const Route = createFileRoute('/blog_/$blogId/$slug_/bar')({
This resolves #5751
with the experimentalNonNested paths there is a regression when dealing with deep multi-level non-nested paths for example
/posts_/$postId_/editor/posts/$postId/detail_/edit.This PR resolves this regression and adds unit tests to router-generator to test for this going forward as well as e2e tests in react and solid to ensure changes replicate correctly to route matching.
Summary by CodeRabbit
New Features
Tests