Skip to content

Defer the initializations in TI which results in many fileExistancy checks for existing packages and reading type registry to at use time #52817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sheetalkamat
Copy link
Member

Fixes #52705

…hecks for existing packages and reading type registry to at use time

Fixes #52705
@@ -106,7 +106,7 @@ type ExecSync = (command: string, options: ExecSyncOptions) => string;
export class NodeTypingsInstaller extends TypingsInstaller {
private readonly nodeExecSync: ExecSync;
private readonly npmPath: string;
readonly typesRegistry: Map<string, MapLike<string>>;
typesRegistry: Map<string, MapLike<string>> = undefined!;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is only referenced once; can we just make it potentially undefined and then assertDefined at its one usage, rather than adding undefined!?

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea, but a bigger architectural change might instead be good if it were possible to create TypingsInstaller itself lazily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS Server stats files in ATA cache even if ATA is not being used
4 participants