mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
route splitting: shared names live in the shared module, as on main
Every name main shares (a staying option's reads included) is declared in the shared module; the route module imports it from there and re-exports the exported ones, and a chunk imports from the route module only Route and export const|let|var. One the route module or a chunk assigns, one a top-level statement writes or reads before its last declaration, and one reading a declaration main never shares stay in the route module. The re-export glue skips an export row the route module's own statement exports; a chunk importing a shared binding the route module reads gets route HMR's kept-reader registration. On Vite 8 the 12-route app is now byte-identical to main (no react-*.js chunk). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0574610b63
commit
61011c835f
10 changed files with 224 additions and 47 deletions
Loading…
Add table
Add a link
Reference in a new issue