Skip to content

ripple@0.3.83

Choose a tag to compare

@github-actions github-actions released this 13 Jun 23:00
· 179 commits to main since this release
25b9156

Patch Changes

  • #1269
    8747e8f
    Thanks @leonidaz! - Treat plain JS control flow
    inside @{ … } as ordinary JavaScript that returns JSX.

    Only @-directives (@if/@for/@switch/@try) lower to template control
    flow. Plain if/for/for…of/for…in/while/do…while/switch/try
    inside a code block are now compiled exactly like the same control flow in a
    regular function C() { …; return <jsx> } body — their JSX returns become
    tsrx_element values rather than being template-ized.

    Previously these plain statements were mis-routed into the template transform:
    on ripple an early-return guard produced a _$_.if/_$_.switch/_$_.try
    wrapper (with dead code in the switch/try cases) and plain loops threw a
    compile error; on solid they produced
    <Show>/<Switch>/<For>/<Errored> (dropping trailing output for try).
    They now stay as plain control flow, so early-return guards and loops behave
    like normal JavaScript.

    As part of this, the ripple client and server targets no longer emit the
    return_guard bookkeeping variable: a plain early return is a real early
    return, so subsequent template output is naturally skipped without a guard flag.

    On solid, this means a plain guard (if (signal()) return …) inside a
    component body now runs once at setup — exactly like a regular Solid component —
    instead of being lifted into a reactive <Show>. Use @if (or another
    @-directive) when you want reactive conditional rendering.

  • Updated dependencies
    [3d93339,
    5646eb4,
    8747e8f,
    8747e8f]:

    • @tsrx/ripple@0.1.31
    • @tsrx/core@0.1.31