Skip to content

Commit 400e38d

Browse files
committed
Start drafting changelog (unfinished)
1 parent 77e82d3 commit 400e38d

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,34 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
55

6-
## [1.0.0] AST Compiler - 2026-02-25
6+
## [1.0.0] AST Compiler - 2026-03-16
7+
78
### Added
8-
- Replaced
9+
- Rewrote the parser and compiler using a proper AST, based on the same lexical analysis and grammar specification used by Handlebars.js. This eliminates a large class of edge cases and parsing bugs that the old regex-based approach failed to handle correctly.
10+
- `helperMissing` and `blockHelperMissing` hooks: register these as runtime helpers to handle calls to unknown helpers, replacing the old `helperResolver` option.
11+
- `assumeObjects` compile option: intermediate path segments are required to exist, but terminal segments may be absent. Produces leaner compiled output than full strict mode.
12+
- `knownHelpers` compile option: tells the compiler which helpers will be registered at runtime, enabling more efficient code generation. `knownHelpersOnly` now works as in Handlebars.js — unknown helpers are dropped entirely rather than emitting a dynamic fallback.
13+
- Precompiled partial support: the `partials` runtime option now accepts `Closure` values in addition to template strings, so partials can be pre-compiled once and reused across renders.
14+
- Lambda support for data variables: when a value in the render context is a `Closure`, it is now invoked with the current scope and its return value used, matching Handlebars.js lambda semantics.
15+
- Scoped path syntax (`{{./value}}`, `{{this/value}}`) now correctly bypasses block params and helper lookup, resolving directly from the current context.
16+
- Block statements with pathed or depth-relative paths and explicit params (e.g. `{{#../helper param}}`) are now compiled correctly.
17+
18+
### Changed
19+
- All helpers must now be passed at render time via the `helpers` key in the options array. The `helpers` compile option on `Options` has been removed. This matches Handlebars.js behavior, allows helper closures to be shared across templates, and eliminates the overhead of reading and tokenizing PHP helper files at compile time.
20+
- The `partialResolver` closure signature no longer receives a `Context` argument - only the partial name is passed.
21+
- `HelperOptions::$data` references the current `@`-variable frame (`@index`, `@key`, `@first`, `@last`, `@root`). Mutations to `$options->data['root']` propagate back to the top-level context.
22+
23+
### Fixed
24+
- Inline partials defined inside a `{{#with}}` or other block no longer leak out of that block's scope after the block closes.
25+
- Context mutations made by custom helpers via `options.fn(newContext)` are now correctly applied to the rendered output.
26+
- Block param scoping for nested custom block helpers.
27+
- Closure arguments passed to built-in helpers (`{{#if (myHelper)}}`) are now evaluated correctly.
28+
- Context handling within `{{#each}}` iterations when the iterated value is modified.
29+
- Conditional `@partial-block` expressions now render correctly.
30+
31+
### Removed
32+
- `Options::$helpers` - pass helpers at runtime instead.
33+
- `Options::$helperResolver` - use `helperMissing` / `blockHelperMissing` runtime helpers instead.
934

1035

1136
## [0.9.9] Stringable Conditions - 2025-10-15

0 commit comments

Comments
 (0)