Fix island SSR: rename signal special form, remove cek-try swallowing

Root cause: the new conditions system's 'signal' special form shadowed
the reactive 'signal' function. (signal 0) in island bodies raised
'Unhandled condition: 0' instead of creating a signal dict.

Fix: rename condition special form to 'signal-condition' in the CEK
dispatcher. The reactive 'signal' function now works normally.

adapter-html.sx: remove cek-try that swallowed island render errors.
Islands now render directly — errors propagate for debugging.

sx_render.ml: add sx_render_to_html that calls SX adapter via CEK.

Results: 4/5 island SSR tests pass:
- Header island: logo, tagline, styled elements ✓
- Navigation buttons ✓
- Geography content ✓
- Stepper: partially renders (code view OK, ~cssx/tw in heading)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-29 02:07:24 +00:00
parent e1ef883339
commit d0c03a7648
5 changed files with 2468 additions and 1786 deletions

File diff suppressed because one or more lines are too long

View File

@@ -97,6 +97,16 @@ let render_to_html_ref : (value -> env -> string) ref =
let render_to_html expr env = !render_to_html_ref expr env
(** Render via the SX adapter (render-to-html from adapter-html.sx).
Falls back to the native ref if the SX adapter isn't loaded. *)
let sx_render_to_html render_env expr eval_env =
if env_has render_env "render-to-html" then
let fn = env_get render_env "render-to-html" in
let result = Sx_ref.cek_call fn (List [expr; Env eval_env]) in
match result with String s -> s | RawHTML s -> s | _ -> Sx_runtime.value_to_str result
else
render_to_html expr eval_env
let render_children children env =
String.concat "" (List.map (fun c -> render_to_html c env) children)