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

feat(start-plugin-core): R162 by its principle: refuse what may skip, repeat or defer a server fn (phase 3b)

The hoist's position rule is now the principle itself, closed by the
grammar: every expression position a top-level statement evaluates is once
and unconditional (a member's object, a callee, an operand, a template's
or JSX's expression, a spread, any operand of a sequence, a computed key,
a top-level `await`'s operand, besides the earlier list), except the kinds
the language may skip, repeat or run later: a ternary's branches, the right
operand of `&&` / `||` / `??` and of a logical assignment, what follows a
`?.` in its chain, a destructuring default, an instance field's
initialiser, a function (body or default parameter), a loop, `if`, a block,
`try`, `switch`, a namespace's body (`refusedKind`, one reason each).
`createServerFn().handler(…).bind(null)` compiles again. The local-builder
capture message, and its `<script setup>` twin, give a fix R162 accepts.

Tests: a row per newly allowed kind (a callee and a tag compile only: they
call the server fn when the module loads) and per new refusal; the
integration tier's in-function shapes deleted where the position was the
subject (server fns in erased code, in split components, in handlers, in a
`<script setup>` block, the extracted-export cases) and moved to allowed
positions where it was not (ids, wrapper names, lazy handler modules,
generated statements, message fixes, Vue fixes, the RSC provider).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-11-16 11:17:28 +01:00
commit fadc88c92e
No known key found for this signature in database
15 changed files with 393 additions and 539 deletions