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

@@ -1,3 +1,4 @@
;; Registry of all valid HTML tag names
(define
HTML_TAGS
(list
@@ -141,6 +142,7 @@
"dialog"
"menu"))
;; Self-closing tags (br, img, hr, etc.)
(define
VOID_ELEMENTS
(list
@@ -159,6 +161,7 @@
"track"
"wbr"))
;; Attrs that are true/false (checked, disabled, etc.)
(define
BOOLEAN_ATTRS
(list
@@ -186,8 +189,10 @@
"reversed"
"selected"))
;; Extensible list of forms treated as definitions
(define *definition-form-extensions* (list))
;; Check if a symbol names a definition form
(define
definition-form?
:effects ()
@@ -203,6 +208,7 @@
(= name "defeffect")
(contains? *definition-form-extensions* name))))
;; Parse keyword attrs and children from element arg list
(define
parse-element-args
:effects (render)
@@ -233,6 +239,7 @@
args)
(list attrs children))))
;; Render attr dict to HTML attribute string
(define
render-attrs
:effects ()
@@ -255,6 +262,7 @@
:else (str " " key "=\"" (escape-attr (str val)) "\""))))
(keys attrs)))))
;; Evaluate cond expression (dispatches to scheme/clojure style)
(define
eval-cond
:effects ()
@@ -265,6 +273,7 @@
(eval-cond-scheme clauses env)
(eval-cond-clojure clauses env))))
;; Scheme-style cond: ((test body) ...)
(define
eval-cond-scheme
:effects ()
@@ -285,6 +294,7 @@
body
(eval-cond-scheme (rest clauses) env)))))))
;; Clojure-style cond: (test body test body ...)
(define
eval-cond-clojure
:effects ()
@@ -303,6 +313,7 @@
body
(eval-cond-clojure (slice clauses 2) env)))))))
;; Evaluate let binding pairs, extend env
(define
process-bindings
:effects (mutation)
@@ -324,6 +335,7 @@
bindings)
local)))
;; Check if an expression should be rendered vs evaluated
(define
is-render-expr?
:effects ()
@@ -350,6 +362,7 @@
(> (len expr) 1)
(= (type-of (nth expr 1)) "keyword")))))))))
;; Merge spread child attrs into parent element attrs
(define
merge-spread-attrs
:effects (mutation)
@@ -385,6 +398,7 @@
(dict-set! target key val)))))
(keys spread-dict))))
;; Escape special chars for HTML text content
(define
escape-html
(fn
@@ -397,4 +411,5 @@
(set! r (replace r "\"" "&quot;"))
r)))
;; Escape special chars for HTML attribute values
(define escape-attr (fn (s) (escape-html s)))