Skip to content

fix(routing): resolve TanStack Router file-ignore and code-split warnings#1892

Merged
samuv merged 3 commits intomainfrom
fix-routing-warning
Mar 31, 2026
Merged

fix(routing): resolve TanStack Router file-ignore and code-split warnings#1892
samuv merged 3 commits intomainfrom
fix-routing-warning

Conversation

@samuv
Copy link
Copy Markdown
Collaborator

@samuv samuv commented Mar 31, 2026

Change:

  • Fix routeFileIgnorePattern in vite.renderer.config.ts — the pattern was matched against individual file/directory names (not full paths), so root/ with a trailing slash never matched anything. Replace with (__tests__|guards|hooks|root-error) to correctly exclude the guard utilities, hooks, and error boundary from the route tree.
  • Remove export from McpOptimizerRoute, RegistryGroupDetail, and RegistryServerDetail — named exports from route files prevent TanStack Router from code-splitting those chunks.
  • Update the three corresponding test files to access the component via Route.options.component instead of the now-removed named imports.

@samuv samuv self-assigned this Mar 31, 2026
Copilot AI review requested due to automatic review settings March 31, 2026 13:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Resolves TanStack Router warnings by correcting which files/directories are ignored during route-tree generation and by removing named exports from route files to allow proper auto code-splitting.

Changes:

  • Fix TanStack Router routeFileIgnorePattern so non-route utilities under routes/ are excluded from route generation.
  • Remove named exports of route components from three route files to unblock TanStack Router chunk code-splitting.
  • Update affected route tests to reference the route component via Route.options.component instead of importing the component directly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
renderer/vite.renderer.config.ts Updates routeFileIgnorePattern to ignore route-adjacent utility folders/files that were causing router warnings.
renderer/src/routes/mcp-optimizer.tsx Removes named export from the route component to enable code-splitting.
renderer/src/routes/(registry)/registry-group_.$name.tsx Removes named export from the route component to enable code-splitting.
renderer/src/routes/(registry)/registry_.$name.tsx Removes named export from the route component to enable code-splitting.
renderer/src/routes/__tests__/registry-group_.$name.test.tsx Updates test to access the component through Route.options.component.
renderer/src/routes/__tests__/registry_.$name.test.tsx Updates test to access the component through Route.options.component.
renderer/src/routes/__tests__/mcp-optimizer.test.tsx Updates test router setup to use Route.options.component instead of a named import.

@samuv samuv enabled auto-merge (squash) March 31, 2026 15:10
@samuv samuv merged commit 1637046 into main Mar 31, 2026
19 of 20 checks passed
@samuv samuv deleted the fix-routing-warning branch March 31, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants