perf(ivy): cache export scopes extracted from declaration files (#34332)

The export scope of NgModules from external compilations units, as
present in .d.ts declarations, does not change during a compilation so
can be easily shared. There was already a cache but the computed export
scope was not actually stored there. This commit fixes that.

PR Close #34332
This commit is contained in:
JoostK 2019-12-07 22:36:58 +01:00 committed by Kara Erickson
parent 6e5f076330
commit 2f5ddd9c96
1 changed files with 3 additions and 1 deletions

View File

@ -123,9 +123,11 @@ export class MetadataDtsModuleScopeResolver implements DtsModuleScopeResolver {
throw new Error(`Exported value ${exportRef.debugName} was not a directive, pipe, or module`);
}
return {
const exportScope: ExportScope = {
exported: {directives, pipes},
};
this.cache.set(clazz, exportScope);
return exportScope;
}
private maybeAlias<T extends DirectiveMeta|PipeMeta>(