-
Notifications
You must be signed in to change notification settings - Fork 13
RFC: Short templates in the top-level-of-a-class position #193
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
Comments
Option A, less text nodes. If there is an element in there tho, option b |
Relevant RFC looking to address the whitespace difference: emberjs/rfcs#982 As mentioned by @NullVoxPopuli, would this imply a template with a single element would also be on one line as follows? export default class MyComponent extends Component {
<template><h1>Hey shorty</h1></template>
} Or would it then switch to a new line? export default class MyComponent extends Component {
<template>
<h1>Hey shorty</h1>
</template>
} Because for that case I also would prefer option b. |
In the current implementation, yes. |
oh, I'd prefer the link breaks then |
trying v2 right now, which is producing one-liners with html tags is not giving the visual cue for the template I'm trying to find. the short version is nice for tests though 😇 |
Update: I got this working, which is how the JSX formatter works: One line if there is no tag: <template>Hey shorty</template> Multi lines if there is a tag: <template>
<h1>Hey shorty</h1>
</template> Multi lines if there is a block and you wrote the block as multiline: <template>
{{#if true}}
Hey shorty
{{/if}}
</template> One line in this case too: <template>{{if true 'Hey shorty'}}</template> |
Vote by reacting to this issue. Comment with more details below. Do you prefer:
Option A (🚀)
This is what v2.0.0-0 is currently returning.
Option B (👎)
This is what v1 currently returns.
Caveats
Neither of these solutions address the issue that whitespace matters in html. 🙈 I haven't had any issues reported here about whitespace causing issues so I am choosing to ignore that for now.
The text was updated successfully, but these errors were encountered: