Skip to content

Upgrading handlebars 4 to 5

Breaking4.5.0 → 5.1.2Breaking5New10Changed8Fixed9Other17

Fetching 9 releases from GitHub…3 / 9
BreakingUpgrade verdict

5 breaking changes.

  • Code that reads TemplateError fields directly must switch to accessor methods.
  • Code that names these types with explicit lifetimes may need updating.
  • Render errors now carry a typed reason so code can match on the cause instead of parsing strings.
  • Code calling register_template_directory may need updating for the new signature.
Top 3 of 5 that need code or config changes

Rust requirement changed in 5.1.2: 1.57 → 1.72.

Breaking5
Updates TemplateError to reduce its size and removes direct field access in favor of access methods.
TemplateError
Simplifies lifetime specifiers for Helper, ScopedJson and related types and functions.
HelperScopedJson
Introduces RenderErrorReason for typed render errors.
RenderErrorReasonRenderError
Changes the register_template_directory API for more customizations.
register_template_directory
Simplifies lifetime requirements for Helper and related APIs.
Helper