Skip to content

Commit 479979f

Browse files
committed
+
1 parent 284cdca commit 479979f

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

plugins/utils.ts

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export function serializePath(
6868
}
6969

7070
export function resolvedChildren(els: ASTv1.Node[]) {
71+
if (els.length === 1 && els[0].type === 'BlockStatement') {
72+
// hack for 'else if' // @todo write proper nesting
73+
return resolvedChildren((els[0] as ASTv1.BlockStatement).program.body);
74+
}
7175
return els.filter((el) => {
7276
if (
7377
el.type === 'CommentStatement' ||

src/components/Application.gts

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ export class Application extends Component {
4444
@stack={{this.router.stack}}
4545
/>
4646
<EuiAvatar
47+
@color='#BD10E0'
48+
@size='l'
49+
@type='user'
4750
@name='John Doe'
48-
@imgUrl='https://plus.unsplash.com/premium_photo-1669324357471-e33e71e3f3d8?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8dXJsfGVufDB8fDB8fHww'
51+
@imageUrl='https://plus.unsplash.com/premium_photo-1669324357471-e33e71e3f3d8?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MXx8dXJsfGVufDB8fDB8fHww'
4952
@iconClasses={{array '1'}}
5053
/>
5154
</template>

src/ember-compat/ember__helper.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export { $__hash as hash } from '@/utils/helpers/index';
2-
export function get() {
3-
debugger;
4-
}
2+
export function get(obj: Record<string, any>, key: string) {
3+
return key.split('.').reduce((acc, key) => {
4+
return acc[key];
5+
}, obj);
6+
}

src/ember-compat/ember__template-compilation.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function precompileTemplate(tpl: string, args: {
1919
const keys = Object.keys(args.scope());
2020
const transformResult = transform(`export function t() {
2121
this['args'] = arguments[0];
22+
this['$fw'] = arguments[1] || this['$fw'];
2223
let {${keys.join(', ')}} = globalThis.scopes.get('${scopeId}')();
2324
return hbs\`${tpl}\`;
2425
}`, 'name.js', 'development', false);

src/utils/dom.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141
setBounds,
4242
} from './shared';
4343
import { modifierManagers } from '../ember-compat/ember__modifier';
44-
import Helper from '../ember-compat/ember__component__helper';
4544

4645
// EMPTY DOM PROPS
4746
export const $_edp = [[], [], []] as Props;
@@ -132,6 +131,7 @@ export function $_maybeHelper(value: any) {
132131
if (value.prototype && value.prototype.compute) {
133132
const helper = new value();
134133
return (...args: any[]) => {
134+
// debugger;
135135
return helper.compute.call(helper, args, {});
136136
}
137137
}
@@ -430,7 +430,7 @@ function component(
430430
if ($template in instance) {
431431
const result = (
432432
instance[$template] as unknown as () => ComponentReturnType
433-
)();
433+
)(args, fw);
434434
if (IS_DEV_MODE) {
435435
// @ts-expect-error new
436436
instance.debugName = comp.name;

0 commit comments

Comments
 (0)