Scope-based cursor walks the existing SSR DOM during island hydration instead of creating new elements and calling replaceChildren. The hydration scope (sx-hydrating) propagates through define-library via scope-push!/peek/pop!, solving the env isolation that broke the previous set!-based approach. Changes: - adapter-dom.sx: hydrating?, hydrate-next-node, hydrate-enter/exit-element helpers. render-to-dom reuses text nodes. render-dom-element reuses elements by tag match, skips dom-append. reactive-text/cek-reactive-text reuse existing text nodes. render-dom-fragment/lake/marsh skip append. dispatch-render-form (if/when/cond) injects markers into existing DOM. - boot.sx: hydrate-island pushes cursor scope, skips replaceChildren. On mismatch error, falls back to full re-render. Result: zero DOM destruction, zero visual flash, event listeners attached to original SSR elements. Stepper clicks verified working. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
14 KiB
14 KiB