Skip to content

Change in behavior for implicit params in partials in handlebars 4.5.2 #1182

Description

@aschwarte10

First of all thanks for maintaining this library 👍

We're in the process of upgrading Handlebars.java from 4.5.0 to 4.5.2 and noticed a subtle behavior change around partial context inheritance. We wanted to discuss it and ask whether this is intentional or an unintended side-effect of some 4.5.2 change

We found that implicit params are no longer accessible inside the partial

Minimal abstract reproducing example

  {{! outer template }}
  {{> testParamPage param="hello"}}

  {{! testParamPage }}
  {{> parameters }}              {{! implicit — param should be inherited }}
  {{> parameters param=param}}   {{! explicit — still works in both versions }}

  {{! parameters }}
  {{param}}

In 4.5.0: both calls render hello.
In 4.5.2: the implicit call renders nothing; only the explicit re-binding works.

Potential related change / ticket: #1173

We would like to ask whether this is intended or a side-effect. In our use-case we aim now to make params to partials explicit and avoid issues in the first place

cc @jknack

Activity

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

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions