Skip to content

Commit

Permalink
provide name for hbs template only components (#2581)
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Jul 26, 2024
1 parent b09f0c2 commit 0967c3f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ember_debug/libs/render-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,15 @@ export default class RenderTree {
}

if (node.type === 'component' && !node.instance) {
if (
node.name === '(unknown template-only component)' &&
node.template?.endsWith('.hbs')
) {
node.name = node.template
.split(/\\|\//)
.slice(-1)[0]
.slice(0, -'.hbs'.length);
}
node.instance = this._createSimpleInstance(
'TemplateOnlyComponent',
node.args.named
Expand Down

0 comments on commit 0967c3f

Please sign in to comment.