Skip to content

Releases: devtheorem/php-handlebars-parser

2.0.0 - Stateless Parser

02 Apr 16:40

Choose a tag to compare

Changed

  • Moved the optional ignoreStandalone parameter from ParserFactory::create() to the Parser::parse() method. This makes the parser instance independent of options so it can be reused when compiling multiple templates, enabling better performance and lower memory usage.

1.1.2

01 Apr 15:27

Choose a tag to compare

Fixed

Changed

  • Optimized parser slightly by replacing a few unnecessary preg_match calls.

1.1.1

24 Mar 18:08

Choose a tag to compare

Fixed

  • Parsing of SubExpressions that are PathExpression roots.

1.1.0 - 30x faster lexer

25 Feb 01:38

Choose a tag to compare

This release will be the foundation for PHP Handlebars 1.0.

Changed

  • Optimized position tracking to avoid per-token full-text rescans.
  • Made use of the preg_match() offset parameter and \G anchor to avoid per-token string allocations.
  • Combined alternation pattern per state: replaced N separate preg_match() calls (one per rule) with a single call against a per-state /\G(?:(rule0)|(rule1)|...)/ pattern, letting PCRE try all alternatives in one pass.

Added

  • Benchmark to test parsing a large, complex template 1000 times.

In this release, parsing a complex, 13 KB Handlebars template is now about 30x faster than in v1.0.0.

1.0.0

20 Feb 15:33

Choose a tag to compare

The full Handlebars.js grammar, whitespace control, and parse error handling is now implemented in native PHP.