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

Issue regarding precedence of helpers and properties in angle-bracket components #17120

Closed
iezer opened this issue Oct 16, 2018 · 4 comments
Closed

Comments

@iezer
Copy link
Contributor

iezer commented Oct 16, 2018

If I have helper called changeset and also a property on a component called changeset, these two code examples work differently in Ember 3.4:

  1. {{my-child changeset=changeset}} Passes in the "changeset" property
  2. <MyChild @changeset={{changeset}} /> Calls the "changeset" helper with no arguments.

However, 2. works the same as 1. if you're using Ember 3.3 with ember-angle-bracket-invocation-polyfill. As a result, users upgrading from Ember 3.3 with the polyfill to 3.4 might see some unexpected behavior.

This is the type of ambiguity that RFC 308 is trying to prevent but the deprecation and code mods haven't yet been implemented.

Reproduced in this twiddle

@rwjblue
Copy link
Member

rwjblue commented Oct 16, 2018

ember-template-lint includes a no-implicit-this specifically to catch this case in existing code. We should likely fix the polyfill to have consistent behavior to the real feature (always calling the helper), would you mind making an issue (or even a failing test PR)?

@iezer
Copy link
Contributor Author

iezer commented Oct 16, 2018

I've opened ember-polyfills/ember-angle-bracket-invocation-polyfill#50 and when I have time I'll write the failing test.

@chancancode
Copy link
Member

Unfortunately, this is probably "working as intended" (a.k.a. "probably too late to fix" now). RFC 432 propose to deprecate the second behavior. I would love to be proven wrong (about the "probably too late" part), but what I proposed in the RFC is probably the best we can do.

@chancancode
Copy link
Member

(the polyfill should be updated to match the Ember behavior though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants