diff --git a/src/ember-compat/ember__component.ts b/src/ember-compat/ember__component.ts index b825fe3..97eadc9 100644 --- a/src/ember-compat/ember__component.ts +++ b/src/ember-compat/ember__component.ts @@ -1,7 +1,10 @@ import { $template, Component } from '../utils'; import { TEMPLATE_ONLY } from './ember__component__template-only'; +export const TEMPLATE_META = new Map(); export function setComponentTemplate(tpl: any, cmp: any) { - if (cmp === TEMPLATE_ONLY) { + if (cmp.TEMPLATE_ONLY === TEMPLATE_ONLY) { + // console.log(cmp); + TEMPLATE_META.set(tpl, cmp); return tpl; } else { return class extends cmp { diff --git a/src/ember-compat/ember__component__template-only.ts b/src/ember-compat/ember__component__template-only.ts index 9c54c5a..27bc473 100644 --- a/src/ember-compat/ember__component__template-only.ts +++ b/src/ember-compat/ember__component__template-only.ts @@ -1,4 +1,8 @@ export const TEMPLATE_ONLY = Symbol('template-only-component'); -export default function () { - return TEMPLATE_ONLY; +export default function (moduleName: string, name: string) { + return { + TEMPLATE_ONLY, + moduleName, + name, + } } diff --git a/src/ember-compat/ember__template-compilation.ts b/src/ember-compat/ember__template-compilation.ts index f60a374..9aef9c5 100644 --- a/src/ember-compat/ember__template-compilation.ts +++ b/src/ember-compat/ember__template-compilation.ts @@ -4,6 +4,7 @@ import { format } from 'prettier/standalone'; import parserBabel from 'prettier/plugins/babel'; import estree from 'prettier/plugins/estree'; import { SYMBOLS } from '../../plugins/symbols'; +import { TEMPLATE_META } from './ember__component'; Object.keys(fns).forEach((key) => { if (key.startsWith('$')) {