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);
}

File diff suppressed because one or more lines are too long

View File

@@ -1062,6 +1062,75 @@
"hs-boot-subtree!"
]
},
"hs-htmx": {
"file": "hs-htmx.sxbc",
"deps": [
"hs-tokenizer",
"hs-parser",
"hs-compiler",
"hs-runtime",
"hs-integration"
],
"exports": [
"HX-CONFIG-DEFAULTS",
"HX-REQUEST-CLASS",
"url-encode-params",
"sx-url-with-params",
"hx-element-config",
"hx-walk-inherited",
"hx-resolve-attr",
"hx-verb-info",
"hx-default-trigger",
"hx-parse-time",
"hx-parse-trigger",
"hx-resolve-target",
"hx-normalize-swap-mode",
"hx-parse-swap-spec",
"hx-swap!",
"hx-select-fragment",
"hx-element-source-id",
"hx-form-values",
"hx-collect-params",
"hx-build-headers",
"hx-request",
"hx-process-oob!",
"hx-process-partials!",
"hx-parse-status-modifiers",
"hx-status-matches?",
"hx-parse-status-rules",
"hx-match-status",
"hx-handle-history!",
"hx-indicator-on!",
"hx-indicator-off!",
"hx-disable-inputs!",
"hx-enable-inputs!",
"hx-confirm?",
"hx-validate-form?",
"hx-parse-sync-spec",
"hx-sync-resolve-target",
"hx-sync-check!",
"hx-sync-complete!",
"hx-dispatch!",
"hx-strip-outer",
"hx-do-swap",
"hx-make-handler",
"hx-wrap-debounce",
"hx-wrap-throttle",
"hx-wrap-changed",
"hx-register-trigger!",
"htmx-activate!",
"HX-VERB-SELECTORS",
"htmx-boot!",
"hx-preload-cache",
"hx-preload-register!",
"hx-parse-sse-swap",
"hx-sse-connect!",
"htmx-boot-subtree!",
"hx-boost-link!",
"hx-boost-form!",
"hx-boost-subtree!"
]
},
"_entry": {
"file": "boot.sxbc",
"deps": [
@@ -1083,7 +1152,8 @@
"hs-parser",
"hs-compiler",
"hs-runtime",
"hs-integration"
"hs-integration",
"hs-htmx"
]
}
}