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

feat(router-utils): an exported binding leaves with its augmentations

An extraction candidate no longer has to be pure: its augmentations
(`Page.displayName = …`, static props, `preload`) and an effectful
initialiser travel with it under the effect-order rule of every move. An
effectful candidate joins the moving set of the fixed point with its
extracted output as target, so `effectStays` decides it: for a static output
(evaluated before the route module's body) a surviving effect before the
cluster's last one pins it, one after keeps its order; the extracted modules
evaluate in source order among themselves (re-exported in that order), so
two augmented exports both leave. The extracted module stays flagged
side-effect free when its effects only augment its own declarations
(unobservable while nothing imports the binding), so bundlers drop the unused
re-export and the component loads with its chunk on every bundler.

Tests: core rows (augmentations, earlier/later effect, two exports in order,
effectful initialiser, a kept read), page rows through a real dev server,
a production-build row per bundler and hint, a Vite + Chromium HMR edit.
The toy split planner skips the route's own symbol like the real one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-28 00:58:54 +01:00
commit b25984c166
No known key found for this signature in database
8 changed files with 370 additions and 21 deletions