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

@@ -2757,7 +2757,7 @@ def transitive_deps_walk(n, seen, env):
if sx_truthy((not sx_truthy(contains_p(seen, n)))):
seen.append(n)
val = env_get(env, n)
if sx_truthy((type_of(val) == 'component')):
if sx_truthy(((type_of(val) == 'component') if sx_truthy((type_of(val) == 'component')) else (type_of(val) == 'island'))):
for ref in scan_refs(component_body(val)):
transitive_deps_walk(ref, seen, env)
return NIL
@@ -2780,7 +2780,7 @@ def transitive_deps(name, env):
def compute_all_deps(env):
for name in env_components(env):
val = env_get(env, name)
if sx_truthy((type_of(val) == 'component')):
if sx_truthy(((type_of(val) == 'component') if sx_truthy((type_of(val) == 'component')) else (type_of(val) == 'island'))):
component_set_deps(val, transitive_deps(name, env))
return NIL