Skip to content

Commit e6ba8a7

Browse files
committed
add current element to in-element
1 parent f036320 commit e6ba8a7

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

packages/@glimmer-workspace/integration-tests/test/debug-render-tree-test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class DebugRenderTreeTest extends RenderTest {
311311
type: 'keyword',
312312
name: 'in-element',
313313
args: { positional: [this.element.firstChild], named: {} },
314-
instance: (instance: GlimmerishComponent) => instance === null,
314+
instance: (instance: any) => instance === null,
315315
template: null,
316316
bounds: this.elementBounds(this.element.firstChild! as unknown as Element),
317317
children: [

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

+2
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

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ APPEND_OPCODES.add(Op.PushRemoteElement, (vm) => {
8787
name: 'in-element',
8888
args,
8989
instance: null,
90+
meta: {
91+
parentElement: vm.elements().element,
92+
},
9093
});
9194

9295
registerDestructor(block, () => {

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

+12-2
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,21 @@ export default class DebugRenderTreeImpl<TBucket extends object>
177177

178178
private captureNode(id: string, state: TBucket): CapturedRenderNode {
179179
let node = this.nodeFor(state);
180-
let { type, name, args, instance, refs } = node;
180+
let { type, name, args, instance, refs, meta = null } = node;
181181
let template = this.captureTemplate(node);
182182
let bounds = this.captureBounds(node);
183183
let children = this.captureRefs(refs);
184-
return { id, type, name, args: reifyArgsDebug(args), instance, template, bounds, children };
184+
return {
185+
id,
186+
type,
187+
name,
188+
args: reifyArgsDebug(args),
189+
instance,
190+
template,
191+
bounds,
192+
children,
193+
meta,
194+
};
185195
}
186196

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

packages/@glimmer/syntax/test/plugin-node-test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ test('deprecated program visitor', (assert) => {
4848
return {
4949
name: 'plugin',
5050
visitor: {
51-
// eslint-disable-next-line deprecation/deprecation
5251
Program(node: AST.Program) {
5352
assert.step(node.type);
5453
},

0 commit comments

Comments
 (0)