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:
@@ -113,6 +113,17 @@ class TestTransitiveDeps:
|
||||
deps = transitive_deps("~card", env)
|
||||
assert "~unknown" in deps
|
||||
|
||||
def test_island_deps_scanned(self):
|
||||
"""Island bodies must be scanned for component dependencies."""
|
||||
env = make_env(
|
||||
'(defcomp ~leaf (&key) (span "leaf"))',
|
||||
'(defcomp ~branch (&key) (div (~leaf)))',
|
||||
'(defisland ~my-island () (div (~branch) "island"))',
|
||||
)
|
||||
deps = transitive_deps("~my-island", env)
|
||||
assert "~branch" in deps
|
||||
assert "~leaf" in deps
|
||||
|
||||
def test_without_tilde_prefix(self):
|
||||
env = make_env(
|
||||
'(defcomp ~card (&key) (div (~shared:misc/badge)))',
|
||||
|
||||
Reference in New Issue
Block a user