-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add support for single-file components #299
Conversation
export default class ActionComponent extends Component<ActionComponentSignature> { | ||
<template> | ||
<button type="button" class="action" ...attributes> | ||
{{yield}} | ||
</button> | ||
</template> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The short-term downside of .gts
is that GitHub doesn't have syntax highlighting yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we should be able to configure this using an override in a .gitattributes
file 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, let's give it a try! 🚀
export default class ActionComponent extends Component<ActionComponentSignature> { | ||
<template> | ||
<button type="button" class="action" ...attributes> | ||
{{yield}} | ||
</button> | ||
</template> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we should be able to configure this using an override in a .gitattributes
file 🙌
Adds support for template imports, i.e., single-file components, and converts
action.hbs/ts
toaction.gts
.Single-file components are are expected to be the recommended authoring format for Ember 5x; might as well get good seats on that train (source: Ember Blog).
Guided by ▶ EmberConf 2023 - Getting Started with 'template' Tag Components by Ignace Maes which also does a good job showing the benefits of this new format, such as locally defined components (shown below). It should boost DX, reduce file count, and make code review easier.