Skip to content

v4.0.0

Compare
Choose a tag to compare
@sunng87 sunng87 released this 25 May 14:38
· 515 commits to master since this release
v4.0.0
bb68f45

4.0 Highlights

Development mode

4.0 brings in dev_mode to Handlebars. By turning on dev_mode, templates loaded from files or directories are auto-reloaded
each time. This makes development workflow more fluent.

Performance improvement

4.0 provides up to 20% performance boost compared to 3.x.

Bugfixes

Several corner cases were fixed in this release. Some has already been backported on to 3.x branch.

Detailed Changelog

  • [Added] dev_mode for registry: templates and scripts loaded from file are always
    reloaded when dev mode enabled [#395]
  • [Added] Registry is now Clone [#395]
  • [Added] New built-in helper len [#421]
  • [Changed] Updated rhai to 0.19 and then 0.20 [#391]
  • [Changed] #each helper now renders else block for non-iterable data [#380]
  • [Changed] TemplateError and ScriptError is now a cause of RenderError [#395]
  • [Changed] Empty lines around block helpers are now stripped [#404]
  • [Changed] Breaking RenderContext::get_partial now returns Option<&Template>
  • [Changed] Breaking Capitalize names like HtmlExpression and IoError based on clippy recommendations [#424]
  • [Changed] Breaking Improved return type of call_inner from HelperDef to avoid misleading [#437]
  • [Fixed] reference starts with null, true and false were parsed incorrectly [#382]
  • [Fixed] dir source path separator bug on windows [#389] [#405]
  • [Fixed] stack overflow with nested @partial-block [#401]
  • [Fixed] value access issue when upper block has a base value [#419]
  • [Fixed] escape rules for Json string literal [#423]
  • [Fixed] Breaking zero-arity subexpressions support [#433] Zero-arity subexpression no longer resolved as variable. The behaviour is now aligned with handlebarsjs.
  • [Removed] Breaking option to disable source map is removed [#395]
  • [Removed] Breaking TemplateFileError and TemplateRenderError are removed and merged into
    TemplateError and RenderError [#395]