ember-angle-brackets-codemod
ember-angle-brackets-codemod copied to clipboard
Incorrect handling of block param properties in iterable helpers
Ex: Input
{{#each model.promoRedemption as |promoRedemption|}}
<tr>
<td>{{promoRedemption.redeemedAt}}</td>
<td>{{promoRedemption.request.id}}</td>
Output
{{#each model.promoRedemption as |promoRedemption|}}
<tr>
<td><promoRedemption.redeemedAt /></td>
<td><promoRedemption.request.id. /></td>
nice one! I'm not sure when I can get to it but hopefully it's not that hard. PR's are welcome.
this issue is that yielded components and regular old data renderings are the same in curly brace notation. The thing to look for is differentiating between iterable helpers and yielded components.
Here's the yielded component example
{{ember-table as |table|}}
{{table.head
columns=columnNames
sorts=sorts
onUpdateSorts=(action (mut sorts))
sortEmptyLast=true
widthConstraint="eq-container"
}}
{!-- to --}
<EmberTable as |Table|>
<Table.head
@columns={{columnNames}}
@sorts={{sorts}}
@onUpdateSorts={{action (mut sorts)}}
@sortEmptyLast={{true}}
@widthConstraint="eq-container"
/>