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

test(start-plugin-core): register Start's entries in the Vite dev import-protection harness

Harness gap H1: `startProtectedDevServer` and the known-bugs dev config now
register Start's router entry (and `src/start.ts` when present) the way
`tanStackStart()` does, so the dev reachability check runs. Apps in
dev.test.ts are loaded from their router entry `src/entry.ts`, like a
browser loads a Start app. The provider environment can be `rsc`.

Re-running the suite with the entries registered turned two passing tests
red; investigated, a real main bug (not a harness artefact), now pinned:
- Bug (new): an edit drops the import graph edges to the edited module
  (`ImportGraph.invalidate` removes the edges where the file is the
  target), so a violation found when it is transformed again is discarded
  as unreachable: a denied import added by an edit is mocked without a
  warning, and `log: 'always'` does not log again after an edit. Pins:
  "added by an edit of the importer is logged at the use, with a trace from
  the entry", "'always' logs a violation again after an edit" (both flip
  with a scratch fix keeping incoming edges). The mocking half stays a
  passing test.

Items:
- ip-vite V2: the logging half of the "importer first" pin is a normal test.
- V3: SSR import of a client-only-marked module (already transformed, and
  through its importer) is mocked and logged.
- V4 (a) only the leak is logged, not a server fn factory's .server()
  imports; (b) a factory module calling a denied import at the top level
  is logged (the H1 control: fails without the entry).
- V7 denied specifier logged at its use; V8 dev onViolation; V9 rsc
  provider env; V12 runtime mock reports; V14 JSX locations; V15 'always'
  does not re-log on other loads.

Kills: spc:5091, 5094, 5103, 5106, 5109, 5113, 4305, 4312, 5070, 5077,
4547, 4560, 4561, 4584, 4586, 4588 (hang), 4594, 4597, 4604, 4607, 4613,
4626, 4631, 4642, 4643, 4644, 4656, 4657, 4662, 5011, 5141, 5143, 5146,
4533, 4581, 4520, 4900, 4902, 4678, 4685, 4687, 5014, 5017, 5021, 5446,
4744, 4761, 4764, 4326, 4794, 5351, 4169, 4170, 4173, 4187, 4189, 4731

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-17 06:52:59 +02:00
commit 20c891a337
No known key found for this signature in database
3 changed files with 515 additions and 57 deletions