You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The last tag is 2.4.4. The new tag will be 2.5.0, with no v prefix.
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.
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.
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.
{{else unless x}} now has unless semantics. Before, it was evaluated as {{else if x}}, which inverted the condition.
{{else someHelper x}} now invokes someHelper. Before, it ignored the helper and used x as the condition. If the helper isn't registered, rendering throws the usual missing-helper HandlebarsRuntimeException.
A bare {{else name}} now opens a block on name. If name is a registered block helper it is invoked. Otherwise the branch renders only when name is truthy, and iterates when it is a list. A bare {{else if}} / {{else unless}} with no condition is now a compile error. To restore the previous bare-name behavior, where the name was ignored and the branch rendered as a plain {{else}}, set the new Compatibility.LegacyBareElseNameBehavior = true.
{{else if a b}} / {{else unless a b}} (too many arguments) and {{else}} followed by another {{else}} now throw HandlebarsCompilerException. Before, these rendered the branch or threw ArgumentNullException.
Chains that used to throw ArgumentNullException now work: {{else if b includeZero=true}}, and a custom-helper chain followed by {{else}}.
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>
^
New compatibility flags:Compatibility.LegacyStandaloneCaretBehavior, Compatibility.BlockScopedInlinePartials and Compatibility.LegacyBareElseNameBehavior, as described above. They are documented in the README under "Compatibility feature toggles".
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.
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.
Activity
stencil-harness commentedon Nov 22, 2026
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:
origin/masteris at92a86d0(merge of Use handlebars.js semantics for a bare {{else name}} under {{#if}}/{{#unless}}, with LegacyBareElseNameBehavior opt-out #696).2.4.4. The new tag will be2.5.0, with novprefix.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.0release 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.Compatibilityflag that restores the 2.4.x behavior, and the new compile errors name that flag.Compatibility notes
Inline partials declared inside a block or partial are now scoped to that block, as in handlebars.js.
Compatibility.BlockScopedInlinePartials(added as an opt-in in 2.4.4) now defaults totrue. Set it tofalseto restore the previous behavior. When a partial can't be resolved because of this scoping, the exception message names the opt-out. (Make compatibility fixes opt-out: block-scoped inline partials by default, opt-outs named in exceptions #692, fixes Invert opt-ins for breaking bug fixes in next minor version release #690, Inline partials declared inside a block stay registered after the block ends #673){{#*inline "p"}}outer{{/inline}}{{#with .}}{{#*inline "p"}}inner{{/inline}}{{> p}}{{/with}} {{> p}}inner innerinner outer{{#with .}}{{#*inline "myPartial"}}success{{/inline}}{{/with}}{{> myPartial}}success{{> macros}}{{> button label="OK"}}, where partialmacrosdeclares{{#*inline "button"}}<button>OK</button>To migrate, move such declarations to the top level of the template or register them with
RegisterTemplate. Either works in both modes.A bare
{{else name}}under{{#if}}/{{#unless}}now means{{else}}{{#name}}…{{/name}}, as in handlebars.js. Ifnameis a registered block helper it is invoked; otherwise it is resolved as a value (rendered when truthy, iterated when a list). A bare{{else if}}/{{else unless}}with no condition is now a compile error. Set the newCompatibility.LegacyBareElseNameBehavior = trueto restore the previous behavior, where the name was ignored and the branch rendered as a plain{{else}}. (Use handlebars.js semantics for a bare {{else name}} under {{#if}}/{{#unless}}, with LegacyBareElseNameBehavior opt-out #696, fixes Use handlebars.js semantics for a bare{{else name}}under{{#if}}/{{#unless}}by default, with aLegacy*opt-out #695; based on fix: chain {{else helper ...}} under {{#if}} and {{#unless}} #684 by @EnesKartal){{#if user.isAdmin}}Admin tools{{else user.isModerator}}Moderator tools{{/if}}Moderator tools{{#if a}}A{{else items}}[{{this}}]{{/if}}[+ outer context +][1][2]{{#if a}}A{{else if}}B{{/if}}BHandlebarsCompilerExceptionWhen a repeated
{{^}}inside{{#if}}/{{#unless}}fails to compile (a result of the 2.4.x{{^}}fix), the error message now namesCompatibility.LegacyStandaloneCaretBehavior. (Make compatibility fixes opt-out: block-scoped inline partials by default, opt-outs named in exceptions #692, fixes Invert opt-ins for breaking bug fixes in next minor version release #690)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
rexm commentedon Nov 22, 2026
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.
stencil-harness commentedon Nov 22, 2026
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.
BlockScopedInlinePartialsis described as a new setting that defaults totrue, not as a 2.4.4 opt-in whose default flipped.How I checked it:
origin/masteris still at92a86d0.Still not published. Reply "publish" (or ask for edits) and I'll create the
2.5.0release 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
JsonNodesupport, 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 aConfiguration.Compatibilityflag 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 callingCompile.Compatibility notes
These changes can alter output, or turn a template that used to compile into an error. Read them before upgrading.
A standalone
{{^}}inside a block is now the inverse separator, the same as{{else}}, as in handlebars.js. This applies to#if,#unless,#each,#with, sections and custom block helpers, and to the{{^ }}and{{~^~}}forms. Inside raw blocks{{^}}is still literal text. To restore the previous behavior, setCompatibility.LegacyStandaloneCaretBehavior = true. (Treat standalone {{^}} as the inverse separator, with a compatibility opt-out #675, fixes Standalone{{^}}is not treated as the else separator inside blocks ({{#if}},{{#each}}, sections) #672; Make compatibility fixes opt-out: block-scoped inline partials by default, opt-outs named in exceptions #692){{#if condition}}yes{{^}}no{{/if}}yes{ condition = True }noyes{{#if condition}}yes{{^}}no{{/if}}no{{#each people}}{{name}}{{^}}No one{{/each}}[]No oneA second
{{^}}in the same#if/#unless(e.g.{{#if x}}a{{^}}b{{^}}c{{/if}}) is now a compile error, and its message names the opt-out.Inline partials declared inside a block or partial are now scoped to that block, as in handlebars.js. The new
Compatibility.BlockScopedInlinePartialssetting defaults totrue. To restore the previous behavior, where such partials leaked into the enclosing scope and replaced outer partials with the same name, set it tofalse. When a partial can't be resolved because of this scoping, the error message names the opt-out. (Add opt-in block-scoped inline partials (Compatibility.BlockScopedInlinePartials) #688, Make compatibility fixes opt-out: block-scoped inline partials by default, opt-outs named in exceptions #692, fixes Inline partials declared inside a block stay registered after the block ends #673, Invert opt-ins for breaking bug fixes in next minor version release #690){{#*inline "p"}}outer{{/inline}}{{#with .}}{{#*inline "p"}}inner{{/inline}}{{> p}}{{/with}} {{> p}}inner innerinner outer{{#with .}}{{#*inline "myPartial"}}success{{/inline}}{{/with}}{{> myPartial}}success{{> macros}}{{> button label="OK"}}, where partialmacrosdeclares{{#*inline "button"}}<button>OK</button>To migrate, move such declarations to the top level of the template or register them with
RegisterTemplate. Either works with the setting on or off.{{else …}}chains under{{#if}}/{{#unless}}now follow handlebars.js.{{else name args}}now means{{else}}{{#name args}}…{{/name}}. Before, any two-word form was treated as{{else if x}}, and any other form silently became a plain{{else}}. (fix: chain {{else helper args}} off {{#if}}/{{#unless}} blocks #687, test: cover chaining built-in {{else with}} under {{#if}} #689, Use handlebars.js semantics for a bare {{else name}} under {{#if}}/{{#unless}}, with LegacyBareElseNameBehavior opt-out #696, fixes{{else customHelper args}}inside{{#if}}/{{#unless}}throwsArgumentNullException (Parameter 'test')at compile time #683, Use handlebars.js semantics for a bare{{else name}}under{{#if}}/{{#unless}}by default, with aLegacy*opt-out #695; based on fix: chain {{else helper ...}} under {{#if}} and {{#unless}} #684 by @EnesKartal){{else unless x}}now hasunlesssemantics. Before, it was evaluated as{{else if x}}, which inverted the condition.{{else someHelper x}}now invokessomeHelper. Before, it ignored the helper and usedxas the condition. If the helper isn't registered, rendering throws the usual missing-helperHandlebarsRuntimeException.{{else name}}now opens a block onname. Ifnameis a registered block helper it is invoked. Otherwise the branch renders only whennameis truthy, and iterates when it is a list. A bare{{else if}}/{{else unless}}with no condition is now a compile error. To restore the previous bare-name behavior, where the name was ignored and the branch rendered as a plain{{else}}, set the newCompatibility.LegacyBareElseNameBehavior = true.{{else if a b}}/{{else unless a b}}(too many arguments) and{{else}}followed by another{{else}}now throwHandlebarsCompilerException. Before, these rendered the branch or threwArgumentNullException.ArgumentNullExceptionnow work:{{else if b includeZero=true}}, and a custom-helper chain followed by{{else}}.{{#if user.isAdmin}}Admin tools{{else user.isModerator}}Moderator tools{{/if}}Moderator tools{{#if a}}A{{else unless b}}B{{else}}C{{/if}}CB{{#if a}}A{{else ifEq b "y"}}B{{/if}}(ifEqregistered)B{{#if a}}A{{else items}}[{{this}}]{{/if}}[+ outer context +][1][2]{{#if a}}A{{else if}}B{{/if}}BHandlebarsCompilerExceptionJsonNodebehavior (Add JsonNode support & enhance JsonElement #670 by @jsneedles):false,0and""in aJsonNodeare now falsy in#ifand similar helpers. Before, they were truthy.JsonObjectmember lookups now fall back to the lowercase name, asJsonElementlookups do.JsonElementandJsonObjectmembers.Compile error messages and exception types:
{{#if}}/{{#unless}}with no argument now throwsHandlebarsCompilerException(#if requires exactly one argument). Before, it threwInvalidOperationException. With too many arguments, it throws the same exception type as before, but the message now reads the same way. (fix: throw HandlebarsCompilerException for #if/#unless with wrong argument count #678, fixes{{#if}}/{{#unless}}without an argument throwInvalidOperationException: Sequence contains no elements#674)Line n, column n.followed by the template line and a caret under the error. The oldOccured at: n:ntext is gone. Code that compares the full message exactly, or searches it forOccured at:, needs updating. Use the newHandlebarsException.Line/Columnproperties instead. (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 features
JsonNodesupport.JsonObject,JsonArrayandJsonValuecan be passed directly as template data. They support member access,#eachwith@index/@key/@first/@last, truthiness,includeZeroand partials, the same asJsonElement.JsonElementarrays now support index access ({{items.[0]}},{{lookup items 1}}) and{{items.Count}}, plus{{items.length}}withUseCollectionMemberAliasProvider(). One difference to note: when output directly, booleans render asTrue/Falsefrom aJsonElementand astrue/falsefrom aJsonNode. New public types:JsonNodeObjectDescriptorProvider,JsonNodeMemberAccessor,JsonNodeIterator. There are also newJsonElementObjectDescriptorProvider/JsonElementMemberAccessorconstructor overloads that take alias providers. (Add JsonNode support & enhance JsonElement #670 by @jsneedles)HandlebarsException.LineandHandlebarsException.Columnproperties (zero-based,int?) are inherited byHandlebarsCompilerException,HandlebarsParserExceptionandHandlebarsRuntimeException. Compile errors now show the offending source line with a caret:}}/}}}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)Compatibility.LegacyStandaloneCaretBehavior,Compatibility.BlockScopedInlinePartialsandCompatibility.LegacyBareElseNameBehavior, as described above. They are documented in the README under "Compatibility feature toggles".Fixes
{{#each}}over items of different runtime types now looks up each item's members by that item's own type. Before, a dictionary followed by a number threwInvalidCastException, and a number followed by a dictionary rendered empty. (fix: #each member lookup with items of different types (drop cached descriptor on value type change) #691, fixes #each: member lookup throws InvalidCastException when items have different types #685; based on fix: drop cached descriptor when the context value changes type #686 by @bardrop){{{{raw}}}}…{{{{/raw}}}}) compile again whenCompatibility.RelaxedHelperNaming = true. (fix: raw block helpers fail to compile with RelaxedHelperNaming enabled #677, fixes Raw block helpers fail to compile when Compatibility.RelaxedHelperNaming is enabled #676)Internal
LiteralParserandReusableStringWriterto address SonarCloud findings, with no behavior change. (refactor: address pending SonarCloud S3881/S3776 items in lexer and ReusableStringWriter #679, refs SonarCloud quality/security remediation tracking #641)Contributors: @jsneedles, @EnesKartal, @bardrop, @rexm
Full Changelog: 2.4.3...2.5.0
rexm commentedon Nov 22, 2026
Ship it
stencil-harness commentedon Nov 22, 2026
Published the 2.5.0 release from
masterat92a86d0, 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.stencil-harness commentedon Nov 22, 2026
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.
masterat92a86d0, where CI passed, and uses the notes approved above.set-outputdeprecation, and nullable-reference warnings. None of them affected publishing.