Restore hyperscript work on stable site base (908f4f80)

Reset to last known-good state (908f4f80) where links, stepper, and
islands all work, then recovered all hyperscript implementation,
conformance tests, behavioral tests, Playwright specs, site sandbox,
IO-aware server loading, and upstream test suite from f271c88a.

Excludes runtime changes (VM resolve hook, VmSuspended browser handler,
sx_ref.ml guard recovery) that need careful re-integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 19:29:56 +00:00
parent 908f4f80d4
commit 7492ceac4e
55 changed files with 32933 additions and 437 deletions

View File

@@ -80,7 +80,11 @@ const FILES = [
'dom.sx', 'browser.sx', 'adapter-html.sx', 'adapter-sx.sx', 'adapter-dom.sx',
'tw-layout.sx', 'tw-type.sx', 'tw.sx',
'boot-helpers.sx', 'hypersx.sx', 'harness.sx', 'harness-reactive.sx',
'harness-web.sx', 'engine.sx', 'orchestration.sx', 'boot.sx',
'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',
'boot.sx',
];
@@ -339,6 +343,18 @@ function libKey(spec) {
return spec.replace(/^\(/, '').replace(/\)$/, '');
}
// Extract top-level (define name ...) symbols from a non-library file
function extractDefines(source) {
const names = [];
const re = /^\(define\s+(\S+)/gm;
let m;
while ((m = re.exec(source)) !== null) {
const name = m[1];
if (name && !name.startsWith('(') && !name.startsWith(':')) names.push(name);
}
return names;
}
const manifest = {};
let entryFile = null;
@@ -360,6 +376,18 @@ for (const file of FILES) {
} else if (deps.length > 0) {
// Entry point (no define-library, has imports)
entryFile = { file: sxbcFile, deps: deps.map(libKey) };
} else {
// Non-library file (e.g. hyperscript modules) — extract top-level defines
// as exports so the transparent lazy loader can resolve symbols to files.
const defines = extractDefines(src);
if (defines.length > 0) {
const key = file.replace(/\.sx$/, '');
manifest[key] = {
file: sxbcFile,
deps: [],
exports: defines,
};
}
}
}