Template parsing
parsefunction
Parses a template string array (from a tagged template literal) into a reusable
Templateobject.This parser handles:
- Standard HTML structure (elements, attributes, text, comments).
- Custom part syntax for interpolation (e.g.,
${value}). - Special attributes like
.property,@event,?boolean. - Self-closing tags and text-only elements (script, style).
Each call returns a new
Templateinstance containing the static AST and dynamic part locations. Render targets cache their compiled DOM fragments or HTML chunks independently by template-literal identity.