Skip to content

Releases: Handlebars-Net/Handlebars.Net

2.0.0-rc-1

02 Dec 21:23
d707cc9

Choose a tag to compare

2.0.0-rc-1 Pre-release
Pre-release

Changes

Features 🚀

  • Introduce AmbientContext @zjklee (#391)

    What's inside:

    • Introduce AmbientContext
    • Move PathInfo and related classes to a separate namespace
    • Improve GC-friendliness: PathInfoStore and ChainSegmentStore are now associated with the compiled template instead of being static
  • Introduce value formatters @zjklee (#390)

    What's inside:

    • support for custom value formatters

    Issues:

  • Expose inner interfaces in configuration @zjklee (#388)

    What's inside:

    • Extend existing and introduce new interfaces.
      This is done to expose only required APIs and trim internal collections implementation.
    • Improve and trim implementations of internal collections.
    • Improve PathInfo and ChainSegment parsing.

Bug Fixes 🐛

  • Use ParentContext when handling @partial-block @zjklee (#386)

    Closes /issues/383

Breaking change ⛔

  • Introduce value formatters @zjklee (#390)

    • changes to ITextEncoder interface
    • use ISO 8601 formatting for DateTime
  • Expose inner interfaces in configuration @zjklee (#388)

    • Replace default collection interfaces by local equivalents. This is done to trim API surface.
  • Introduce Context type @zjklee (#385)

    • context parameters is no longer dynamic
    Handlebars.RegisterHelper("link_to", (writer, context, parameters) => {
        writer.WriteSafeString("<a href='" + (string)context.url + "'>" + (string)context.text + "</a>");
    });

    Is changed to:

    Handlebars.RegisterHelper("link_to", (writer, context, parameters) => 
    {
        writer.WriteSafeString($"<a href='{context["url"]}'>{context["text"]}</a>");
    });

Contributors

@perlun, @sferencik, @zjklee

2.0.0-preview-2

06 Nov 17:42
93625bf

Choose a tag to compare

2.0.0-preview-2 Pre-release
Pre-release

Changes

Features 🚀

  • Introduce IIterator @zjklee (#381)

    What's inside:

    • Introduces IIterator interface
    • Extends ObjectDescriptor with iterator definition

    Issues:

  • Introduce HelperOptions to Helper and ReturnHelper @zjklee (#378)

    What's inside:

    • Introduce HelperOptions to Helper and ReturnHelper

    Issues:

  • @data and noEscape @zjklee (#375)

    What's inside:

    • support for @data being passed to compiled template
    • support noEscape configuration

    Issues:

Bug Fixes 🐛

Breaking change ⛔

  • Introduce HelperOptions Helper and ReturnHelper @zjklee (#378)

    • HelperOptions struct in block helpers renamed to BlockHelperOptions
  • @data and noEscape @zjklee (#375)

    • changed public API types in several places, semantic is still more or less the same

Performance 🐌

  • @data and noEscape @zjklee (#375)

    • improved overall performance (2x - 3x faster)
    • improved memory management (3x - 5x less memory allocations)

Contributors

@zjklee

2.0.0-preview-1

26 Oct 15:19
ec841d1

Choose a tag to compare

2.0.0-preview-1 Pre-release
Pre-release

Changes

Features 🚀

Performance 🐌

  • Infrastructure improvements @zjklee (#371)

    • Rework helper registration to use pub/sub approach
    • Improve path resolver performance
  • Merging fork into trunk @zjklee (#359)

    • global refactoring (without breaking changes to the public API)
    • improvements to extensibility
    • performance improvements (depends on template complexity):
        - 2-10x compilation time improvement 
        - 2-10x execution time improvement 
        - up to 20x less memory consumption during compilation and execution

Performance insights

BenchmarkDotNet=v0.12.1, OS=ubuntu 18.04
Intel Xeon CPU E5-2673 v3 2.40GHz, 1 CPU, 2 logical and 2 physical cores
.NET Core SDK=3.1.201
  [Host]    : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT
  MediumRun : .NET Core 3.1.3 (CoreCLR 4.700.20.11803, CoreFX 4.700.20.12001), X64 RyuJIT

Job=MediumRun  Toolchain=.NET Core 3.1  IterationCount=15  
LaunchCount=1  WarmupCount=10  
1.11.5
Type Method N DataType Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
Compilation Template ? ? 38,094,313.9 ns 1,115,210.08 ns 988,604.69 ns 307.6923 153.8462 - 5858226 B
EndToEnd Default 5 dictionary 3,874,438.3 ns 47,403.74 ns 39,584.27 ns 70.3125 - - 1159649 B
EndToEnd Default 5 object 3,860,625.3 ns 130,069.50 ns 115,303.22 ns 66.4063 - - 1082011 B
Current
Type Method N DataType Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
Compilation Template ? ? 19,088,174.6 ns 260,500.05 ns 243,671.91 ns 31.2500 - - 843775 B
EndToEnd Default 5 dictionary 247,534.3 ns 3,965.39 ns 3,515.22 ns 2.6855 - - 52824 B
EndToEnd Default 5 object 268,289.3 ns 2,915.08 ns 2,584.14 ns 2.4414 - - 52827 B

Contributors

@zjklee

1.11.5

10 Oct 00:39
c86f135

Choose a tag to compare

Changes

  • Minor improvements to path handling and access @alexdawes (#333)

    Ensure that path breaking respects square bracket escape characters so that objects with keys like foo.bar can be accessed using {{ [foo.bar] }} (#328)

    Give preference to string index property getters if one exists, to avoid classes that implement IEnumerable<object> whilst also having a string indexer (most notably JObject) from being unable to be used with numeric keys. (#329)

    Only trim a single pair of square brackets from the key, and only if both exist ([ at start of key and ] at end)

  • #243: Support @last for properties enumeration @zjklee (#330)

    The PR adds support for @last property for properties enumeration.
    Originally raised in #243 issue.

  • Literals should be the correct type when passed as arguments to helpers @pmccloghrylaing (#319)

    Closes #298

  • Added tests and improved allocations for HtmlEncoder @304NotModified (#313)

    As the HtmlEncoder is an important thing when rendering, I added some tests for the coverage and improved the allocations, no need to allocate a stringbuilder and new string if no encoding needs to be done :)

  • Added support for implicit interface implementation for dictionaries @304NotModified (#315)

    Fixes #239

  • Added XML docs to NuGet package @304NotModified (#312)

    Maybe there isn't much XML docs in the package, but now it's more useful as users will see the XML docs when using the API ;)

  • Added NuGet badge @304NotModified (#311)

    Added NuGet badge which shows the latest version number

  • Added sample helper unit test for conditional if @hungquach (#234)

Contributors

@304NotModified, @Magentaize, @alexdawes, @el2iot2, @hmflash, @hungquach, @huysentruitw, @jchannon, @jokin, @lacutah, @leekelleher, @leniency, @lot224, @mikeprince3, @mohd-akram, @nblumhardt, @pmccloghrylaing, @rexm, @sganz, @stephengeorgewest-navitaire, @uffebjorklund, @vzwick, @zjklee

v1.9.0

16 May 23:59

Choose a tag to compare

Get the binaries via NuGet:

nuget install Handlebars.Net

Version 1.9.0 is a significant update that includes the following:

  • Support for .NET Standard 1.3, as well as back compatibility to .NET 4.0
  • Lots of fixes for parsing edge cases, complex paths and arguments
  • Better troubleshooting support with clearer exception messages

Big thanks to @jchannon, @devlead, @axelheer, @vzwick, @asiffermann, @StefH, @Andrew-Hanlon, @SimonCropp, @abraham-fox, @katavasha, @JvanderStad, @EBMike, and @mikeofireland for their contributions and helping modernize Handlebars.Net!

v1.2

18 Jan 23:27

Choose a tag to compare

Version 1.2 includes a number of bug fixes, performance improvements, and new features:

Get the binaries via NuGet:

nuget install Handlebars.Net

v1.0

30 Nov 18:15

Choose a tag to compare

Version 1.0 is finally out of beta and in release! Grab it via NuGet:

nuget install Handlebars.Net