ember-polyfills / ember-angle-bracket-invocation-polyfill

MIT License
76 stars 33 forks source link

Add polyfill for <Input> and <Textarea> #75

Closed simonihmig closed 5 years ago

simonihmig commented 5 years ago

Based on #72, will rebase once that is merged.

rwjblue commented 5 years ago

Needs a rebase I think

simonihmig commented 5 years ago

Rebased, but the Ember 2.12 scenario is failing. Will have to investigate...

simonihmig commented 5 years ago

Ok, that was a stupid mistake. Green now!

rwjblue commented 5 years ago

Thank you! Glad we had coverage :smile:

simonihmig commented 5 years ago

Reading through this made me think of another issue: passing modifiers, comments, or attributes other than the specific ones we handle should issue a helpful error.

What do you mean by "comments"?

So to make this clear, as we transform to curly syntax that does not support arbitrary HTML attributes and no modifiers (which RFC435 does allow for angle bracket invocation), we should error on

However passing any kind of unsupported property should not error IMHO, as that wouldn't be the case also with "native" angle bracket support (no polyfill required).

Correct?

Do you want me to tackle this in this PR? I would suggest to do that in another one, that also includes the link-to transform. So we can hopefully merge this before?

rwjblue commented 5 years ago

Do you want me to tackle this in this PR? I would suggest to do that in another one, that also includes the link-to transform. So we can hopefully merge this before?

Sorry, yes, I totally agree that we don't want that here in this PR. I just thought of it while reviewing this one.

rwjblue commented 5 years ago

What do you mean by "comments"?

<LinkTo @route="foo" @model={{whatever}} {{! template-lint-disable-tree no-bare-strings }}>Hello Untranslated String!</LinkTo>
rwjblue commented 5 years ago

So to make this clear, as we transform to curly syntax that does not support arbitrary HTML attributes and no modifiers (which RFC435 does allow for angle bracket invocation), we should error on

  • passing an attribute that is not supported through attributeBindings
  • passing any kind of modifier

Yes, exactly what I meant.

However passing any kind of unsupported property should not error IMHO, as that wouldn't be the case also with "native" angle bracket support (no polyfill required).

I don't quite understand what you mean here. Can you give an example of what you refer to as an "unsupported property"? Do you mean an attribute that isn't in the attributeBindings? A named argument that we don't "know" about? Something else?

simonihmig commented 5 years ago

A named argument that we don't "know" about?

Yes, that one. I probably was confused about your "comment" remark, because I didn't realize that was even possible until now, so thought you might mean some else / have a typo. I guess we agree that we don't have to do anything about arguments, so please ignore my confusion! 😝