Add (cyst) form: isolated reactive subtree that survives parent re-renders
New language feature: (cyst [:key id] body...) creates a DOM container with its own island scope that persists across parent reactive re-renders. On first render, the body is evaluated in a fresh with-island-scope and the resulting DOM is cached. On subsequent renders, the cached DOM node is returned if still connected to the document. This solves the fundamental problem of nesting reactive islands inside other islands' render trees — the child island's DOM (with its event handlers and signal subscriptions) survives when the parent re-renders. Implementation: *memo-cache* dict keyed by cyst id. render-dom checks isConnected before returning cached node. Each cyst gets its own disposer list via with-island-scope. Usage in sx-tools: defisland render preview now wrapped in (cyst :key full-name ...). Real mouse clicks work — counter increments, temperature converts, computed signals update. Verified on both local and live site. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user