Skip to content

Draft a 2.5.0 release #697

Closed
Closed

Description

@rexm

Now that the tip of mainline has behavior fixes on by default and opt-out, let's prepare the release.

Activity

  1. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    I'm the agent handling intake of issues using Rex's identity. I've drafted the 2.5.0 release notes and have not published the release yet. Publishing pushes to NuGet right away and can't be undone, so I'm waiting for your go-ahead.

    Checks:

    What's in it: #692 and #696 change behavior. #694 only changes AGENTS.md, so it isn't listed.

    Version: 2.5.0, as you asked. Both default changes break existing templates (inline-partial scoping, bare {{else name}}). Each can be turned off with a single flag, and the new errors name that flag. #696's PR said a major bump would be needed unless it shipped together with the #692 opt-out release, which is what 2.5.0 does. So minor fits your opt-out policy. Strict SemVer would call it 3.0.0. I'm noting that only so the choice is on record.

    The example outputs in the tables below are asserted by tests on master (InlinePartialTests, ConditionalElseChainTests).

    Reply "publish" (or ask for edits) and I'll create the 2.5.0 release with the notes below and watch the Release workflow until the NuGet push finishes.


    Draft release notes

    2.5.0 makes two handlebars.js-compatibility fixes the default behavior. Each one has a single Configuration.Compatibility flag that restores the 2.4.x behavior, and the new compile errors name that flag.

    Compatibility notes

    All of these flags are read at compile time, so set them before calling Compile.

    Contributors: @EnesKartal, @rexm

    Full Changelog: 2.4.4...2.5.0

  2. rexm commented on Nov 22, 2026

    @rexm
    MemberAuthor

    I want the release notes to be written as if the 2.4.4 release had not been cut, so a person reading only the 2.5.0 release notes can understand the entire changeset from the previous release.

  3. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    I've rewritten the draft so it covers everything since 2.4.3, as if 2.4.4 had never been cut. The Full Changelog link now compares 2.4.3...2.5.0.

    What it covers now: every PR merged since 2.4.3: #670, #675, #677, #678, #679, #680, #681, #682, #687, #688, #689, #691, #692 and #696.

    How I checked it:

    • Each entry's wording and before/after table is taken from that PR's description, as it stood when the PR merged. For Add JsonNode support & enhance JsonElement #670, that's the narrowed scope after review.
    • origin/master is still at 92a86d0.

    Still not published. Reply "publish" (or ask for edits) and I'll create the 2.5.0 release with these notes and watch the Release workflow until the NuGet push finishes.


    Draft release notes

    2.5.0 brings Handlebars.Net closer to handlebars.js. It adds JsonNode support, and compile errors now report where they happened. Several long-standing differences from handlebars.js are now fixed by default. Each fix that changes output for templates that used to compile has a Configuration.Compatibility flag that restores the old behavior, and the new compile errors name that flag. All compatibility flags are read at compile time, so set them before calling Compile.

    Compatibility notes

    These changes can alter output, or turn a template that used to compile into an error. Read them before upgrading.

    New features

    • JsonNode support. JsonObject, JsonArray and JsonValue can be passed directly as template data. They support member access, #each with @index / @key / @first / @last, truthiness, includeZero and partials, the same as JsonElement. JsonElement arrays now support index access ({{items.[0]}}, {{lookup items 1}}) and {{items.Count}}, plus {{items.length}} with UseCollectionMemberAliasProvider(). One difference to note: when output directly, booleans render as True/False from a JsonElement and as true/false from a JsonNode. New public types: JsonNodeObjectDescriptorProvider, JsonNodeMemberAccessor, JsonNodeIterator. There are also new JsonElementObjectDescriptorProvider / JsonElementMemberAccessor constructor overloads that take alias providers. (Add JsonNode support & enhance JsonElement #670 by @jsneedles)
    • Error locations on exceptions. The new HandlebarsException.Line and HandlebarsException.Column properties (zero-based, int?) are inherited by HandlebarsCompilerException, HandlebarsParserException and HandlebarsRuntimeException. Compile errors now show the offending source line with a caret:
      Unexpected '!File' inside an expression: '!' can only start a comment (e.g. '{{! comment }}') and is not a negation operator. Use '#unless' to negate a condition
      
      Line 0, column 9.
      
      <p>{{#if !File}}yes{{/if}}</p>
               ^
      
      Unclosed blocks, stray closing tags and mismatched }} / }}} now report where they occurred. {{#if !x}} used to fail with an internal "must be reducible node" error and now gets the clear message shown above. (Report token and location for common template syntax errors #680, Expose error location on exceptions and show the source line with a caret #681, Report error location as "Line n, column n." #682, fixes Please report betters errors (context) when having mistakes in the template #314)
    • New compatibility flags: Compatibility.LegacyStandaloneCaretBehavior, Compatibility.BlockScopedInlinePartials and Compatibility.LegacyBareElseNameBehavior, as described above. They are documented in the README under "Compatibility feature toggles".

    Fixes

    Internal

    Contributors: @jsneedles, @EnesKartal, @bardrop, @rexm

    Full Changelog: 2.4.3...2.5.0

  4. rexm commented on Nov 22, 2026

    @rexm
    MemberAuthor

    Ship it

  5. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    Published the 2.5.0 release from master at 92a86d0, using the notes approved above. CI on that commit passed. The Release workflow that signs the package and pushes it to NuGet is running now. I'll post again when it finishes.

  6. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    2.5.0 has shipped. The Release workflow run succeeded, and its Publish job, which signs the package and pushes it to NuGet, passed in 56s.

    • Release: https://github.com/Handlebars-Net/Handlebars.Net/releases/tag/2.5.0. It was tagged on master at 92a86d0, where CI passed, and uses the notes approved above.
    • Repo changes: none. The only action was publishing the release.
    • The run printed only warnings, which were already there in earlier releases: the Node 20 action deprecation, the set-output deprecation, and nullable-reference warnings. None of them affected publishing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions