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:
@@ -657,6 +657,8 @@ let make_server_env () =
|
||||
match v with
|
||||
| Thunk (body, closure_env) -> Sx_ref.eval_expr body (Env closure_env)
|
||||
| other -> other);
|
||||
(* client? returns false on server — overridden in browser via K.eval *)
|
||||
ignore (env_bind env "client?" (NativeFn ("client?", fun _ -> Bool false)));
|
||||
env
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user