Support native components with event handlers#52
Support native components with event handlers#52simonihmig wants to merge 1 commit intoember-codemods:masterfrom
Conversation
This is the result of running the tagless-ember-components-codemod against Ember Bootstrap. The following open pull request have been merged in before: - Support native classes: ember-codemods/tagless-ember-components-codemod#44 - Support component with event handlers: ember-codemods/tagless-ember-components-codemod#52 - Support aria role for native classes: ember-codemods/tagless-ember-components-codemod#56 Steps: mv addon/templates/components/common addon/templates/components/base npx jelhan/tagless-ember-components-codemod#merged-native-class-support mv addon/templates/components/base addon/templates/components/common
|
Noticed a small bug when running it against Ember Bootstrap. The event handlers are not converted to lower case. @tagName('form')
export default MyComponent extends Component {
keyPress() {
// ...
}
}is transformed to but should be It might be enough to call |
Ah, good catch, thanks @jelhan! Fixed it! |
|
@Turbo87 thanks for merging the other PR. I rebased this, should be ready now as well! Don't want you to feel bored! 😉 |
|
@simonihmig sorry the radio silence. can you add this as a CLI option? maybe something like |
@Turbo87 sorry, I might have forgotten as some time has passed, but which caveats are you referring to? |
I was talking about the second point of https://github.com/ember-codemods/tagless-ember-components-codemod#known-caveats I've unfortunately seen several codebases already that did something like that :-/ Luckily, there is https://github.com/ember-template-lint/ember-template-lint/blob/master/docs/rule/no-passed-in-event-handlers.md now, that catches this issue, but probably not everyone is using that yet. |
Fixes #42, at least for native components.
Needs #43 and #44 to be merged first. Other than that this should be ready.