From ad5b667a9320cb9ad97f0aaf73b162241a9e7820 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Thu, 13 Jul 2023 16:31:03 -0400 Subject: [PATCH] Make component ready on afterScopeCreate --- src/Program.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Program.ts b/src/Program.ts index 256250ec7..0e1114cf4 100644 --- a/src/Program.ts +++ b/src/Program.ts @@ -159,7 +159,6 @@ export class Program { protected addScope(scope: Scope) { this.scopes[scope.name] = scope; - this.plugins.emit('afterScopeCreate', scope); } /** @@ -474,6 +473,8 @@ export class Program { //register this compoent now that we have parsed it and know its component name this.registerComponent(xmlFile, scope); + //notify plugins that the scope is created and the component is registered + this.plugins.emit('afterScopeCreate', scope); } else { //TODO do we actually need to implement this? Figure out how to handle img paths // let genericFile = this.files[srcPath] = { @@ -561,6 +562,7 @@ export class Program { const sourceScope = new Scope('source', this, 'scope:source'); sourceScope.attachDependencyGraph(this.dependencyGraph); this.addScope(sourceScope); + this.plugins.emit('afterScopeCreate', sourceScope); } }