sx-http: island placeholders with SX source, CSS hide until hydration
Island SSR reverted to placeholder approach (full SSR crashed on reactive code). Placeholders include SX call expression for client hydration. CSS hides placeholder text until WASM renders. Remaining: need SX adapter (adapter-html.sx) for island SSR instead of native Sx_render — the SX adapter handles signals/deref/computed via the CEK machine. Native renderer doesn't support reactive primitives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1733,7 +1733,9 @@ let http_inject_shell_statics env static_dir sx_sxc =
|
||||
(String.length pages_sx)
|
||||
(List.length (String.split_on_char '\n' pages_sx));
|
||||
ignore (env_bind env "__shell-pages-sx" (String pages_sx));
|
||||
ignore (env_bind env "__shell-sx-css" (String sx_css));
|
||||
(* Add CSS to hide island placeholder SX text until client hydrates *)
|
||||
let island_css = "[data-sx-island]{font-size:0;line-height:0;overflow:hidden;max-height:0}" in
|
||||
ignore (env_bind env "__shell-sx-css" (String (sx_css ^ "\n" ^ island_css)));
|
||||
ignore (env_bind env "__shell-sx-css-classes" (String ""));
|
||||
ignore (env_bind env "__shell-asset-url" (String "/static"));
|
||||
ignore (env_bind env "__shell-sx-js-hash" (String sx_js_hash));
|
||||
|
||||
Reference in New Issue
Block a user