Two fixes for sx-browser.js (spec-compiled) vs sx.js (hand-written):
1. CSS meta tag mismatch: initCssTracking read meta[name="sx-css-hash"]
but the page template uses meta[name="sx-css-classes"]. This left
_cssHash empty, causing the server to send ALL CSS as "new" on every
navigation, appending duplicate rules that broke Tailwind responsive
ordering (e.g. menu bar layout).
2. Stale verb info after morph: execute-request used captured verbInfo
from bind time. After morph updated element attributes (e.g. during
OOB nav swap), click handlers still fired with old URLs. Now re-reads
verb info from the element first, matching sx.js behavior.
Also includes: render-expression dispatch in eval.sx, NIL guard for
preload cache in bootstrap_js.py, and helpers.py switched to
sx-browser.js.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split monolithic render.sx into core (tag registries, shared utils) plus
four adapter .sx files: adapter-html (server HTML strings), adapter-sx
(SX wire format), adapter-dom (browser DOM nodes), and engine (SxEngine
triggers, morphing, swaps). All adapters written in s-expressions with
platform interface declarations for JS bridge functions.
Bootstrap compiler now accepts --adapters flag to emit targeted builds:
-a html → server-only (1108 lines)
-a dom,engine → browser-only (1634 lines)
-a html,sx → server with SX wire (1169 lines)
(default) → all adapters (1800 lines)
Fixes: keyword arg i-counter desync in reduce across all adapters,
render-aware special forms (let/if/when/cond/map) in HTML adapter,
component children double-escaping, ~prefixed macro dispatch.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Meta-circular evaluator: the SX language specifying its own semantics.
A thin bootstrap compiler per target (JS, Python, Rust) reads these
.sx files and emits a native evaluator.
Files:
- eval.sx: Core evaluator — type dispatch, special forms, TCO trampoline,
lambda/component/macro invocation, higher-order forms
- primitives.sx: Declarative specification of ~80 built-in pure functions
- render.sx: Three rendering modes (DOM, HTML string, SX wire format)
- parser.sx: Tokenizer, parser, and serializer specification
Platform-specific concerns (DOM ops, async I/O, HTML emission) are
declared as interfaces that each target implements.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>