perf(compiler-cli): ensure module resolution cache is reused for type-check program by JoostK · Pull Request #39693 · angular/angular

@JoostK added refactoring

Issue that involves refactoring or code-cleanup

target: patch

This PR is targeted for the next patch release

area: compiler

Issues related to `ngc`, Angular's template compiler

labels

Nov 14, 2020

@JoostK JoostK marked this pull request as ready for review

November 14, 2020 22:40

@JoostK JoostK added the action: review

The PR is still awaiting reviews from at least one requested reviewer

label

Nov 14, 2020

@JoostK

…-check program

The Angular compiler creates two `ts.Program`s; one for emit and one for
template type-checking. The creation of the type-check program could
benefit from reusing the `ts.ModuleResolutionCache` that was primed
during the creation of the emit program. This requires that the compiler
host implements `resolveModuleNames`, as otherwise TypeScript will setup
a `ts.ModuleResolutionHost` of its own for both programs.

This commit ensures that `resolveModuleNames` is always implemented,
even if the originally provided compiler host does not. This is
beneficial for the `ngc` binary.

AndrewKushnir pushed a commit that referenced this pull request

Mar 9, 2021
…-check program (#39693)

The Angular compiler creates two `ts.Program`s; one for emit and one for
template type-checking. The creation of the type-check program could
benefit from reusing the `ts.ModuleResolutionCache` that was primed
during the creation of the emit program. This requires that the compiler
host implements `resolveModuleNames`, as otherwise TypeScript will setup
a `ts.ModuleResolutionHost` of its own for both programs.

This commit ensures that `resolveModuleNames` is always implemented,
even if the originally provided compiler host does not. This is
beneficial for the `ngc` binary.

PR Close #39693

This was referenced

Mar 10, 2021

This was referenced

Mar 15, 2021