handlebars-rust

Rust templating with Handlebars

MIT License

Downloads
26.7M
Stars
1.2K
Committers
81

Bot releases are hidden (Show)

handlebars-rust - v5.1.0 Latest Release

Published by sunng87 9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/sunng87/handlebars-rust/compare/v5.0.0...v5.1.0

handlebars-rust - v5.0.0

Published by sunng87 10 months ago

5.0.0

A semver major release that introduces some API breaking changes.

Highlights

  • RenderError has been rewritten for typed error reason. In previous versions we use string message for RenderError which is impossible to handle with code. This version introduces RenderErrorReason so you can use match to deal various error reasons.
  • Lifetime in Helper trait has been simplified.

Changes compared to 4.3

  • [Added] public mutable access to local variables in BlockContext [#533]
  • [Changed] Simplified lifetime specifiers for Helper, ScopedJson and some
    other related types and functions. [#532]
  • [Changed] Updated TemplateError to reduce its size. Direct field access is
    removed in favor of access methods
  • [Changed] Introducing RenderErrorReason for typed render error
  • [Changed] Changed register_template_directory api for more customizations
    #[610]
  • [Changed] Updated rust-embed to 8.0

Collaboration Wanted

I'm looking for collaborations to join the development with me on this project. Contact via email if your are interested in.

Auto-generated changelog

New Contributors

Full Changelog: https://github.com/sunng87/handlebars-rust/compare/v4.5.0...v5.0.0

handlebars-rust - v4.3.7

Published by sunng87 over 1 year ago

4.3.7 - 2023-05-11

  • [Fixed] Use fully qualified name of Result in handlebars_helper macro [#578]
  • [Fixed] Allow single-quote JSON literal [#577]
handlebars-rust - v4.3.6

Published by sunng87 almost 2 years ago

[Fixed] Loading template files with multiple extensions, a bug introduced in 4.3.0 when refactoring directory source.

handlebars-rust - v4.3.0

Published by sunng87 over 2 years ago

Changes included in 4.3.0 release:

  • [Changed] update MSRV to 1.57 as rhai requires
  • [Fixed] Reimplemented indent support for partial expression {{> partial}}, which is introduced in 4.2.0. The new implementation is aligned with original javascript version, that every text line generated from partial are indented as {{> partial}} does. prevent_indent will turn-off this feature. [#505]
  • [Changed] changed error support library from quick_error to thiserror

Caution that the partial indent fix will make handlebars 4.3 behaviour different with 4.2 when there is indent with {{> partial}} statement.

handlebars-rust - v4.2.1

Published by sunng87 over 2 years ago

Fixed

  • Nested partial @partial-block referencing issue [#488]
  • Docs generation on docs.rs for rust-embed feature
handlebars-rust - v4.2.0

Published by sunng87 almost 3 years ago

Added

  • RustEmbed support for loading templates from [#484]

Fixed

  • Parser support for variables begins with digit [#479]
  • Typo in Debug impl of Handlebars [#485 ]

Changed

  • Keep indent whitespaces for partial expression {{> partial}} as default in handlebarsjs. A new option prevent_indent is provided on Handlebars to turn off this behaviour. [#486]
  • Update MSRV to 1.51 due to dependency changes
handlebars-rust - v4.1.5

Published by sunng87 almost 3 years ago

[Fixed] Single-quote string literal is supported, again [#475]

handlebars-rust - v4.1.4

Published by sunng87 almost 3 years ago

  • [Fixed] Corrected empty line stripping strategy [#473]
handlebars-rust - v4.1.3

Published by sunng87 about 3 years ago

  • [Added] @last variable for each block with object [#466]
  • [Fixed] Missing whitespaces behind expression [#468]
handlebars-rust - v4.1.2

Published by sunng87 about 3 years ago

Added

  • Support for generic types in handlebars_helper!.
  • Getter and setter for rhai Engine from registry.

Fixed

  • Improve doc for dev_mode that it has to be enabled before adding templates.
handlebars-rust - v4.1.1

Published by sunng87 about 3 years ago

  • [Changed] Update rhai to 1.0 [#455]
  • [Fixed] Empty line stripping for partial include statement, and other corner cases [#458]
handlebars-rust - v4.1.0

Published by sunng87 over 3 years ago

Detailed Changelog

  • [Added] export StringOutput as requested in #442
  • [Changed] strict mode now applies to our helper macro handlebars_helper! and built-in helpers based on it.
  • [Fixed] Line stripping feature for standalone statement introduced in #404 is now aligned with handlebarsjs. #448
handlebars-rust - v4.0.0

Published by sunng87 over 3 years ago

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]
handlebars-rust -

Published by sunng87 over 3 years ago

v3.5.3

[Fixed] value access issue when upper block has a base value [#419]

handlebars-rust - v3.5.1

Published by sunng87 almost 4 years ago