Import
import { templateToHtmlChunks } from "@typed/template/HtmlChunk";Signatures
export declare function templateToHtmlChunks({ nodes }: Template.Template): readonly HtmlChunk[];Why
Compiling the parsed AST once exposes static output immediately and assigns a context-specific serializer to each dynamic part.
Ownership and lifetime
The returned chunks retain the parsed nodes but own no reactive input. A
RenderTemplate layer may cache them by template-literal identity.
Trust boundary
Dynamic serializers escape data for node, attribute, comment, and text-only contexts; renderer-owned HTML transport remains a separate brand.
Examples
import { templateToHtmlChunks } from "@typed/template/HtmlChunk"
import { parse } from "@typed/template/Parser"
const template = parse(["<div class=\"container\">Hello ", "</div>"])
const chunks = templateToHtmlChunks(template)
// chunks is an array of HtmlChunk objects
// Static parts are pre-rendered as text chunks
// Dynamic parts are represented as part chunksOther public imports
These import paths expose the same declaration. Each page retains its own public name and signature.