Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] [DEPRECATION] Deprecate @foo={{helper}} #19499

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

chancancode
Copy link
Member

Per RFC 496, this commit deprecates the implicit invocation of argument-less helpers and requires explicit parenthesis if:

  1. Non-strict mode, AND
  2. helper is a free variable (not this.helper, @helper or
    a local variable), AND
  3. No arguments are provided to the helper, AND
  4. It's in a component invocation's named argument position (not
    <div id={{helper}}> or <Foo bar={{helper}}>), AND
  5. Not parenthesized (not @foo={{(helper)}}), AND
  6. Not interpolated (not @foo="{{helper}}").

The cases in real apps where all of the above are true should be quite rare, as most helpers take at least one argument.

This is probably not the most efficient/minimal changes to the compiler infrastructure, but I chose to optimize for making the change easier to remove/rollback (i.e. adding new nodes instead of changing existing ones) as we won't be needing this for very long.

This also bumps @glimmer/* to latest which also brings in the bugfix commit glimmerjs/glimmer-vm#1293.

@chancancode
Copy link
Member Author

chancancode commented Apr 20, 2021

Hmm. Not sure what’s up with the failures. Did I do something wrong when I publish the packages? (They work locally) cc @rwjblue

@chancancode chancancode force-pushed the deprecate-argument-less-helper-paren-less-invocation branch 2 times, most recently from 0e148ac to d551570 Compare April 21, 2021 23:36
Per [RFC 496](https://github.com/emberjs/rfcs/blob/master/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers),
this commit deprecates the implicit invocation of argument-less
helpers and requires explicit parenthesis if:

1. Non-strict mode, AND
2. `helper` is a free variable (not `this.helper`, `@helper` or
   a local variable), AND
3. No arguments are provided to the helper, AND
4. It's in a component invocation's named argument position (not
   `<div id={{helper}}>` or `<Foo bar={{helper}}>`), AND
5. Not parenthesized (not `@foo={{(helper)}}`), AND
6. Not interpolated (not `@foo="{{helper}}"`).

The cases in real apps where all of the above are true should be
quite rare, as most helpers take at least one argument.

This is probably not the most efficient/minimal changes to the
compiler infrastructure, but I chose to optimize for making the
change easier to remove/rollback (i.e. adding new nodes instead
of changing existing ones) as we won't be needing this for very
long.

This also bumps `@glimmer/*` to latest which also brings in the
bugfix commit glimmerjs/glimmer-vm#1293.
@chancancode chancancode force-pushed the deprecate-argument-less-helper-paren-less-invocation branch from d551570 to 62e2816 Compare April 22, 2021 04:31
@wycats wycats merged commit a6a6833 into master Apr 22, 2021
@wycats wycats deleted the deprecate-argument-less-helper-paren-less-invocation branch April 22, 2021 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants