Adapter fixes, orchestration updates, example content + SPA tests
From other session: adapter-html/sx/dom fixes, orchestration improvements, examples-content refactoring, SPA navigation test updates, WASM copies synced. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -288,24 +288,21 @@
|
||||
s)
|
||||
(post-swap t)))
|
||||
(let
|
||||
((select-sel (dom-get-attr el "sx-select"))
|
||||
(content
|
||||
(if
|
||||
select-sel
|
||||
(select-from-container container select-sel)
|
||||
(children-to-fragment container))))
|
||||
(dispose-islands-in target)
|
||||
(with-transition
|
||||
use-transition
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((swap-result (swap-dom-nodes target content swap-style)))
|
||||
(post-swap
|
||||
(if
|
||||
(= swap-style "outerHTML")
|
||||
(dom-parent (or swap-result target))
|
||||
(or swap-result target))))))))))))))
|
||||
((select-sel (dom-get-attr el "sx-select")))
|
||||
(let
|
||||
((content (if select-sel (select-from-container container select-sel) (children-to-fragment container))))
|
||||
(dispose-islands-in target)
|
||||
(with-transition
|
||||
use-transition
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((swap-result (swap-dom-nodes target content swap-style)))
|
||||
(post-swap
|
||||
(if
|
||||
(= swap-style "outerHTML")
|
||||
(dom-parent (or swap-result target))
|
||||
(or swap-result target)))))))))))))))
|
||||
|
||||
(define
|
||||
handle-html-response
|
||||
@@ -973,17 +970,35 @@
|
||||
:effects (mutation io)
|
||||
(fn
|
||||
(target rendered (pathname :as string))
|
||||
(do
|
||||
(dispose-islands-in target)
|
||||
(dom-set-text-content target "")
|
||||
(dom-append target rendered)
|
||||
(hoist-head-elements-full target)
|
||||
(process-elements target)
|
||||
(sx-hydrate-elements target)
|
||||
(sx-hydrate-islands target)
|
||||
(run-post-render-hooks)
|
||||
(dom-dispatch target "sx:clientRoute" (dict "pathname" pathname))
|
||||
(log-info (str "sx:route client " pathname)))))
|
||||
(let
|
||||
((container (dom-create-element "div" nil)))
|
||||
(dom-append container rendered)
|
||||
(process-oob-swaps
|
||||
container
|
||||
(fn
|
||||
(t oob (s :as string))
|
||||
(dispose-islands-in t)
|
||||
(swap-dom-nodes
|
||||
t
|
||||
(if (= s "innerHTML") (children-to-fragment oob) oob)
|
||||
s)
|
||||
(post-swap t)))
|
||||
(let
|
||||
((target-id (dom-get-attr target "id")))
|
||||
(let
|
||||
((inner (if target-id (dom-query container (str "#" target-id)) nil)))
|
||||
(let
|
||||
((content (if inner (children-to-fragment inner) (children-to-fragment container))))
|
||||
(dispose-islands-in target)
|
||||
(dom-set-text-content target "")
|
||||
(dom-append target content)
|
||||
(hoist-head-elements-full target)
|
||||
(process-elements target)
|
||||
(sx-hydrate-elements target)
|
||||
(sx-hydrate-islands target)
|
||||
(run-post-render-hooks)
|
||||
(dom-dispatch target "sx:clientRoute" (dict "pathname" pathname))
|
||||
(log-info (str "sx:route client " pathname))))))))
|
||||
|
||||
(define
|
||||
resolve-route-target
|
||||
|
||||
Reference in New Issue
Block a user