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

test(compiler-test-utils): erase TypeScript like Vite under verbatimModuleSyntax

H3: the linker's default transform (and router-plugin's React Refresh
transform) now erase TypeScript with `onlyRemoveTypeImports`, as Vite does
in a project with `verbatimModuleSyntax`: an unused value import still
loads its module, `import { type X }` loads it as `import './x'`, only
`import type` goes. New option `verbatimModuleSyntax: false` (linker and
router-plugin `loadRoute`) erases like a project without it. Controls in
module-linker.test.ts.

Status changes:
- router-plugin code-splitter-imports-exports "reads an ambient var merged
  with an interface ...": NEW main bug, exposed. The split chunk and the
  route module import the ambient var from the shared module, which has no
  runtime binding; real Vite + verbatimModuleSyntax fails the build with
  MISSING_EXPORT. Split into a passing row without verbatimModuleSyntax
  and a `.fails` pin with it (red: "does not provide an export named
  'readVersion'").
- router-plugin known-bugs-code-splitter overload pin (#8505) flipped: the
  bug only shows without verbatimModuleSyntax. The pin now runs that way
  (red: "Export 'helper' is not defined"); a passing control runs with it.
- start-plugin-core start-compiler-factories "isomorphic, server-only and
  middleware implementations in one module ...": the test's package stub
  lacked factories the real package exports and `head` imports; add them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-18 11:13:01 +02:00
commit ee83be6ad7
No known key found for this signature in database
6 changed files with 151 additions and 16 deletions