Import
import { addTemplateHash } from "@typed/template";Signatures
export declare function addTemplateHash(chunks: ReadonlyArray<HtmlChunk>, { hash }: Template.Template): ReadonlyArray<HtmlChunk>;Why
Versioned boundary comments let the DOM renderer locate the exact SSR range corresponding to a compiled template without claiming unrelated nodes.
Ownership and lifetime
This pure transformation returns a new chunk sequence. Marker adoption and fallback are owned later by the hydration Scope.
Examples
import { addTemplateHash, templateToHtmlChunks } from "@typed/template/HtmlChunk"
import { parse } from "@typed/template/Parser"
const template = parse(["<div>Hello</div>"])
const chunks = templateToHtmlChunks(template)
const chunksWithHash = addTemplateHash(chunks, template)
// chunksWithHash will have template hash comments added
// for hydration purposesOther public imports
These import paths expose the same declaration. Each page retains its own public name and signature.