Files
WRNexusJS/packages
ClintchizandClaude Opus 5 0904a4efaa fix(csr): render control blocks created by a client rerender
{#if}, {#each} and their {:else}/{:else if}/{:empty} branches worked on
the server and after hydration, but a block nested inside another block
stayed empty once the outer block rerendered. Adding a row to a list
produced the row's markup with its inner block markers in place and
nothing between them, for the life of the page.

Two causes, both on the client-created path only:

reactive() registers an effect; effects run when renderAll sweeps the
list. A state change runs just the affected effects rather than sweeping,
so an effect registered during that rerender was queued and never
invoked. setupControlBlock now returns its runner and the creating block
invokes it immediately.

The first reactive pass is skipped so hydration does not discard
server-rendered DOM. A block created by a rerender has no server DOM, so
skipping its only pass left it permanently empty. firstRun is now keyed
off outerLocals, which is set only on the client-created path.

Verified in a browser as well as in tests: adding a group to a list now
renders the new row's nested {:else}, and the existing rows' nested loops
survive the rerender.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-19 00:49:31 +05:30
..
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30
2026-08-11 13:40:03 +05:30