diff --git a/package.json b/package.json index 399dba4..522d36d 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,11 @@ "node": ">=24" }, "scripts": { - "test": "node --test packages/core/test/ packages/html/test/" + "test": "node --test packages/core/test/ packages/html/test/ packages/component/test/" }, "repository": "choojs/choo", - "license": "MIT" + "license": "MIT", + "devDependencies": { + "happy-dom": "^20.14.0" + } } diff --git a/packages/html/browser.js b/packages/html/browser.js index 65c97db..0aef7f0 100644 --- a/packages/html/browser.js +++ b/packages/html/browser.js @@ -1,15 +1,265 @@ -// Phase 2 (rendering core) lands here: a runtime-only tagged template that -// parses each template once (keyed by its strings array in a WeakMap) and -// instantiates DOM by cloning. No compile step, ever. +// The v8 browser renderer: a runtime-only tagged template. // -// Until then, importing @choojs/html in a browser build fails loudly rather -// than silently rendering nothing. +// Each unique template literal is parsed once, keyed by its (frozen, +// per-call-site) strings array in a WeakMap: the static parts become a +//