Skip to content

Draft a 2.4.4 release and review here before publishing #693

Closed

Description

@rexm
No description provided.

Activity

  1. stencil-harness commented on Nov 21, 2026

    @stencil-harness
    Contributor

    I'm the agent handling issue intake on Rex's behalf. My reading of this: draft release notes for 2.4.4 covering everything merged to master since the last tag, then post the draft here for review. I won't create or publish the GitHub Release until it's approved.

  2. stencil-harness commented on Nov 21, 2026

    @stencil-harness
    Contributor

    The draft release notes are below. I have not created or published anything. It covers the 10 PRs merged to master since 2.4.3 (#670, #675, #677–#682, #687, #689).

    Decision needed: version number

    AGENTS.md says to bump the minor version for additive features. This range adds public API:

    It also changes some default output. The full list is under "Compatibility notes".

    Recommendation: 2.5.0, not 2.4.4. Every behavior change is a defect fix toward Handlebars.js or has an opt-out, so I don't think it needs a major bump. But a patch number would tell consumers who auto-update on patches that nothing new or visible changed. If you'd still like 2.4.4, the notes work as written. For 2.5.0, only the compare link at the bottom changes.

    Before publishing

    Reply with the version (and any edits). I'll then create and publish the Release from current master and watch the Release workflow through to the NuGet push.


    Draft release notes (title 2.4.4)

    These are in a code block so the contributor mentions don't ping anyone until the release is published.

    ## New features
    
    - **`System.Text.Json` `JsonNode` support.** You can now pass `JsonObject`, `JsonArray` and `JsonValue` into templates directly. They support the same things as `JsonElement`: member access, `#each` with `@index`/`@key`/`@first`/`@last`, truthiness, `includeZero` and partials. `JsonElement` also gains array index access (`{{items.[0]}}`, `{{lookup items 1}}`), `{{items.Count}}` (plus `{{items.length}}` with `UseCollectionMemberAliasProvider()`), and support for custom alias providers. New public types: `JsonNodeObjectDescriptorProvider`, `JsonNodeMemberAccessor`, `JsonNodeIterator`. `JsonElementObjectDescriptorProvider` and `JsonElementMemberAccessor` get new constructor overloads that take alias providers. (#670)
    - **Error locations on exceptions.** `HandlebarsException` has new `Line` and `Column` properties (`int?`, zero-based, `null` when the location isn't known). The derived compiler, parser and runtime exceptions inherit them. When a compile-time error has a location, its message now ends with the offending template line and a caret under the column. (#681, refs #314)
    - **Clearer messages for common syntax errors.** `{{#if !x}}` now says that `!` isn't a negation operator and points you to `#unless`. Unclosed blocks, stray closing tags and mismatched `}}}` now report where they happened. (#680, refs #314)
    - **`Compatibility.LegacyStandaloneCaretBehavior`**: a new opt-out flag that restores the old `{{^}}` behavior (see Fixes). (#675, fixes #672)
    
    ## Fixes
    
    - A standalone `{{^}}` inside a block (also `{{^ }}` and `{{~^~}}`) is now the inverse separator, the same as `{{else}}`, matching Handlebars.js. Inside raw blocks it stays literal text. (#675, fixes #672)
    - `{{else name args}}` under `{{#if}}`/`{{#unless}}` now chains to the named helper, as in Handlebars.js. Previously it was evaluated as `{{else if …}}`, or the condition was silently dropped. `{{else unless x}}` now has `unless` semantics, and `{{else with x}}` chains to the built-in `with`. (#687, #689, fixes #683)
    - `{{#if}}`/`{{#unless}}` with a missing argument now throw `HandlebarsCompilerException` instead of a bare `InvalidOperationException`. (#678, fixes #674)
    - Raw block helpers now compile when `Compatibility.RelaxedHelperNaming = true`. (#677, fixes #676)
    - `JsonArray` member access is limited to indexes, `Count` and configured aliases, so `Parent`/`Root`/`Options` no longer resolve through reflection. Scalar `JsonValue`s read through `JsonSerializer` no longer throw. (#670)
    
    ## Internal
    
    - Sealed `ReusableStringWriter` (it has only a private constructor, so this doesn't break anything), and split up `Tokenizer`/`LiteralParser` methods for the SonarCloud S3881/S3776 items. No behavior change. (#679, closes #641)
    
    ## Compatibility notes
    
    Some templates and code that worked before will behave differently:
    
    - **`{{^}}` inside a block** used to render the current context, and the block had no inverse branch. It is now `{{else}}`. For example, `{{#if condition}}yes{{^}}no{{/if}}` with `condition = true` used to render `yes{ condition = True }no` and now renders `yes`. With `condition = false` it used to render nothing and now renders `no`. To restore the old output, set `Configuration.Compatibility.LegacyStandaloneCaretBehavior = true`. (#675)
    - **`{{else unless x}}` under `{{#if}}`** used to be evaluated as `{{else if x}}`, which inverted the condition. **`{{else someHelper x}}`** used to ignore `someHelper`. It now calls it, and throws the usual missing-helper `HandlebarsRuntimeException` if `someHelper` isn't registered. `{{else if a b}}` and `{{else unless a b}}` (too many arguments) and a second `{{else}}` now fail at compile time. Plain `{{else}}`, `{{else if x}}` and a bare `{{else name}}` are unchanged. (#687)
    - **Exception messages:** the location text changed from `Occured at: l:c` to `Line l, column c.`, and located compile errors now end with a source line and a caret. Code that matches on the exception type or message prefix keeps working. Code that searches for `Occured at:` or compares the full `Message` will not match. Use the new `Line`/`Column` properties instead. `{{#if}}` with no argument now throws `HandlebarsCompilerException` instead of `InvalidOperationException`. With too many arguments, it now says `#if requires exactly one argument`. (#678, #680, #681, #682)
    - **`JsonNode`:** `false`, `0` and `""` are now falsy in `#if`/`#unless`/`#each`. Before, they were truthy. `JsonObject` lookups now fall back to the lowercase property name. Custom member alias providers are now consulted for `JsonElement` and `JsonObject` members that don't otherwise resolve. When interpolated directly, `JsonNode` booleans still render as `true`/`false`, while `JsonElement` booleans render as `True`/`False`. (#670)
    
    **Contributors:** @jsneedles (`JsonNode` support), @EnesKartal (#684, whose test case and approach were incorporated into #687/#689), @rexm
    
    **Full Changelog**: https://github.com/Handlebars-Net/Handlebars.Net/compare/2.4.3...2.4.4
  3. rexm commented on Nov 21, 2026

    @rexm
    MemberAuthor

    Agents.md is wrong, if the public changes are small and additive only then it can be a patch version. It's a judgement call.

  4. stencil-harness commented on Nov 21, 2026

    @stencil-harness
    Contributor

    Thanks. I'll go with 2.4.4: apart from the JSON work, the public additions are small (one compatibility flag, two exception properties), and every behavior change is a defect fix or has an opt-out.

    Nothing has been published yet. Reply "publish" (or with edits) and I'll create the 2.4.4 Release from current master with the notes below and follow the Release workflow through to the NuGet push.

    Updated draft release notes (title 2.4.4)

    ## New features
    
    - **`System.Text.Json` `JsonNode` support.** You can now pass `JsonObject`, `JsonArray` and `JsonValue` into templates directly. They support the same things as `JsonElement`: member access, `#each` with `@index`/`@key`/`@first`/`@last`, truthiness, `includeZero` and partials. `JsonElement` also gains array index access (`{{items.[0]}}`, `{{lookup items 1}}`), `{{items.Count}}` (plus `{{items.length}}` with `UseCollectionMemberAliasProvider()`), and support for custom alias providers. New public types: `JsonNodeObjectDescriptorProvider`, `JsonNodeMemberAccessor`, `JsonNodeIterator`. `JsonElementObjectDescriptorProvider` and `JsonElementMemberAccessor` get new constructor overloads that take alias providers. (#670)
    - **Error locations on exceptions.** `HandlebarsException` has new `Line` and `Column` properties (`int?`, zero-based, `null` when the location isn't known). The derived compiler, parser and runtime exceptions inherit them. When a compile-time error has a location, its message now ends with the offending template line and a caret under the column. (#681, refs #314)
    - **Clearer messages for common syntax errors.** `{{#if !x}}` now says that `!` isn't a negation operator and points you to `#unless`. Unclosed blocks, stray closing tags and mismatched `}}}` now report where they happened. (#680, refs #314)
    - **`Compatibility.LegacyStandaloneCaretBehavior`**: a new opt-out flag that restores the old `{{^}}` behavior (see Fixes). (#675, fixes #672)
    
    ## Fixes
    
    - A standalone `{{^}}` inside a block (also `{{^ }}` and `{{~^~}}`) is now the inverse separator, the same as `{{else}}`, matching Handlebars.js. Inside raw blocks it stays literal text. (#675, fixes #672)
    - `{{else name args}}` under `{{#if}}`/`{{#unless}}` now chains to the named helper, as in Handlebars.js. Previously it was evaluated as `{{else if …}}`, or the condition was silently dropped. `{{else unless x}}` now has `unless` semantics, and `{{else with x}}` chains to the built-in `with`. (#687, #689, fixes #683)
    - `{{#if}}`/`{{#unless}}` with a missing argument now throw `HandlebarsCompilerException` instead of a bare `InvalidOperationException`. (#678, fixes #674)
    - Raw block helpers now compile when `Compatibility.RelaxedHelperNaming = true`. (#677, fixes #676)
    - `{{#each}}` over items of different runtime types now looks each item's members up by its own type. Before, a dictionary followed by a number threw `InvalidCastException`, and a number followed by a dictionary rendered empty. For example, `{{#each items}}[{{name}}]{{/each}}` over `[{name: "Erik"}, 42, {name: "Helen"}]` now renders `[Erik][][Helen]`. Collections whose items all share one type behave as before. (#691, fixes #685)
    - `JsonArray` member access is limited to indexes, `Count` and configured aliases, so `Parent`/`Root`/`Options` no longer resolve through reflection. Scalar `JsonValue`s read through `JsonSerializer` no longer throw. (#670)
    
    ## Internal
    
    - Sealed `ReusableStringWriter` (it has only a private constructor, so this doesn't break anything), and split up `Tokenizer`/`LiteralParser` methods for the SonarCloud S3881/S3776 items. No behavior change. (#679, closes #641)
    
    ## Compatibility notes
    
    Some templates and code that worked before will behave differently:
    
    - **`{{^}}` inside a block** used to render the current context, and the block had no inverse branch. It is now `{{else}}`. For example, `{{#if condition}}yes{{^}}no{{/if}}` with `condition = true` used to render `yes{ condition = True }no` and now renders `yes`. With `condition = false` it used to render nothing and now renders `no`. To restore the old output, set `Configuration.Compatibility.LegacyStandaloneCaretBehavior = true`. (#675)
    - **`{{else unless x}}` under `{{#if}}`** used to be evaluated as `{{else if x}}`, which inverted the condition. **`{{else someHelper x}}`** used to ignore `someHelper`. It now calls it, and throws the usual missing-helper `HandlebarsRuntimeException` if `someHelper` isn't registered. `{{else if a b}}` and `{{else unless a b}}` (too many arguments) and a second `{{else}}` now fail at compile time. Plain `{{else}}`, `{{else if x}}` and a bare `{{else name}}` are unchanged. (#687)
    - **Exception messages:** the location text changed from `Occured at: l:c` to `Line l, column c.`, and located compile errors now end with a source line and a caret. Code that matches on the exception type or message prefix keeps working. Code that searches for `Occured at:` or compares the full `Message` will not match. Use the new `Line`/`Column` properties instead. `{{#if}}` with no argument now throws `HandlebarsCompilerException` instead of `InvalidOperationException`. With too many arguments, it now says `#if requires exactly one argument`. (#678, #680, #681, #682)
    - **`JsonNode`:** `false`, `0` and `""` are now falsy in `#if`/`#unless`/`#each`. Before, they were truthy. `JsonObject` lookups now fall back to the lowercase property name. Custom member alias providers are now consulted for `JsonElement` and `JsonObject` members that don't otherwise resolve. When interpolated directly, `JsonNode` booleans still render as `true`/`false`, while `JsonElement` booleans render as `True`/`False`. (#670)
    
    **Contributors:** @jsneedles (`JsonNode` support), @EnesKartal (#684, whose test case and approach were incorporated into #687/#689), @bardrop (#686, whose fix and tests were incorporated into #691), @rexm
    
    **Full Changelog**: https://github.com/Handlebars-Net/Handlebars.Net/compare/2.4.3...2.4.4
  5. rexm commented on Nov 22, 2026

    @rexm
    MemberAuthor

    Ship it

  6. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    I'm unable to proceed further on this and am awaiting follow-up from a human maintainer.

  7. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    I'm unable to proceed further on this and am awaiting follow-up from a human maintainer.

  8. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    I'm unable to proceed further on this and am awaiting follow-up from a human maintainer.

  9. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    2.4.4 is published. https://github.com/Handlebars-Net/Handlebars.Net/releases/tag/2.4.4

  10. stencil-harness commented on Nov 22, 2026

    @stencil-harness
    Contributor

    Follow-up: everything for this issue is finished.

    Not fixed here; noting it for later: the Release workflow logs deprecation warnings. actions/checkout@v4, actions/setup-dotnet@v4 and timheuer/base64-to-file target Node.js 20, and one step still uses the deprecated set-output command. Both will eventually break the workflow if not updated.

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