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

test(start-plugin-core): apply the E1 audit to the Start compiler tests

- createIsomorphicFn: named exports read explicitly (P1), the client has
  no server implementation (SERVER_IMPL marker), declaredNames assertion on
  the neutral name dropped (ruling 2026-10-17); SSR keeps asserting it drops
  `./x.client` (ruling 2026-10-18: import-protection-denied names must go),
  client asserts it drops `./x.server`. Real runtime instead of a stub.
- clientOnlyJSX: SSR import-absence loop on neutral names dropped; the
  libraries the children use throw when called during SSR, so the test
  proves the server never evaluates the children (missing coverage 2).
- compiler.test: empty-module test in dev ("a file the user just
  emptied"); the client-only result is read inside a function;
  invalidateModule tests in dev mode; `var a = b; var b = a` row deleted
  (cycle rows at "re-export chain resolution" cover it).
- caller-dead-code: own-name local pin uses `function session() { const
  session = ... }`; label and for-init rows dropped.
- known-bugs-start-compiler: computed-member chain pins, top-level-block
  alias row, `.bind(null)` pin (rsc renderServerComponent().then() pin
  covers the root cause), parameter-shadowing pins (dup of the
  every-factory shadowing pin), `fn_createServerFn_handler` row (generated
  name), redeclared-var row and computed-member transform pin deleted;
  re-export alias pin imports from @tanstack/react-start; Vue pin uses a
  plain `<script lang="ts">` block, id `Page.vue?vue&type=script&lang.ts`
  (checked in @vitejs/plugin-vue 6.0.5 genScriptCode/attrsToQuery: lang is
  in the ignore list and appended as `&lang.ts`).
- preserves-user-code: empty destructuring pin and N3 parenthesized-JSX
  pins (incl. the Hydrate fallback one) deleted; the parenthesized-JSX
  control stays.
- factories: wrapped-chain table rewritten to valid chains (tsc:
  `.server().client()` is TS2339) with parentheses / as any / as unknown as
  T / satisfies (16 rows -> 13 passing + wrapped validator rows moved into
  the validator pin, same bug, verified red: ./check.server kept); builder
  variable control uses `.client()` then `.server()`; isomorphic
  wrapped-link pin checks client and SSR only (no provider for a module
  without a server fn); callee pin keeps `as any` only; aliased re-export
  of createClientOnlyFn checked by behaviour on the server; string export
  name row deleted. Links read from Start's real createMiddleware options.
- known-bugs-route-options: prerender pins and their controls moved to
  tests/outside-compiler-corpus/prerender-route-options.test.ts (ruling
  E1 ASK-2).

ASK-1 (ruling 2026-10-18): SSR import assertions on `.client` names kept
(factories, import-forms, KB ssr declaration control and typeof pin).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-18 13:10:31 +02:00
commit a945fe4563
No known key found for this signature in database
9 changed files with 401 additions and 599 deletions