Fix resolveSuspense: iterate parsed exprs instead of passing array

parse() returns a list of expressions. resolveSuspense was passing the
entire array to renderToDom, which interpreted [(<> ...)] as a call
expression ((<> ...)) — causing "Not callable: {}". Now iterates
each expression individually, matching the public render() API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 19:37:15 +00:00
parent aeac3c0b13
commit 299de98ea8
2 changed files with 11 additions and 9 deletions

View File

@@ -109,11 +109,14 @@
(let ((el (dom-query (str "[data-suspense=\"" id "\"]"))))
(if el
(do
(let ((ast (parse sx))
(env (get-render-env nil))
(node (render-to-dom ast env nil)))
;; parse returns a list of expressions — render each individually
;; (mirroring the public render() API).
(let ((exprs (parse sx))
(env (get-render-env nil)))
(dom-set-text-content el "")
(dom-append el node)
(for-each (fn (expr)
(dom-append el (render-to-dom expr env nil)))
exprs)
(process-elements el)
(sx-hydrate-elements el)
(dom-dispatch el "sx:resolved" {:id id})))