Skip to content

Releases: Handlebars-Net/Handlebars.Net

2.2.0

Choose a tag to compare

@rexm rexm released this 26 Jun 15:12
68ce889

Handlebars.Net 2.2.0

⚠️ Behavior & compatibility changes — please read before upgrading

  • Dropped end-of-life target frameworks. Removed netstandard1.3, net451, and net6. The package now targets netstandard2.0, netstandard2.1, and net8.0. Modern consumers (.NET Framework 4.6.1+, .NET Core 2.0+, .NET 5/8+) are unaffected via netstandard2.0; only consumers on the removed legacy frameworks need to stay on 2.1.x.
  • Single quote (') is now HTML-encoded by default (#546), matching Handlebars.js behavior. This is invisible when rendering HTML, but changes raw output bytes — review any exact-string or snapshot assertions on rendered output.

Bug fixes

  • Case-sensitive resolution of same-spelling path variables, resolved independently in PathBinder (#434)
  • Case-sensitive key lookup for IDictionary/Hashtable (#521) and DictionaryMemberAccessor (#466)
  • @partial-block now usable inside #if and as a block partial (#519)
  • #if with includeZero=true now supported; includeZero honored in built-in conditional blocks (#285)
  • Parent context traversal inside custom block helpers within #each (#539)
  • Safe-string flag preserved when helper output crosses a subexpression boundary (#543)
  • WriteSafeString encoding consistent regardless of helper registration order (#559)
  • Preserve backslashes in template literal text (#462) and double backslashes in static text (#349)
  • Preserve partial indentation (#614)
  • Handle escaped double-quotes in delimited string literal arguments (#584)
  • Allow Unicode letters as first character in identifiers (#416); strip invisible Unicode chars (BOM, etc.) from identifiers (#605)
  • Clearer error when a partial is registered on the wrong Handlebars instance (#545)
  • Removed byref/in delegate parameters incompatible with Mono/Xamarin (#458)
  • Prevent unbounded DictionarySlim growth when replacing existing keys (#541)
  • Normalize CRLF to LF in StaticConverter for platform-independent output

Maintenance

  • CI moved to windows-latest; bumped deprecated GitHub Actions and SDK versions; pinned third-party actions to commit SHAs
  • Resolved SonarCloud security/quality findings; dev environment updated to .NET 10
  • Added render-time/compile-scaling benchmark suite and Handlebars.js regression coverage

2.1.6

Choose a tag to compare

@github-actions github-actions released this 03 Apr 23:04
9cf1672

Changes

Maintenance 🧰

  • Added in missing SDK's for release @thompson-tomo (#579)

    Added in required sdk's for the release build which was missed in #578

  • Update of TFM & dependency optimisation @thompson-tomo (#578)

    By adjusting the TFM'S we have been able to produce a package with no dependencies on the latest frameworks hence an optimised dependency graph.

    The following frameworks have been added:

    • Net 6

    The following frameworks even though requested was not added:

    • Net 5

    The following frameworks were removed:

    • Net 4.5.2
    • Net 4.6

    Closes: #573
    Closes: #415

Contributors

@oformaniuk and @thompson-tomo

2.1.5

Choose a tag to compare

@github-actions github-actions released this 01 Apr 02:32
bed0c0e

Changes

Features 🚀

  • Add EmbedUntrackedSources @lahma (#570)

    I would also suggest changing to use newer GH Actions images for building so that other warnings would go away (old SDK in use). Maybe another modernization step could be removing old unsupported full framework targets and only support oldest supported net462. Adding net6.0 target would allow one target without dependency on Microsoft.Csharp.

  • Use PackageLicenseExpression in NuGet package @StefH (#564)

Bug Fixes 🐛

  • Introduce PartialRecursionDepthLimit @RoosterDragon (#552)

    When evaluating templates with partials, it is possible to recurse in the evaluation of those partials. This can be useful for dealing with tree like data, such as rendering a list of friends-of-friends-of-friends-of-etc....

    The ability to recurse can lead to stack overflows. For example if a sufficiently deep tree is provided as input data, or more simply if the partial calls itself in an infinite loop. As a stack overflow terminates the process, this is not desirable behaviour as it is an unavoidable crash.

    To resolve this a configurable PartialRecursionDepthLimit is introduced, defaulting to 100. Now when a template is evaluated a HandlebarsRuntimeException will be thrown if this limit is reached. This allows the caller to catch the exception and recover gracefully, rather than terminating the process.

  • Allow slashes properly within escape blocks @Hoeksema (#567)

    closes #566

    The path parsing currently doesn't work properly when there are embedded slashes within an ignore block.

    This PR fixes this issue:

    • No more exceptions thrown when using // within an escaped block
    • Allowing multiple / to occur within an escape block without breakage

    Before, the individual segments between slashes in addition to the entire escaped block were returned by PathInfo. Now, it returns just the latter, which is correct. All existing unit tests still pass and new tests were added to exercise the failing cases in #566.

  • Throw properly on open ignore block instead of crashing @Hoeksema (#569)

    Closes #568

    Resolve the hang on compile when there is an open ignore block

    Reshuffle the logic so that the throw check for end of template is done before trying to process the char

  • Fix LiteralConverter to support long @StefH (#562)

Maintenance 🧰

Contributors

@Hoeksema, @RoosterDragon, @StefH, @lahma, @oformaniuk and @thompson-tomo

2.1.4

Choose a tag to compare

@github-actions github-actions released this 04 Mar 07:24
50614fd

Features 🚀

  • Add optional 3rd argument to lookup helper @StefH (#542)

Contributors

@StefH

2.1.3

Choose a tag to compare

@github-actions github-actions released this 15 Feb 00:03
3585d29

Changes

Contributors

@Nisden, @anth12, @rexm, @zjklee and Anthony Halliday

2.1.2

Choose a tag to compare

@github-actions github-actions released this 07 Apr 06:58
e6e4d53

Changes

Bug Fixes 🐛

  • Nested partial block receives correct context @zjklee (#516)

    Nested partial block receives correct context

    Issues:

Contributors

@zjklee

2.1.1

Choose a tag to compare

@github-actions github-actions released this 26 Mar 18:36
e709aa9

Changes

  • Update readme.md to include extra projects @StefH (#509)

Features 🚀

  • Introduce SharedEnvironment @zjklee (#514)

    Introduces SharedEnvironment to deal with big memory footprint when runtime has a lot of compiled templates.
    See SharedEnvironment documentation for more details

    Issues:

Bug Fixes 🐛

  • Fix collision handling in FixedSizeDictionary @zjklee (#512)

    In rare cases (depended on hashcode) as part of searching for a suitable place in the array search started from index greater than array length.

    Issues:

  • Fix for string object property access @Dragwar (#510)

    Removed if condition in ObjectDescriptor that checked whether the type is string

    Issues:

  • Last letter cut off when the string starts with the separator @periklis92 (#504)

    Split Enumerator strings would have the wrong length if the string started with the separator.

    Issues:

Contributors

@Dragwar, @StefH, @periklis92 and @zjklee

2.1.1-beta-1

2.1.1-beta-1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Mar 07:34
300f2f6

Changes

  • An attempt to fix #498

    This beta release contains object pooling safety improvements

Contributors

@zjklee

2.1.0

Choose a tag to compare

@github-actions github-actions released this 24 Jan 19:25
558562b

Changes

Features 🚀

  • Decorators implementation @zjklee (#489)

    Issues:

  • Deprecate SupportLastInObjectIterations @orgads (#482)

Bug Fixes 🐛

  • Decorators implementation @zjklee (#489)

    Issues:

  • Enable support for chained path iterators @abraham-fox (#488)

    Issues:

  • Add checks for loose closing blocks @abraham-fox (#485)

    Check loose closing blocks on compile time - fixes #484.

Contributors

@RomainHautefeuille, @abraham-fox, @orgads, @zjklee

2.0.10

Choose a tag to compare

@github-actions github-actions released this 22 Dec 23:01
3b6c9c4

Changes

Features 🚀

  • HtmlEncoding consistent with rules in handlebars.js @tommysor (#473)

    The original issue this PR was intended to solve have been fixed in PR #477.
    This PR now deals with general rules for encoding in Handlebars.Net vs handlebars.js.

  • Support @last by default. @orgads (#481)

    Fixes #480

Bug Fixes 🐛

  • Fix path parsing when contains [a/b] @zjklee (#478)

    Fixes #470

  • UnencodedStatementVisitor resets value to previously existing value when done @tommysor (#477)

    Fix #468 HandlebarsDotNet.Handlebars.Configuration.NoEscape Applied Inconsistently
    This PR does not deal with the question of general rules for encoding that was brought up in #473.

  • Issue #469 @jamesfarrugia96 (#474)

    Exposed additional helper registration overloads via static methods

Contributors

@jamesfarrugia96, @orgads, @tommysor, @zjklee