Fix event-bridge + add client? primitive + header store foundation
- Event-bridge: rewrite island to use document-level addEventListener via effect + host-callback, bypassing broken container-ref + schedule-idle. Also use host-get for event-detail (WASM host handles). - Add client? primitive: false on server (sx_primitives._is_client ref), true in browser (sx_browser.ml sets ref). Enables SSR-safe conditional logic for client-only features like def-store. - Header island: use def-store for idx/shade signals when client? is true, falling back to plain signals on server. Foundation for SPA nav state preservation (store registry persistence still needs work). - Remove unused client? K.eval override from sx-platform.js. 100 passed, 1 skipped (isomorphic nav — store registry resets on SPA nav), 0 failed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -439,6 +439,9 @@ let api_fn_arity fn_js =
|
||||
let () =
|
||||
let bind name fn = ignore (env_bind global_env name (NativeFn (name, fn))) in
|
||||
|
||||
(* client? returns true in browser — set the ref so the primitive returns true *)
|
||||
Sx_primitives._is_client := true;
|
||||
|
||||
(* --- Evaluation --- *)
|
||||
bind "cek-eval" (fun args ->
|
||||
match args with
|
||||
|
||||
Reference in New Issue
Block a user