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

test(start-plugin-core): the real router in the Start build and dev harnesses

`routerRuntimeFiles`, the stand-in `@tanstack/react-router` of apps with
routes (route creation, child linking, lazy loading, `sideEffects: false`),
is gone: the apps resolve the real built `@tanstack/react-router` (a
dependency of this package, built by `^build`) like any dependency, as
the `realRouter` dev servers already did. `realRouter` is gone with it
(always on). `startRuntimeLinks`/`linkStartRuntime` use the
compiler-test-utils workspace-packages helper.

Scripts that called a split component as a function render through the
real router and React instead: every app gets `harness/render.ts`
(`renderPath(routeTree, pathname)`: `createRouter`, `router.load()`,
`<RouterProvider>` to HTML; plus React's `createElement`/`renderToString`
for a loaded component on its own), which a test entry re-exports.
Rows: S10 (build-harness, start-build-options, start-build-route-hmr),
S47's runtime observation half (page HTML, not a component call), the
source-map stack now comes from React rendering the loaded component.

start-build-options: the hand-written router `index.d.ts` is deleted;
the Register checks type-check against the real router declarations
(verified: the test passes with them, and `Equal<any, 'ROUTER'>` would
fail if the import did not resolve).

hydrate-build.test.ts (A3b's file): its stand-in router no longer
derives from the harness's; the route creation moved into its own
stand-in block (W2-h replaces the hydrate stand-ins with the real
packages).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-18 20:37:50 +02:00
commit ce8553b9ed
No known key found for this signature in database
16 changed files with 144 additions and 189 deletions