Files
buuh/packages/html/package.json
T
Bendik Aagaard LynghaugandClaude Fable 5 84230b1770 feat(html): browser renderer — runtime-cached tagged templates
Each template literal parses once, keyed by its strings array in a
WeakMap: static parts become a <template> with hole markers, renders
clone and fill. Interpolated values never pass through innerHTML (child
values become text nodes or adopted DOM; attributes go through
setAttribute). Event handlers set as properties so nanomorph copies them.
Document-level roots (<body>/<head>/<html>) parse via DOMParser because
<template> drops them. Replaces the v7 browserify transform entirely —
production speed is now a runtime property.

Tests run in happy-dom (new devDependency), including a check that server
and browser renderers serialize identical markup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014NgfSjHE11oFpoSnLVKLXd
2026-09-08 16:56:53 +02:00

34 lines
669 B
JSON

{
"name": "@choojs/html",
"version": "8.0.0-dev",
"description": "HTML template literals that render to DOM in the browser and strings on the server",
"type": "module",
"exports": {
".": {
"browser": "./browser.js",
"default": "./server.js"
},
"./browser": "./browser.js",
"./server": "./server.js",
"./raw": "./raw.js",
"./morph": "./morph.js"
},
"files": [
"browser.js",
"server.js",
"raw.js",
"morph.js"
],
"engines": {
"node": ">=24"
},
"repository": "choojs/choo",
"keywords": [
"html",
"template",
"tagged-template",
"server-side-rendering"
],
"license": "MIT"
}