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

fix(router-utils): code with side effects never moves into an extracted export's module

An unexported cluster with an effect observable on its own (`Card.x =
track('card')`, `const Card = track('card')`) that only an extracted
export needs moved into that export's module. The webpack-family hosts mark
every such module side-effect free, so the effect ran when the split chunk
loaded, after the route module's later effects, or never. The movable test
now keeps such a cluster in the route module on every bundler; the extracted
module imports it from there. Main kept it in the route module.

Kept-export warnings now name the cause a candidate was cancelled for,
recorded at the cancellation: an export kept by the order rule or by an eager
read of a kept binding was reported as read by the route module itself
(`live`), since it had become an env root by the time the reason was
derived. The order wording names the effect before the export, with its line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-30 12:24:32 +01:00
commit b4d2482dcf
No known key found for this signature in database
8 changed files with 163 additions and 23 deletions