Skip to content

Use node moduleResolution everywhere - #47687

Merged
Andrew Casey (amcasey) merged 1 commit into
microsoft:mainfrom
amcasey:ModRes
Feb 2, 2022
Merged

Use node moduleResolution everywhere#47687
Andrew Casey (amcasey) merged 1 commit into
microsoft:mainfrom
amcasey:ModRes

Conversation

@amcasey

@amcasey Andrew Casey (amcasey) commented Feb 1, 2022

Copy link
Copy Markdown
Member

TestRunner was already using it, but upstream projects (e.g. Compiler) were not, causing TestRunner to re-parse and re-bind all upstream files in (at least) editor scenarios), slowing down initial project load.

In local testing, this cut a find-all-refs call in checker.ts from 5s to 2.5s.

TestRunner was already using it, but upstream projects (e.g. Compiler) were not, causing TestRunner to re-parse and re-bind all upstream files in (at least) editor scenarios), slowing down initial project load.

In local testing, this cut a find-all-refs call in checker.ts from 5s to 2.5s.

@jakebailey Jake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All for it, I can't believe this would harm anything.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the concern might've been with accidentally importing things. I don't think it's a big enough concern to block this change.

@amcasey
Andrew Casey (amcasey) merged commit 7cc0f75 into microsoft:main Feb 2, 2022
@ahejlsberg

Copy link
Copy Markdown
Member

Just tried a build with this change. After a cold start the language service is definitely quicker to respond to a find-all-references. Nice find!

@amcasey

Copy link
Copy Markdown
Member Author

I'm planning to add some tracing so we can warn others if it's happening to them.

Andrew Casey (amcasey) added a commit to amcasey/TypeScript that referenced this pull request Feb 7, 2022
...to help detect misconfigurations like microsoft#47687.
Andrew Casey (amcasey) added a commit that referenced this pull request Feb 8, 2022
...to help detect misconfigurations like #47687.
@Utsav2

Copy link
Copy Markdown

Just want to say - thank you for adding this trace. It helped us debug why tsserver was recompiling a shared project (and its node modules) for each new project opened in VSCode. The culprit was different typeRoots causing cache misses.

@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

6 participants