-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[handlebars] Named blocks can't be self closing (#11900)
- Loading branch information
1 parent
c0250b3
commit 99649c7
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#### Support Glimmer's named blocks (#11899 by @duailibe) | ||
|
||
Prettier already supported this feature, but it converted empty named blocks to self-closing, which is not supported by the Glimmer compiler. | ||
|
||
See: [Glimmer's named blocks](https://emberjs.github.io/rfcs/0460-yieldable-named-blocks.html). | ||
|
||
<!-- prettier-ignore --> | ||
```hbs | ||
// Input | ||
<Component> | ||
<:named></:named> | ||
</Component> | ||
// Prettier stable | ||
<Component> | ||
<:named /> | ||
</Component> | ||
// Prettier main | ||
<Component> | ||
<:named></:named> | ||
</Component> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<ComponentWithNamedBlocks> | ||
<:first-named-block></:first-named-block> | ||
<:second-named-block> </:second-named-block> | ||
<:named-block-with-comment>{{! Do not convert to an empty element}}</:named-block-with-comment> | ||
<:named-block-with-content>Hello</:named-block-with-content> | ||
</ComponentWithNamedBlocks> |