Skip to content

Commit 02475f2

Browse files
committed
add parentElement to meta
1 parent 9301407 commit 02475f2

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

packages/@glimmer/interfaces/lib/runtime/debug-render-tree.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface RenderNode {
1717
args: CapturedArguments;
1818
instance: unknown;
1919
template?: string | undefined;
20+
meta?: Record<string, any>;
2021
}
2122

2223
export interface CapturedRenderNode {
@@ -26,6 +27,7 @@ export interface CapturedRenderNode {
2627
args: Arguments;
2728
instance: unknown;
2829
template: string | null;
30+
meta: Record<string, any> | null;
2931
bounds: null | {
3032
parentElement: SimpleElement;
3133
firstNode: SimpleNode;

packages/@glimmer/runtime/lib/compiled/opcodes/dom.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ APPEND_OPCODES.add(VM_PUSH_REMOTE_ELEMENT_OP, (vm) => {
103103
name: 'in-element',
104104
args,
105105
instance: null,
106+
meta: {
107+
parentElement: vm.elements().element,
108+
},
106109
});
107110

108111
registerDestructor(block, () => {

packages/@glimmer/runtime/lib/debug-render-tree.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,21 @@ export default class DebugRenderTreeImpl<
182182

183183
private captureNode(id: string, state: TBucket): CapturedRenderNode {
184184
let node = this.nodeFor(state);
185-
let { type, name, args, instance, refs } = node;
185+
let { type, name, args, instance, refs, meta = null } = node;
186186
let template = this.captureTemplate(node);
187187
let bounds = this.captureBounds(node);
188188
let children = this.captureRefs(refs);
189-
return { id, type, name, args: reifyArgsDebug(args), instance, template, bounds, children };
189+
return {
190+
id,
191+
type,
192+
name,
193+
args: reifyArgsDebug(args),
194+
instance,
195+
template,
196+
bounds,
197+
children,
198+
meta,
199+
};
190200
}
191201

192202
private captureTemplate({ template }: InternalRenderNode<TBucket>): Nullable<string> {

0 commit comments

Comments
 (0)