ReviewOS
@if (!issue)

No such issue

stacks/stx has no issue numbered 2029.

@else

stacks/stx

typecheck: false errors on templates that run, plus two runtime bugs they hid

#2029
Closed chris opened this 9 days ago ·
9 days ago

stx typecheck (and the editor plugin, which shares its buffer) reports errors on templates that render correctly. Audited across stx's own components (105 files) and a 620-file application, each item below is a whole class, not a one-off:

  1. Client declarations collide with scraped bridge names (166 in stx's components alone). With no defineClientPayload, every server binding was declared as declare var x: any in the client buffer, so a client block's own const code (CodeBlock), allowMultiple (Accordion), … became "Cannot redeclare block-scoped variable". The runtime bridge leaves a client-owned top-level name alone, so nothing collides at runtime.
  2. $bool and $uid undeclared in server blocks (145). Both are engine bindings beside $props.
  3. @foreach(item in items) loop variables unbound (48). Only the items as item spelling was read; the runtime accepts both (parseLoopBinding).
  4. Guards that narrow through a const alias are ignored. const notFound = !event || … then …