Island disposal, reactive lists, input binding, and Phase 2 plan
- Effect and computed auto-register disposers with island scope via register-in-scope; dispose-islands-in called before every swap point (orchestration.sx) to clean up intervals/subscriptions on navigation. - Map + deref inside islands auto-upgrades to reactive-list for signal- bound list rendering. Demo island with add/remove items. - New :bind attribute for two-way signal-input binding (text, checkbox, radio, textarea, select). bind-input in adapter-dom.sx handles both signal→element (effect) and element→signal (event listener). - Phase 2 plan page at /reactive-islands/phase2 covering input binding, keyed reconciliation, reactive class/style, refs, portals, error boundaries, suspense, and transitions. - Updated status tables in overview and plan pages. - Fixed stopwatch reset (fn body needs do wrapper for multiple exprs). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -261,6 +261,7 @@
|
||||
;; Process OOB swaps
|
||||
(process-oob-swaps container
|
||||
(fn (t oob s)
|
||||
(dispose-islands-in t)
|
||||
(swap-dom-nodes t oob s)
|
||||
(sx-hydrate t)
|
||||
(process-elements t)))
|
||||
@@ -269,6 +270,8 @@
|
||||
(content (if select-sel
|
||||
(select-from-container container select-sel)
|
||||
(children-to-fragment container))))
|
||||
;; Dispose old islands before swap
|
||||
(dispose-islands-in target)
|
||||
;; Swap
|
||||
(with-transition use-transition
|
||||
(fn ()
|
||||
@@ -282,6 +285,8 @@
|
||||
(let ((doc (dom-parse-html-document text)))
|
||||
(when doc
|
||||
(let ((select-sel (dom-get-attr el "sx-select")))
|
||||
;; Dispose old islands before swap
|
||||
(dispose-islands-in target)
|
||||
(if select-sel
|
||||
;; Select from parsed document
|
||||
(let ((html (select-html-from-doc doc select-sel)))
|
||||
@@ -295,6 +300,7 @@
|
||||
;; Process OOB swaps
|
||||
(process-oob-swaps container
|
||||
(fn (t oob s)
|
||||
(dispose-islands-in t)
|
||||
(swap-dom-nodes t oob s)
|
||||
(post-swap t)))
|
||||
;; Hoist head elements
|
||||
@@ -816,6 +822,7 @@
|
||||
;; Swap rendered DOM content into target and run post-processing.
|
||||
;; Shared by pure and data page client routes.
|
||||
(do
|
||||
(dispose-islands-in target)
|
||||
(dom-set-text-content target "")
|
||||
(dom-append target rendered)
|
||||
(hoist-head-elements-full target)
|
||||
@@ -1003,6 +1010,7 @@
|
||||
(use-transition (get swap-spec "transition"))
|
||||
(trimmed (trim data)))
|
||||
(when (not (empty? trimmed))
|
||||
(dispose-islands-in target)
|
||||
(if (starts-with? trimmed "(")
|
||||
;; SX response
|
||||
(let ((rendered (sx-render trimmed))
|
||||
|
||||
Reference in New Issue
Block a user