sx-tools: WASM kernel updates, TW/CSSX rework, content refresh, new debugging tools

Build tooling: updated OCaml bootstrapper, compile-modules, bundle.sh, sx-build-all.
WASM browser: rebuilt sx_browser.bc.js/wasm, sx-platform-2.js, .sxbc bytecode files.
CSSX/Tailwind: reworked cssx.sx templates and tw-layout, added tw-type support.
Content: refreshed essays, plans, geography, reactive islands, docs, demos, handlers.
New tools: bisect_sxbc.sh, test-spa.js, render-trace.sx, morph playwright spec.
Tests: added test-match.sx, test-examples.sx, updated test-tw.sx and web tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-02 11:31:57 +00:00
parent 9ed1100ef6
commit d40a9c6796
178 changed files with 13591 additions and 9110 deletions

View File

@@ -2,79 +2,79 @@
~geography/demo-scope-basic
()
(div
:class "space-y-2"
(~tw :tokens "space-y-2")
(scope
"demo-theme"
:value "violet"
(div
:class "rounded-lg p-3 bg-violet-50 border border-violet-200"
(~tw :tokens "rounded-lg p-3 bg-violet-50 border border-violet-200")
(p
:class "text-sm text-violet-800 font-semibold"
(~tw :tokens "text-sm text-violet-800 font-semibold")
(str "Inside scope: theme = " (context "demo-theme")))
(p
:class "text-xs text-stone-500"
(~tw :tokens "text-xs text-stone-500")
"scope creates a named scope. context reads it.")))
(div
:class "rounded-lg p-3 bg-stone-50 border border-stone-200"
(~tw :tokens "rounded-lg p-3 bg-stone-50 border border-stone-200")
(p
:class "text-sm text-stone-600"
(~tw :tokens "text-sm text-stone-600")
"Outside scope: no context available."))))
(defcomp
~geography/demo-scope-emit
()
(div
:class "space-y-2"
(~tw :tokens "space-y-2")
(scope
"demo-deps"
(div
:class "rounded-lg p-3 bg-stone-50 border border-stone-200"
(~tw :tokens "rounded-lg p-3 bg-stone-50 border border-stone-200")
(p
:class "text-sm text-stone-700"
(~tw :tokens "text-sm text-stone-700")
(emit! "demo-deps" "lodash")
(emit! "demo-deps" "react")
"Components emit their dependencies upward."))
(div
:class "rounded-lg p-3 bg-violet-50 border border-violet-200"
(p :class "text-sm text-violet-800 font-semibold" "Emitted:")
(~tw :tokens "rounded-lg p-3 bg-violet-50 border border-violet-200")
(p (~tw :tokens "text-sm text-violet-800 font-semibold") "Emitted:")
(ul
:class "text-xs text-stone-600 list-disc pl-5"
(~tw :tokens "text-xs text-stone-600 list-disc pl-5")
(map (fn (d) (li (code d))) (emitted "demo-deps")))))))
(defcomp
~geography/demo-scope-dedup
()
(div
:class "space-y-2"
(~tw :tokens "space-y-2")
(div
:class "rounded-lg p-3 bg-stone-50 border border-stone-200"
(~tw :tokens "rounded-lg p-3 bg-stone-50 border border-stone-200")
(p
:class "text-sm text-stone-700"
(~tw :tokens "text-sm text-stone-700")
(collect! "demo-css-dedup" ".card { padding: 1rem }")
(collect! "demo-css-dedup" ".card { padding: 1rem }")
(collect! "demo-css-dedup" ".btn { color: blue }")
"Three collect! calls, two identical. Only unique values kept."))
(div
:class "rounded-lg p-3 bg-violet-50 border border-violet-200"
(~tw :tokens "rounded-lg p-3 bg-violet-50 border border-violet-200")
(p
:class "text-sm text-violet-800 font-semibold"
(~tw :tokens "text-sm text-violet-800 font-semibold")
(str "Collected: " (len (collected "demo-css-dedup")) " rules"))
(ul
:class "text-xs text-stone-600 list-disc pl-5"
(~tw :tokens "text-xs text-stone-600 list-disc pl-5")
(map (fn (r) (li (code r))) (collected "demo-css-dedup"))))))
(defcomp
~geography/scopes-demo-example
(&key demo src)
(div
:class "grid grid-cols-1 lg:grid-cols-2 gap-4 my-6 items-start"
(~tw :tokens "grid grid-cols-1 lg:grid-cols-2 gap-4 my-6 items-start")
(div
:class "border border-dashed border-stone-300 rounded-lg p-4 bg-stone-50 min-h-[80px]"
(~tw :tokens "border border-dashed border-stone-300 rounded-lg p-4 bg-stone-50 min-h-[80px]")
demo)
(div
:class "not-prose bg-stone-100 rounded-lg p-4 overflow-x-auto"
(~tw :tokens "not-prose bg-stone-100 rounded-lg p-4 overflow-x-auto")
(pre
:class "text-sm leading-relaxed whitespace-pre-wrap break-words"
(~tw :tokens "text-sm leading-relaxed whitespace-pre-wrap break-words")
(code src)))))
(defcomp
@@ -83,7 +83,7 @@
(~docs/page
:title "Scopes"
(p
:class "text-stone-500 text-sm italic mb-8"
(~tw :tokens "text-stone-500 text-sm italic mb-8")
"The unified primitive. "
(code "scope")
" creates a named scope with an optional value "
@@ -185,7 +185,7 @@
"See the "
(a
:href "/sx/(geography.(spreads))"
:class "text-violet-600 hover:underline"
(~tw :tokens "text-violet-600 hover:underline")
"spreads article")
" for the full mechanism.")))
(~docs/section
@@ -256,7 +256,7 @@
"python"))
(p "The unification is not just code cleanup. It means:")
(ul
:class "space-y-1"
(~tw :tokens "space-y-1")
(li
(code "collect!")
" can be nested inside "
@@ -281,7 +281,7 @@
"See the "
(a
:href "/sx/(etc.(plan.scoped-effects))"
:class "text-violet-600 hover:underline"
(~tw :tokens "text-violet-600 hover:underline")
"scoped effects plan")
" for the full design rationale and future phases (reactive scopes, morph scopes).")
(~docs/note
@@ -292,11 +292,11 @@
" special form is in "
(a
:href "/sx/(language.(spec.(explore.evaluator)))"
:class "font-mono text-violet-600 hover:underline text-sm"
(~tw :tokens "font-mono text-violet-600 hover:underline text-sm")
"eval.sx")
". Platform primitives are declared in "
(a
:href "/sx/(language.(spec.(explore.boundary)))"
:class "font-mono text-violet-600 hover:underline text-sm"
(~tw :tokens "font-mono text-violet-600 hover:underline text-sm")
"boundary.sx")
" (Tier 5: Scoped effects).")))))