Step 18 (part 6): _hyperscript integration — _="..." attribute wiring
lib/hyperscript/integration.sx — connects compiled hyperscript to DOM: hs-handler(src) — compile source → callable (fn (me) ...) via eval-expr-cek hs-activate!(el) — read _="...", compile, execute with me=element hs-boot!() — scan document for [_] elements, activate all hs-boot-subtree!(root) — activate within subtree (for HTMX swaps) Handler wraps compiled SX in (fn (me) (let ((it nil) (event nil)) ...)) so each element gets its own me binding and clean it/event state. Double-activation prevented via data-hs-active marker. 12 integration tests verify full pipeline: source → compile → eval. Handlers correctly bind me, support arithmetic, conditionals, sequences, for loops, and repeat. 3111/3111 full build, zero regressions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1313,6 +1313,7 @@ let run_spec_tests env test_files =
|
||||
load_module "parser.sx" hs_dir;
|
||||
load_module "compiler.sx" hs_dir;
|
||||
load_module "runtime.sx" hs_dir;
|
||||
load_module "integration.sx" hs_dir;
|
||||
load_module "types.sx" lib_dir;
|
||||
load_module "sx-swap.sx" lib_dir;
|
||||
(* Shared templates: TW styling engine *)
|
||||
|
||||
Reference in New Issue
Block a user