perf(compiler-cli): ensure module resolution cache is reused for type-check program #39693
Conversation
alxhub
approved these changes
Mar 8, 2021
…-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.
d2b3254
to
d6be996
AndrewKushnir
added a commit
that referenced
this issue
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 issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.


The Angular compiler creates two
ts.Programs; one for emit and one fortemplate type-checking. The creation of the type-check program could
benefit from reusing the
ts.ModuleResolutionCachethat was primedduring the creation of the emit program. This requires that the compiler
host implements
resolveModuleNames, as otherwise TypeScript will setupa
ts.ModuleResolutionHostof its own for both programs.This commit ensures that
resolveModuleNamesis always implemented,even if the originally provided compiler host does not. This is
beneficial for the
ngcbinary.The text was updated successfully, but these errors were encountered: