Skip to content

Commit

Permalink
perf(ivy): cache export scopes extracted from declaration files (#34332)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JoostK authored and kara committed Dec 12, 2019
1 parent ce94192 commit eb9a8ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/compiler-cli/src/ngtsc/scope/src/dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>(
Expand Down

0 comments on commit eb9a8ac

Please sign in to comment.