Step 18 (part 5): _hyperscript runtime shims — 25 functions

lib/hyperscript/runtime.sx — thin wrappers over web/lib/dom.sx
primitives implementing hyperscript-specific semantics:

Event handling: hs-on, hs-on-every, hs-init
Async/timing: hs-wait (IO suspend), hs-wait-for, hs-settle
Classes: hs-toggle-class!, hs-toggle-between!, hs-take!
DOM insertion: hs-put! (into/before/after)
Navigation: hs-navigate!, hs-next, hs-previous, hs-query-first/last
Iteration: hs-repeat-times, hs-repeat-forever
Fetch: hs-fetch (json/text/html format dispatch)
Type coercion: hs-coerce (Int/Float/String/Boolean/Array)
Object creation: hs-make (Object/Array/Set/Map)
Behaviors: hs-install
Measurement: hs-measure
Transitions: hs-transition (CSS property + optional duration)

23 runtime + 7 end-to-end pipeline tests.
3099/3099 full build, zero regressions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 08:40:55 +00:00
parent c5d2fa8c96
commit 9a57bd5beb
3 changed files with 394 additions and 0 deletions

View File

@@ -1312,6 +1312,7 @@ let run_spec_tests env test_files =
load_module "tokenizer.sx" hs_dir;
load_module "parser.sx" hs_dir;
load_module "compiler.sx" hs_dir;
load_module "runtime.sx" hs_dir;
load_module "types.sx" lib_dir;
load_module "sx-swap.sx" lib_dir;
(* Shared templates: TW styling engine *)