Skip to content

perf(compiler-cli): ensure module resolution cache is reused for type-check program#39693

Closed
JoostK wants to merge 1 commit intoangular:masterfrom
JoostK:ngtsc/shared-module-resolution-cache
Closed

perf(compiler-cli): ensure module resolution cache is reused for type-check program#39693
JoostK wants to merge 1 commit intoangular:masterfrom
JoostK:ngtsc/shared-module-resolution-cache

Conversation

@JoostK
Copy link
Member

@JoostK JoostK commented Nov 14, 2020

The Angular compiler creates two ts.Programs; 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.

@JoostK 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
@google-cla google-cla bot added the cla: yes label Nov 14, 2020
@ngbot ngbot bot modified the milestone: needsTriage 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 JoostK requested a review from alxhub November 14, 2020 22:48
…-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.
@JoostK JoostK force-pushed the ngtsc/shared-module-resolution-cache branch from d2b3254 to d6be996 Compare March 9, 2021 16:29
@JoostK JoostK added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 9, 2021
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Mar 9, 2021
@JoostK JoostK added the action: merge The PR is ready for merge by the caretaker label Mar 9, 2021
@AndrewKushnir
Copy link
Contributor

Presubmit.

@AndrewKushnir AndrewKushnir removed the action: presubmit The PR is in need of a google3 presubmit label Mar 9, 2021
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 15, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler cla: yes refactoring Issue that involves refactoring or code-cleanup target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants