From f4f8715d06c2c0b884414b66c3262033bf28cc54 Mon Sep 17 00:00:00 2001 From: giles Date: Sat, 4 Apr 2026 21:36:44 +0000 Subject: [PATCH] WASM rebuild + playground page Co-Authored-By: Claude Opus 4.6 (1M context) --- shared/static/wasm/sx_browser.bc.wasm.js | 2 +- sx/sx/playground.sx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/shared/static/wasm/sx_browser.bc.wasm.js b/shared/static/wasm/sx_browser.bc.wasm.js index 46115ab1..e86abf8f 100644 --- a/shared/static/wasm/sx_browser.bc.wasm.js +++ b/shared/static/wasm/sx_browser.bc.wasm.js @@ -1792,7 +1792,7 @@ blake2_js_for_wasm_create: blake2_js_for_wasm_create}; } (globalThis)) -({"link":[["runtime-0db9b496",0],["prelude-d7e4b000",0],["stdlib-23ce0836",[]],["sx-d3c0ad56",[2]],["jsoo_runtime-f96b44a8",[2]],["js_of_ocaml-651f6707",[2,4]],["dune__exe__Sx_browser-e2e6110d",[2,3,5]],["std_exit-10fb8830",[2]],["start-f5d3f095",0]],"generated":(b=>{var +({"link":[["runtime-0db9b496",0],["prelude-d7e4b000",0],["stdlib-23ce0836",[]],["sx-d4b9c764",[2]],["jsoo_runtime-f96b44a8",[2]],["js_of_ocaml-651f6707",[2,4]],["dune__exe__Sx_browser-ba5b5565",[2,3,5]],["std_exit-10fb8830",[2]],["start-f5d3f095",0]],"generated":(b=>{var c=b,a=b?.module?.export||b;return{"env":{"caml_ba_kind_of_typed_array":()=>{throw new Error("caml_ba_kind_of_typed_array not implemented")},"caml_exn_with_js_backtrace":()=>{throw new Error("caml_exn_with_js_backtrace not implemented")},"caml_int64_create_lo_mi_hi":()=>{throw new diff --git a/sx/sx/playground.sx b/sx/sx/playground.sx index 7263c75d..e6c4282a 100644 --- a/sx/sx/playground.sx +++ b/sx/sx/playground.sx @@ -1,18 +1,21 @@ -;; Playground — interactive REPL with lazy-loaded compiler +;; Playground — demonstrates lazy module loading on navigation (defcomp ~playground/content (&key (title "Playground")) (~docs/page :title title (h1 "Playground") - (p "An interactive SX REPL. The compiler module loads on demand when you navigate here.") + (p "This page lazy-loads the " (code "sx freeze") " and " (code "sx compiler") + " modules when you navigate here. They are NOT loaded at boot.") (span :data-sx-island "playground/repl" (div (~tw :tokens "mt-6 border border-stone-200 rounded-lg overflow-hidden") (div (~tw :tokens "bg-stone-100 px-4 py-2 text-sm font-mono text-stone-500") "sx> ") (div (~tw :tokens "p-4 font-mono text-sm min-h-[120px] text-stone-400") - "Loading compiler..."))))) + "Loading modules..."))))) (defisland ~playground/repl () (do + ;; These two modules are NOT in the boot manifest — they load on demand + (load-library! "sx freeze") (load-library! "sx compiler") (let ((input (signal "")) (output (signal "(ready)"))