Fix island dep scanning + spread-through-reactive-if debug
deps.sx: scan island bodies for component deps (was only scanning "component" and "macro", missing "island" type). This ensures ~cssx/tw and its dependencies are sent to the client for islands. cssx.sx: move if inside make-spread arg so it's evaluated by eval-expr (no reactive wrapping) instead of render-to-dom which applies reactive-if inside island scope, converting the spread into a fragment and losing the class attrs. Added island dep tests at 3 levels: test-deps.sx (spec), test_deps.py (Python), test_parity.py (ref vs fallback). sx-browser.js: temporary debug logging at spread detection points. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -476,10 +476,12 @@
|
||||
(classes (map (fn (r) (get r "cls")) valid))
|
||||
(rules (map (fn (r) (get r "rule")) valid))
|
||||
(_ (for-each (fn (rule) (collect! "cssx" rule)) rules)))
|
||||
;; Return spread: injects class + data-tw onto parent element
|
||||
(if (empty? classes)
|
||||
nil
|
||||
(make-spread {"class" (join " " classes)
|
||||
;; Return spread: injects class + data-tw onto parent element.
|
||||
;; The if is inside make-spread's arg so it goes through eval-expr
|
||||
;; (not render-to-dom), avoiding reactive-if wrapping in islands.
|
||||
(make-spread (if (empty? classes)
|
||||
{}
|
||||
{"class" (join " " classes)
|
||||
"data-tw" (or tokens "")}))))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user