Skip to content

Deprecate {{with}} helper #316

@locks

Description

@locks

With the introduction of the block {{let}} helper, it is now possible to replace usages of {{with}}.
The reason to deprecate {{with}} is that the conditional behaviour of the block not being rendered when the first parameter to {{with}} is falsey is confusing to users.

To give an example, before:

{{#with parent.child as |child|}}
  {{child}}
{{else}}
  No children!
{{/let}}

After:

{{#let parent.child as |child|}}
  {{#if child}}
    {{child}}
  {{else}}
    No children!
  {{/if}}
{{/let}}

For convenience, an if-let helper could be proposed at a later stage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions