0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00

fix(router): report createRoute and destructured Route exports, unwrap the route id, print generator warnings once per Vite build

Review round 1, F5-1 to F5-4.

- routeCallOf (the one recogniser of a route's call) knows the router's
  createRoute: a listed file whose Route it makes is foreign ('code-based')
  and the planner reports it (route-unrecognized), with the
  createFileRoute call to write.
- A Route declared by a destructuring pattern is foreign through the
  binding's declarator, so the constructor it holds makes it 'wrapped' and
  reported, as the other unrecognised shapes (maintainer, 11-13: not
  supported, never silent).
- The route id is read through parentheses and TypeScript assertions
  (stringLiteralOf) by the generator's upkeep, its stale-id report and the
  no-options check.
- The generator plugin prints each warning once per Vite build: the
  generations of the build's config resolutions share one printed set,
  ended by the build's start (inline plugins generate once per
  resolution). The Generator and the scan take the host's logger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-11-13 18:30:18 +01:00
commit 3670c3d65b
No known key found for this signature in database
15 changed files with 644 additions and 51 deletions