diff --git a/app/components/template-import/index.hbs b/app/components/template-import/index.hbs new file mode 100644 index 0000000..3bcd901 --- /dev/null +++ b/app/components/template-import/index.hbs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/components/template-import/index.ts b/app/components/template-import/index.ts new file mode 100644 index 0000000..5af48db --- /dev/null +++ b/app/components/template-import/index.ts @@ -0,0 +1,6 @@ +import Component from '@glimmer/component'; +import PossibleUndefined from './../possible-undefined/component'; + +export default class MyComponent extends Component { + hello = PossibleUndefined; +} \ No newline at end of file diff --git a/src/lib/ast-helpers.ts b/src/lib/ast-helpers.ts index e638212..74a7d39 100644 --- a/src/lib/ast-helpers.ts +++ b/src/lib/ast-helpers.ts @@ -92,6 +92,9 @@ export function isEachArgument(focusPath) { } export function isSimpleBlockComponentElement(node) { + if (node.tag.startsWith('this.')) { + return true; + } return !node.tag.startsWith('.') && node.tag.charAt(0) !== '@' && node.tag.charAt(0) === node.tag.charAt(0).toUpperCase() && node.tag.indexOf('.') === -1; } @@ -107,7 +110,7 @@ export function keyForItem(item) { } export function tagComponentToBlock(node) { - const componentName = normalizeAngleTagName(node.tag); + const componentName = node.tag.startsWith('this.') ? node.tag : normalizeAngleTagName(node.tag); return { type: 'BlockStatement', isComponent: true,