Add hs-htmx module to WASM build — htmx activation was missing

The htmx-boot-subtree! function (defined in lib/hyperscript/htmx.sx)
was never loaded in the browser because hs-htmx.sx wasn't in the
bundle or compile-modules lists. Added to:
- bundle.sh: copy htmx.sx as hs-htmx.sx to dist
- compile-modules.js: compile to hs-htmx.sxbc, add to deps and lazy list

This was the root cause of "Load Content" button not working —
hx-* attributes were never activated because htmx-boot-subtree!
was undefined.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-18 07:21:41 +00:00
parent 444cd1ea70
commit de90cd04f2
4 changed files with 76 additions and 5 deletions

View File

@@ -72,7 +72,7 @@ cp "$ROOT/shared/sx/templates/tw-type.sx" "$DIST/sx/"
cp "$ROOT/shared/sx/templates/tw.sx" "$DIST/sx/"
# 10. Hyperscript
for f in tokenizer parser compiler runtime integration; do
for f in tokenizer parser compiler runtime integration htmx; do
cp "$ROOT/lib/hyperscript/$f.sx" "$DIST/sx/hs-$f.sx"
done

View File

@@ -85,7 +85,7 @@ const FILES = [
'harness-web.sx', 'engine.sx', 'orchestration.sx',
// Hyperscript modules — loaded on demand via transparent lazy loader
'hs-tokenizer.sx', 'hs-parser.sx', 'hs-compiler.sx', 'hs-runtime.sx',
'hs-integration.sx',
'hs-integration.sx', 'hs-htmx.sx',
'boot.sx',
];
@@ -456,6 +456,7 @@ for (const file of FILES) {
'hs-compiler': ['hs-tokenizer', 'hs-parser'],
'hs-runtime': ['hs-tokenizer', 'hs-parser', 'hs-compiler'],
'hs-integration': ['hs-tokenizer', 'hs-parser', 'hs-compiler', 'hs-runtime'],
'hs-htmx': ['hs-tokenizer', 'hs-parser', 'hs-compiler', 'hs-runtime', 'hs-integration'],
};
manifest[key] = {
file: sxbcFile,
@@ -476,7 +477,7 @@ if (entryFile) {
const lazyDeps = entryFile.deps.filter(d => LAZY_ENTRY_DEPS.has(d));
// Hyperscript modules aren't define-library, so not auto-detected as deps.
// Load them lazily after boot — eager loading breaks the boot sequence.
const HS_LAZY = ['hs-tokenizer', 'hs-parser', 'hs-compiler', 'hs-runtime', 'hs-integration'];
const HS_LAZY = ['hs-tokenizer', 'hs-parser', 'hs-compiler', 'hs-runtime', 'hs-integration', 'hs-htmx'];
for (const m of HS_LAZY) {
if (manifest[m] && !lazyDeps.includes(m)) lazyDeps.push(m);
}