Skip to content

Commit

Permalink
+
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Feb 6, 2024
1 parent 391715f commit 9e85389
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion 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 {
Expand Down
8 changes: 6 additions & 2 deletions 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,
}
}
1 change: 1 addition & 0 deletions src/ember-compat/ember__template-compilation.ts
Expand Up @@ -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('$')) {
Expand Down

0 comments on commit 9e85389

Please sign in to comment.