mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
fix(router-utils): a literal's value only removed code reads goes with its destructuring leaf
`const { title, secret } = { title: 'Hi', secret: readSecret() }` (also
next to a rest element, and `const [title, secret] = ['Hi', readSecret()]`),
`secret` read only by a deleted `server` option (or any erased code), `title`
by the split component: the orphan cleanup pruned the `secret` leaf but the
literal kept `secret: readSecret()`, so the chunk imported and called the
server-only module (R84; main kept it in the route's shared chunk). The
literal a declarator destructures is a new value nothing else holds: the
property (one plain property per key, in a literal without accessors) or
array element (before any spread) of a pruned leaf goes with it, under the
declarator's rule for effects (module level: they go; function level: pure
or server-only, never a hook call). A pattern nested in another one is left
as written.
The router planner's `propertyKeyName` moves to the core (`source.ts`) so
both use one key helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5cefb94792
commit
4d8a5415a1
8 changed files with 347 additions and 58 deletions
Loading…
Add table
Add a link
Reference in a new issue