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

test(router-plugin): pin fuzz findings N1, N2, N3 and V3 of the code splitter

Turns the oracle-mode fuzzing findings for the code splitter into tests
(known-bugs-code-splitter.test.ts). Each pin was run once as a normal
test and failed for the bug.

- N1 (new main bug): an imported split component that other code still
  reads loses its import. Pins: head() reads PostsPage.title (loadRoute),
  an exported component renders the imported errorComponent, read through
  a real importer (adapted from examples/solid/start-supabase-basic
  posts.$postId.tsx), a pendingComponent split by custom groupings that an
  unsplit errorComponent renders, and real SSR builds on Vite and Rspack.
  Red: "PostsPage/ErrorComponent/Spinner is not defined". Control: the same
  head() route with the component declared in the route file passes.
- N2 (new main bug): a top-level call reading a module-level binding runs
  again in every split chunk. Two rows in the "unreferenced top-level side
  effect" table (red: 3 calls instead of 1); the table's Bug comment now
  covers these calls. Control: calls reading only imports or literals run
  once. The harness body moved into expectEffectRunsOnce.
- N3 (new main bug, upstream root cause): parenthesized JSX under `!` or a
  member call is printed without parentheses. Red: the split chunk does
  not parse. Root cause in @babel/generator 7.29.8; no workaround.
  Control: parenthesized JSX alone.
- V3 (variant): rows for the split-option re-parse pin: an immediately
  invoked function, a typed arrow, `as any`, `!` and a type argument
  (the last one parses as comparisons and yields `false`). Red: Babel
  "Unexpected token" / "component is not a function".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-17 18:20:50 +02:00
commit 3a10f18be0
No known key found for this signature in database