From cb7e904ae04e6d3ae7804bbb36b79400ad13cdc5 Mon Sep 17 00:00:00 2001 From: Patrick Pircher Date: Fri, 28 Jun 2024 12:10:09 +0200 Subject: [PATCH 1/3] provide name for template only components --- ember_debug/libs/render-tree.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ember_debug/libs/render-tree.js b/ember_debug/libs/render-tree.js index 9cb6ce0ea7..9c7ecf7505 100644 --- a/ember_debug/libs/render-tree.js +++ b/ember_debug/libs/render-tree.js @@ -661,6 +661,9 @@ 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 From 73f4575b29dc9b77c429bc8da27b6f132d22ea7a Mon Sep 17 00:00:00 2001 From: Patrick Pircher Date: Fri, 28 Jun 2024 13:35:14 +0200 Subject: [PATCH 2/3] fix lint --- ember_debug/libs/render-tree.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ember_debug/libs/render-tree.js b/ember_debug/libs/render-tree.js index 9c7ecf7505..35207a599d 100644 --- a/ember_debug/libs/render-tree.js +++ b/ember_debug/libs/render-tree.js @@ -661,8 +661,14 @@ 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); + 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', From fc44c29be57f6b0b919bc39aaa1673528d13738f Mon Sep 17 00:00:00 2001 From: Patrick Pircher Date: Fri, 28 Jun 2024 13:39:34 +0200 Subject: [PATCH 3/3] safe --- ember_debug/libs/render-tree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ember_debug/libs/render-tree.js b/ember_debug/libs/render-tree.js index 35207a599d..03d027e642 100644 --- a/ember_debug/libs/render-tree.js +++ b/ember_debug/libs/render-tree.js @@ -663,7 +663,7 @@ export default class RenderTree { if (node.type === 'component' && !node.instance) { if ( node.name === '(unknown template-only component)' && - node.template.endsWith('.hbs') + node.template?.endsWith('.hbs') ) { node.name = node.template .split(/\\|\//)