Skip to content

Handlebars: explore template compilation #1098

@alandefreitas

Description

@alandefreitas

Templates are interpreted on every render. We miss opportunities to preprocess whitespace, comments, and block boundaries, which makes debugging harder.

Proposed solution

  • Add a compilation pass that generates an intermediate representation.
  • Pre-trim whitespace, strip comments, and resolve block boundaries up front.
  • Update the renderer to iterate over compiled tags (adapt OutputRef if needed).
  • Measure performance vs. the interpreted approach.

Requirements

  • Compiled templates produce identical output.
  • Performance measurements document the gains.
  • Debugging workflows improve (parsing/rendering separated).
  • Documentation explains how to compile templates.

Note
Plan to migrate this issue to the standalone Handlebars repository once it is ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions