Split signals: core spec (spec/signals.sx) + web extensions (web/signals.sx)
Core reactive primitives (signal, deref, reset!, swap!, computed, effect, batch, notify-subscribers, dispose-computed, with-island-scope, register-in-scope) moved to spec/signals.sx — pure SX, zero platform dependencies. Usable by any host: web, CLI, embedded, server, harness. Web extensions (marsh scopes, stores, event bridge, resource) remain in web/signals.sx, which now depends on spec/signals.sx. Updated all load paths: - hosts/ocaml/bin/sx_server.ml — loads spec/signals.sx before web/signals.sx - hosts/ocaml/bin/run_tests.ml — loads both in order - hosts/ocaml/browser/bundle.sh + sx-platform.js — loads core-signals.sx first - shared/sx/ocaml_bridge.py — loads spec/signals.sx before web extensions 1116/1116 OCaml tests pass. Browser reactive island preview works. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -756,7 +756,8 @@ let run_spec_tests env test_files =
|
||||
load_module "bytecode.sx" lib_dir;
|
||||
load_module "compiler.sx" lib_dir;
|
||||
load_module "vm.sx" lib_dir;
|
||||
load_module "signals.sx" web_dir;
|
||||
load_module "signals.sx" spec_dir; (* core reactive primitives *)
|
||||
load_module "signals.sx" web_dir; (* web extensions *)
|
||||
load_module "freeze.sx" lib_dir;
|
||||
load_module "content.sx" lib_dir;
|
||||
load_module "types.sx" lib_dir;
|
||||
|
||||
@@ -1205,6 +1205,7 @@ let test_mode () =
|
||||
Filename.concat spec_base "parser.sx";
|
||||
Filename.concat spec_base "render.sx";
|
||||
Filename.concat lib_base "compiler.sx";
|
||||
Filename.concat spec_base "signals.sx";
|
||||
Filename.concat web_base "signals.sx";
|
||||
Filename.concat web_base "adapter-html.sx";
|
||||
Filename.concat web_base "adapter-sx.sx";
|
||||
|
||||
@@ -27,6 +27,7 @@ cp "$BUILD/sx_browser.bc.js" "$DIST/"
|
||||
cp sx-platform.js "$DIST/"
|
||||
|
||||
# 3. Spec modules
|
||||
cp "$ROOT/spec/signals.sx" "$DIST/sx/core-signals.sx"
|
||||
cp "$ROOT/spec/render.sx" "$DIST/sx/"
|
||||
cp "$ROOT/web/signals.sx" "$DIST/sx/"
|
||||
cp "$ROOT/web/deps.sx" "$DIST/sx/"
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
var files = [
|
||||
// Spec modules
|
||||
"sx/render.sx",
|
||||
"sx/core-signals.sx",
|
||||
"sx/signals.sx",
|
||||
"sx/deps.sx",
|
||||
"sx/router.sx",
|
||||
|
||||
Reference in New Issue
Block a user