Revert "hydrate-island: clear-and-replace instead of hydration walk"
This reverts commit ca077b429b.
This commit is contained in:
@@ -332,25 +332,20 @@
|
||||
(component-params comp))
|
||||
(let
|
||||
((cursor (dict "parent" el "index" 0)))
|
||||
(host-call el "replaceChildren")
|
||||
(scope-push! "sx-hydrating" nil)
|
||||
(scope-push! "sx-hydrating" cursor)
|
||||
(cek-try
|
||||
(fn
|
||||
()
|
||||
(with-island-scope
|
||||
(fn (disposable) (append! disposers disposable))
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((result (render-to-dom (component-body comp) local el)))
|
||||
(when result (dom-append el result))))))
|
||||
(fn () (render-to-dom (component-body comp) local nil))))
|
||||
(fn
|
||||
(err)
|
||||
(scope-pop! "sx-hydrating")
|
||||
(log-warn
|
||||
(str "hydrate fallback: " comp-name " — " err))
|
||||
(let
|
||||
((fallback (dom-create-text (str "Island error: " comp-name " " err))))
|
||||
((fallback (cek-try (fn () (with-island-scope (fn (d) (append! disposers d)) (fn () (render-to-dom (component-body comp) local nil)))) (fn (err2) (let ((e (dom-create-element "div" nil))) (dom-set-text-content e (str "Island error: " comp-name "\n" err2)) e)))))
|
||||
(host-call el "replaceChildren" fallback)
|
||||
nil)))
|
||||
(scope-pop! "sx-hydrating")
|
||||
|
||||
11
web/boot.sx
11
web/boot.sx
@@ -332,25 +332,20 @@
|
||||
(component-params comp))
|
||||
(let
|
||||
((cursor (dict "parent" el "index" 0)))
|
||||
(host-call el "replaceChildren")
|
||||
(scope-push! "sx-hydrating" nil)
|
||||
(scope-push! "sx-hydrating" cursor)
|
||||
(cek-try
|
||||
(fn
|
||||
()
|
||||
(with-island-scope
|
||||
(fn (disposable) (append! disposers disposable))
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((result (render-to-dom (component-body comp) local el)))
|
||||
(when result (dom-append el result))))))
|
||||
(fn () (render-to-dom (component-body comp) local nil))))
|
||||
(fn
|
||||
(err)
|
||||
(scope-pop! "sx-hydrating")
|
||||
(log-warn
|
||||
(str "hydrate fallback: " comp-name " — " err))
|
||||
(let
|
||||
((fallback (dom-create-text (str "Island error: " comp-name " " err))))
|
||||
((fallback (cek-try (fn () (with-island-scope (fn (d) (append! disposers d)) (fn () (render-to-dom (component-body comp) local nil)))) (fn (err2) (let ((e (dom-create-element "div" nil))) (dom-set-text-content e (str "Island error: " comp-name "\n" err2)) e)))))
|
||||
(host-call el "replaceChildren" fallback)
|
||||
nil)))
|
||||
(scope-pop! "sx-hydrating")
|
||||
|
||||
Reference in New Issue
Block a user