-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: generator improvements #6296
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
📝 WalkthroughWalkthroughAdds a single-argument overload for physical() to mount a directory at the current level (empty path prefix), documents the behavior, enhances a generator warning message, and adds multiple tests and snapshots covering merge and conflict scenarios. Changes
Sequence Diagram(s)(omitted — changes are API/tests/docs and do not introduce a multi-component sequential control flow requiring a diagram) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
Comment |
|
View your CI Pipeline Execution ↗ for commit a7a226f
☁️ Nx Cloud last updated this comment at |
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: 2
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (29)
docs/router/framework/react/routing/virtual-file-routes.mdpackages/router-generator/src/generator.tspackages/router-generator/tests/generator.test.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/tsr.config.jsonpackages/virtual-file-routes/src/api.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/src/generator.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsxpackages/router-generator/tests/generator.test.tspackages/virtual-file-routes/src/api.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/src/generator.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsxpackages/router-generator/tests/generator.test.tspackages/virtual-file-routes/src/api.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
docs/**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Use relative links to
docs/folder format (e.g.,./guide/data-loading) for internal documentation references
Files:
docs/router/framework/react/routing/virtual-file-routes.md
🧠 Learnings (10)
📓 Common learnings
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6120
File: packages/router-generator/src/generator.ts:654-657
Timestamp: 2025-12-17T02:17:55.086Z
Learning: In `packages/router-generator/src/generator.ts`, pathless_layout routes must receive a `path` property when they have a `cleanedPath`, even though they are non-path routes. This is necessary because child routes inherit the path from their parent, and without this property, child routes would not have the correct full path at runtime.
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/src/generator.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsxdocs/router/framework/react/routing/virtual-file-routes.mdpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsxpackages/router-generator/tests/generator.test.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
📚 Learning: 2025-12-17T02:17:55.086Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6120
File: packages/router-generator/src/generator.ts:654-657
Timestamp: 2025-12-17T02:17:55.086Z
Learning: In `packages/router-generator/src/generator.ts`, pathless_layout routes must receive a `path` property when they have a `cleanedPath`, even though they are non-path routes. This is necessary because child routes inherit the path from their parent, and without this property, child routes would not have the correct full path at runtime.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsxdocs/router/framework/react/routing/virtual-file-routes.mdpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsxpackages/router-generator/tests/generator.test.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/src/generator.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/tsr.config.jsonpackages/router-generator/tests/generator.test.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/src/generator.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/tsr.config.jsonpackages/router-generator/tests/generator.test.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/tsr.config.jsonpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Use file-based routing in `src/routes/` directories or code-based routing with route definitions
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxdocs/router/framework/react/routing/virtual-file-routes.mdpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
📚 Learning: 2025-12-17T02:17:47.423Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6120
File: packages/router-generator/src/generator.ts:654-657
Timestamp: 2025-12-17T02:17:47.423Z
Learning: In packages/router-generator/src/generator.ts, enforce that pathless_layout routes with a cleanedPath must have a path property. This is required because child routes inherit the parent's path; without a path property, the full path will not resolve correctly at runtime. Update the route type/validation to require path for such routes and add tests ensuring that a pathless_layout with cleanedPath provides a valid fullPath resolution.
Applied to files:
packages/router-generator/src/generator.ts
📚 Learning: 2025-12-21T12:52:35.231Z
Learnt from: Sheraff
Repo: TanStack/router PR: 6171
File: packages/router-core/src/new-process-route-tree.ts:898-898
Timestamp: 2025-12-21T12:52:35.231Z
Learning: In `packages/router-core/src/new-process-route-tree.ts`, the matching logic intentionally allows paths without trailing slashes to match index routes with trailing slashes (e.g., `/a` can match `/a/` route), but not vice-versa (e.g., `/a/` cannot match `/a` layout route). This is implemented via the condition `!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX` and is a deliberate design decision to provide better UX by being permissive with missing trailing slashes.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.tspackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsxdocs/router/framework/react/routing/virtual-file-routes.mdpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsxpackages/router-generator/tests/generator.test.tspackages/virtual-file-routes/src/api.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
📚 Learning: 2025-10-14T18:59:33.990Z
Learnt from: FatahChan
Repo: TanStack/router PR: 5475
File: e2e/react-start/basic-prerendering/src/routes/redirect/$target/via-beforeLoad.tsx:8-0
Timestamp: 2025-10-14T18:59:33.990Z
Learning: In TanStack Router e2e test files, when a route parameter is validated at the route level (e.g., using zod in validateSearch or param validation), switch statements on that parameter do not require a default case, as the validation ensures only expected values will reach the switch.
Applied to files:
packages/router-generator/tests/generator.test.ts
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.tspackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts
🧬 Code graph analysis (11)
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsx (2)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsx (1)
Route(4-6)packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsx (1)
Route(3-5)
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.ts (1)
packages/virtual-file-routes/src/api.ts (3)
rootRoute(10-19)route(66-84)physical(100-118)
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsx (1)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsx (1)
Route(4-6)
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsx (2)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsx (1)
Route(3-5)packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsx (1)
Route(3-5)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsx (2)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsx (1)
Route(3-5)packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsx (1)
Route(3-5)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.ts (1)
packages/virtual-file-routes/src/api.ts (3)
rootRoute(10-19)route(66-84)physical(100-118)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsx (1)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsx (1)
Route(4-6)
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes.ts (4)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.ts (1)
routes(5-5)packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.ts (1)
routes(5-8)packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.ts (1)
routes(3-8)packages/virtual-file-routes/src/api.ts (3)
rootRoute(10-19)route(66-84)physical(100-118)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsx (4)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsx (1)
Route(3-5)packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsx (1)
Route(3-5)packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsx (1)
Route(2-2)packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsx (1)
Route(3-5)
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsx (3)
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsx (1)
Route(3-5)packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsx (1)
Route(3-5)packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsx (1)
Route(3-5)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.ts (4)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.ts (1)
routes(5-8)packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.ts (1)
routes(3-8)packages/router-generator/tests/generator/virtual-physical-no-prefix/routes.ts (1)
routes(5-8)packages/virtual-file-routes/src/api.ts (2)
rootRoute(10-19)physical(100-118)
🪛 markdownlint-cli2 (0.18.1)
docs/router/framework/react/routing/virtual-file-routes.md
233-233: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ 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)
- GitHub Check: Test
- GitHub Check: Preview
🔇 Additional comments (29)
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/about.tsx (1)
1-2: LGTM! Minimal route definition for testing.The route definition is valid. The absence of a component is acceptable for test fixtures that focus on route structure rather than rendering behavior.
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/index.tsx (1)
1-2: LGTM! Index route for merge testing.The route definition correctly uses '/' for an index route. In the context of virtual-physical empty-path merging, the generator will handle path resolution appropriately.
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/__root.tsx (1)
1-5: LGTM! Complete root route implementation.The root route is properly implemented with all necessary imports and a standard component that renders an
Outletfor child routes.packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/__root.tsx (1)
1-5: LGTM! Complete root route implementation.The root route is properly implemented with all necessary imports and follows the standard pattern for test fixtures in this suite.
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/merged/contact.tsx (1)
1-2: LGTM! Clean test fixture for route merging.This test file correctly defines a
/contactroute using the standard TanStack Router pattern. It will help verify that physical directory merging works as expected in the test scenario.packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/index.tsx (1)
1-5: LGTM! Appropriate test fixture for conflict scenarios.This index route correctly creates a root-level route that will be used to test conflict detection when merging physical directories at the root level. The simple component implementation is appropriate for testing purposes.
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/index.tsx (1)
1-5: LGTM! Consistent test fixture for virtual conflict testing.This test fixture follows the same pattern as the root conflict scenario and correctly sets up a route to test conflict detection between virtual and physical routes. The implementation is clean and appropriate for its testing purpose.
packages/router-generator/src/generator.ts (1)
1093-1108: Excellent improvement to developer experience!The enhanced warning message is much more helpful than the previous version. It provides:
- Clear identification of the problematic file
- Two concrete options for excluding the file
- Current configuration values for reference
- Specific suggested filename with the ignore prefix
The implementation uses
path.basename,path.dirname, andpath.joincorrectly for cross-platform compatibility. This will significantly reduce confusion when developers have non-route files in their routes directory.packages/virtual-file-routes/src/api.ts (1)
86-117: Well-implemented function overloading with clear documentation!This enhancement elegantly adds support for single-argument usage while maintaining backward compatibility. The implementation correctly:
- Provides clear JSDoc for both overload variants
- Uses the presence/absence of the second parameter to distinguish between cases
- Sets
pathPrefix: ''for single-argument calls (merging at current level)- Preserves the original two-argument behavior
- Maintains type safety through proper overload signatures
The single-argument form
physical('dir')is a nice convenience for the common case of merging routes at the current level, which aligns perfectly with the PR objectives.packages/router-generator/tests/generator/virtual-physical-no-prefix/routes.ts (1)
1-8: LGTM!This test file correctly exercises the new single-argument
physical()overload that merges physical routes at the current level (with an empty path prefix). The structure follows the established pattern seen in related test fixtures, and the inline comments clearly document the test's intent.packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routeTree.snapshot.ts (1)
1-95: Snapshot file - no review needed.Based on learnings, test snapshot files in the router-generator tests directory are fixtures used to verify the generator's output and should be preserved as-is.
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/tsr.config.json (1)
1-5: LGTM!Standard test configuration file with appropriate paths for the virtual-physical conflict scenario.
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/__root.tsx (1)
1-5: LGTM!Minimal root route fixture following the established pattern for test scenarios. The
createRootRouteusage with anOutletcomponent is correct and idiomatic.packages/router-generator/tests/generator/virtual-physical-empty-path-merge/tsr.config.json (1)
1-5: LGTM!Standard test configuration for the virtual-physical empty path merge scenario.
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/tsr.config.json (1)
1-5: LGTM!Standard test configuration for the virtual-physical empty path root conflict scenario.
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/contact.tsx (1)
1-5: LGTM!This route file follows the established pattern for file-based routes in the test fixtures. The
createFileRoute('/contact')usage is consistent with sibling routes (about.tsx,index.tsx) in the same test directory.packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/merged/index.tsx (1)
1-5: LGTM! Test fixture correctly defines index route.The file follows TanStack Router conventions for file-based routing. The index route at '/' with a minimal component is appropriate for testing the virtual-physical merge scenario.
packages/router-generator/tests/generator/virtual-physical-no-prefix/routes/about.tsx (1)
1-5: LGTM! Test fixture correctly defines about route.The route definition follows framework conventions. The '/about' route with a minimal component is appropriate for testing virtual-physical routing scenarios without prefix conflicts.
packages/router-generator/tests/generator/virtual-physical-no-prefix/tsr.config.json (1)
1-5: LGTM! Test configuration is properly structured.The configuration correctly specifies the routes directory, generated route tree output, and virtual route config file paths for the no-prefix merge test scenario.
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/about.tsx (1)
1-6: LGTM! Conflict test fixture is correctly designed.The virtual route intentionally conflicts with the physical route at
merged/about.tsxto test the generator's conflict detection capabilities. The comment clearly documents this, and the "(virtual)" label in the component helps distinguish between the two routes during testing.packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsx (1)
1-5: LGTM! Root conflict test fixture is correctly designed.The physical root route (defined with empty string path) intentionally conflicts with the virtual
__root.tsxto test the generator's ability to detect conflicting root routes. The comments clearly document this test scenario.packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes.ts (1)
1-5: LGTM! Clear test case for root-level conflict detection.This test fixture correctly sets up a scenario where a physical directory containing
__root.tsxis mounted at the root level, creating a conflict with the virtual root. The comment clearly explains the expected behavior.docs/router/framework/react/routing/virtual-file-routes.md (1)
227-263: Excellent documentation for the new merging feature.The section clearly explains the merging behavior, provides practical examples, and appropriately warns users about potential conflicts. The code examples demonstrate both the single-argument and two-argument forms of the
physical()API.packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes.ts (1)
1-8: LGTM! Clear test case for successful merge scenario.This test fixture correctly demonstrates the happy path where physical routes are merged at the root level without conflicts. The inline comments effectively explain the intended behavior.
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes/merged/about.tsx (1)
1-6: LGTM! Well-structured test fixture for conflict detection.This physical route definition correctly sets up a conflict scenario with a virtual route at the same path. The component text clearly distinguishes it as the physical version for test verification purposes.
packages/router-generator/tests/generator.test.ts (2)
107-118: LGTM! Test configurations properly set up for new scenarios.The four new test case branches correctly configure the virtual route system for testing physical route merging and conflict detection. Each scenario appropriately points to its respective
./routes.tsconfiguration file.
258-263: LGTM! Clear error messages for conflict scenarios.The expected error messages correctly identify the conflicting route paths for both the root-level conflict and the virtual route conflict. The format is consistent with the existing
duplicate-fullPatherror message pattern.packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-virtual/routes.ts (1)
1-8: Well-structured conflict test case.The test clearly documents its purpose and correctly uses the
physical('', 'merged')API to trigger a conflict between the virtual/aboutroute and the physicalmerged/about.tsxthat would resolve to the same path.packages/router-generator/tests/generator/virtual-physical-no-prefix/routeTree.snapshot.ts (1)
1-95: Snapshot file acknowledged.Based on learnings, this is a test snapshot fixture used to verify the generator's output for the virtual-physical-no-prefix scenario. The generated route tree correctly reflects three routes (/, /about, /contact) merged from physical routes without a path prefix.
| ``` | ||
| /routes | ||
| ├── __root.tsx | ||
| ├── about.tsx | ||
| └── features | ||
| ├── index.tsx | ||
| └── contact.tsx | ||
| ``` | ||
|
|
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.
Specify language identifier for fenced code block.
The fenced code block showing the file structure should have a language identifier for better rendering and accessibility.
🔎 Proposed fix
-```
+```text
/routes
├── __root.tsx
├── about.tsx
└── features
├── index.tsx
└── contact.tsx
</details>
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>
233-233: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
In docs/router/framework/react/routing/virtual-file-routes.md around lines 233
to 241, the fenced code block showing the file structure lacks a language
identifier; update the opening fence to include a language (e.g., use ```text)
so the block is rendered correctly and improves accessibility/semantics in docs.
</details>
<!-- fingerprinting:phantom:poseidon:puma -->
<!-- This is an auto-generated comment by CodeRabbit -->
packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsx
Show resolved
Hide resolved
d2637ac to
a7a226f
Compare
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: 0
🧹 Nitpick comments (1)
packages/router-generator/src/generator.ts (1)
1093-1108: Enhanced warning message improves developer experience.The detailed warning with configuration guidance and suggested fixes is a valuable improvement. The
routeFileIgnorePrefixproperty has a guaranteed default value of'-'defined in the config schema, so there is no risk of undefined values appearing in the suggested file name. The code is correct and safe.Consider using a single template literal for the message construction for improved readability:
- let message = `Warning: Route file "${node.fullPath}" does not export a Route. This file will not be included in the route tree.` - message += `\n\nIf this file is not intended to be a route, you can exclude it using one of these options:` - message += `\n 1. Rename the file to "${suggestedFullPath}" (prefix with "${ignorePrefix}")` - message += `\n 2. Use 'routeFileIgnorePattern' in your config to match this file` - message += `\n\nCurrent configuration:` - message += `\n routeFileIgnorePrefix: "${ignorePrefix}"` - message += `\n routeFileIgnorePattern: ${ignorePattern ? `"${ignorePattern}"` : 'undefined'}` + const message = `Warning: Route file "${node.fullPath}" does not export a Route. This file will not be included in the route tree. + +If this file is not intended to be a route, you can exclude it using one of these options: + 1. Rename the file to "${suggestedFullPath}" (prefix with "${ignorePrefix}") + 2. Use 'routeFileIgnorePattern' in your config to match this file + +Current configuration: + routeFileIgnorePrefix: "${ignorePrefix}" + routeFileIgnorePattern: ${ignorePattern ? `"${ignorePattern}"` : 'undefined'}`
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/router-generator/src/generator.tspackages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/router-generator/tests/generator/virtual-physical-empty-path-merge/routes/__root.tsx
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript strict mode with extensive type safety for all code
Files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/src/generator.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Implement ESLint rules for router best practices using the ESLint plugin router
Files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/src/generator.ts
🧠 Learnings (9)
📓 Common learnings
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6120
File: packages/router-generator/src/generator.ts:654-657
Timestamp: 2025-12-17T02:17:55.086Z
Learning: In `packages/router-generator/src/generator.ts`, pathless_layout routes must receive a `path` property when they have a `cleanedPath`, even though they are non-path routes. This is necessary because child routes inherit the path from their parent, and without this property, child routes would not have the correct full path at runtime.
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
📚 Learning: 2025-10-08T08:11:47.088Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5402
File: packages/router-generator/tests/generator/no-formatted-route-tree/routeTree.nonnested.snapshot.ts:19-21
Timestamp: 2025-10-08T08:11:47.088Z
Learning: Test snapshot files in the router-generator tests directory (e.g., files matching the pattern `packages/router-generator/tests/generator/**/routeTree*.snapshot.ts` or `routeTree*.snapshot.js`) should not be modified or have issues flagged, as they are fixtures used to verify the generator's output and are intentionally preserved as-is.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/src/generator.ts
📚 Learning: 2025-12-17T02:17:55.086Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6120
File: packages/router-generator/src/generator.ts:654-657
Timestamp: 2025-12-17T02:17:55.086Z
Learning: In `packages/router-generator/src/generator.ts`, pathless_layout routes must receive a `path` property when they have a `cleanedPath`, even though they are non-path routes. This is necessary because child routes inherit the path from their parent, and without this property, child routes would not have the correct full path at runtime.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsx
📚 Learning: 2025-10-01T18:31:35.420Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 5330
File: e2e/react-start/custom-basepath/src/routeTree.gen.ts:58-61
Timestamp: 2025-10-01T18:31:35.420Z
Learning: Do not review files named `routeTree.gen.ts` in TanStack Router repositories, as these are autogenerated files that should not be manually modified.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/src/generator.ts
📚 Learning: 2025-12-21T12:52:35.231Z
Learnt from: Sheraff
Repo: TanStack/router PR: 6171
File: packages/router-core/src/new-process-route-tree.ts:898-898
Timestamp: 2025-12-21T12:52:35.231Z
Learning: In `packages/router-core/src/new-process-route-tree.ts`, the matching logic intentionally allows paths without trailing slashes to match index routes with trailing slashes (e.g., `/a` can match `/a/` route), but not vice-versa (e.g., `/a/` cannot match `/a` layout route). This is implemented via the condition `!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX` and is a deliberate design decision to provide better UX by being permissive with missing trailing slashes.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsx
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Applies to **/*.{js,ts,tsx} : Implement ESLint rules for router best practices using the ESLint plugin router
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsxpackages/router-generator/src/generator.ts
📚 Learning: 2025-11-02T16:16:24.898Z
Learnt from: nlynzaad
Repo: TanStack/router PR: 5732
File: packages/start-client-core/src/client/hydrateStart.ts:6-9
Timestamp: 2025-11-02T16:16:24.898Z
Learning: In packages/start-client-core/src/client/hydrateStart.ts, the `import/no-duplicates` ESLint disable is necessary for imports from `#tanstack-router-entry` and `#tanstack-start-entry` because both aliases resolve to the same placeholder file (`fake-start-entry.js`) in package.json during static analysis, even though they resolve to different files at runtime.
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsx
📚 Learning: 2025-12-06T15:03:07.223Z
Learnt from: CR
Repo: TanStack/router PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-06T15:03:07.223Z
Learning: Use file-based routing in `src/routes/` directories or code-based routing with route definitions
Applied to files:
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsx
📚 Learning: 2025-12-17T02:17:47.423Z
Learnt from: schiller-manuel
Repo: TanStack/router PR: 6120
File: packages/router-generator/src/generator.ts:654-657
Timestamp: 2025-12-17T02:17:47.423Z
Learning: In packages/router-generator/src/generator.ts, enforce that pathless_layout routes with a cleanedPath must have a path property. This is required because child routes inherit the parent's path; without a path property, the full path will not resolve correctly at runtime. Update the route type/validation to require path for such routes and add tests ensuring that a pathless_layout with cleanedPath provides a valid fullPath resolution.
Applied to files:
packages/router-generator/src/generator.ts
⏰ 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)
- GitHub Check: Test
- GitHub Check: Preview
🔇 Additional comments (1)
packages/router-generator/tests/generator/virtual-physical-empty-path-conflict-root/routes/merged/route.tsx (1)
1-5: LGTM! Test fixture correctly implements the conflict scenario.This test fixture properly creates a root-level route using an empty string path to test conflict detection with virtual root routes. The comment clearly documents the intentional conflict scenario.
Summary by CodeRabbit
New Features
Documentation
Improvements
Tests
✏️ Tip: You can customize this high-level summary in your review settings.