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:
2026-03-13 04:37:45 +00:00
parent 1d1e7f30bb
commit 2c97542ee8
7 changed files with 69 additions and 13 deletions

View File

@@ -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 "")}))))