Skip to content

Use node moduleResolution everywhere #47687

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

Merged
merged 1 commit into from
Feb 2, 2022
Merged

Conversation

amcasey
Copy link
Member

@amcasey amcasey commented Feb 1, 2022

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.
Copy link
Member

@jakebailey jakebailey left a comment

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
Member

@DanielRosenwasser DanielRosenwasser left a comment

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 amcasey merged commit 7cc0f75 into microsoft:main Feb 2, 2022
@amcasey amcasey deleted the ModRes branch February 2, 2022 00:00
@ahejlsberg
Copy link
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
Member Author

amcasey commented Feb 2, 2022

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

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

Utsav2 commented Mar 4, 2022

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.

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.

6 participants