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

Incorrect transformation of use of contextual component variable into a component invocation #220

Open
kategengler opened this issue Dec 30, 2019 · 3 comments · May be fixed by #230
Open
Labels
bug Something isn't working

Comments

@kategengler
Copy link

 {{#power-select search=(perform searchThings)
    selected=selectedResult
    placeholder="Enter the thing..."
    loadingMessage="Searching..."
    onchange=(perform selectThing) as |fooResult|}}
      <span class="select-description">{{fooResult.attributes.thing-desc}}</span>
    {{/power-select}}

transformed to:

<PowerSelect
      @search={{perform searchThings}}
      @selected={{selectedResult}}
      @placeholder="Enter the thing..."
      @loadingMessage="Searching..."
      @onchange={{perform selectThing}} as |fooResult|>
      <span class="select-description"><fooResult.attributes.thing-desc /></span>
    </PowerSelect>
@Turbo87 Turbo87 added the bug Something isn't working label Dec 30, 2019
rajasegar added a commit to rajasegar/ember-angle-brackets-codemod that referenced this issue Jan 12, 2020
@sophiaonion
Copy link

sophiaonion commented Jan 16, 2020

Quick question: Isn't it this will be allowed? looking at this ember doc https://guides.emberjs.com/release/upgrading/current-edition/templates/
"Yielded components can also be invoked with angle bracket syntax".

The problem I see is that the codemod doesn't do this consistently

@kategengler
Copy link
Author

In my example, if the yielded thing were a component, it would be correct and would work. The problem here is that it was not and the result of the codemod was a cryptic error such as "Component Sparkling water from Italy could not be found" that was hard to find the source. Since if it were a component, curly invocation would continue to work, I think the correct thing to do for ambiguous cases would be to leave it alone, and maybe log it.

@sophiaonion
Copy link

Haha, ok got it! Yeah I agree with you on that approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants