Skip to content
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

Stop invalidating module resolution cache when saving an open file #31685

Merged

Conversation

@uniqueiniquity
Copy link
Member

commented May 31, 2019

In Visual Studio, we currently trigger directory watchers when saving an open file.
In projects with sufficiently large dependencies (i.e., the ASP.NET Core Angular template), this causes the module resolution cache to be entirely invalidated, thereby triggering a seconds-long updateGraph operation to occur.
This change aims to prevent this scenario by checking if the file whose change triggered the directory watcher is still open and, if so, not invalidating the cache.

@uniqueiniquity uniqueiniquity requested a review from sheetalkamat May 31, 2019
@uniqueiniquity uniqueiniquity assigned amcasey and unassigned amcasey May 31, 2019
@uniqueiniquity uniqueiniquity requested a review from amcasey May 31, 2019
src/compiler/resolutionCache.ts Outdated Show resolved Hide resolved
src/compiler/watch.ts Outdated Show resolved Hide resolved
src/server/project.ts Show resolved Hide resolved
@uniqueiniquity uniqueiniquity merged commit eb81fea into microsoft:master Jun 1, 2019
5 checks passed
5 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details
node10 Build #32096 succeeded
Details
node12 Build #32094 succeeded
Details
node8 Build #32095 succeeded
Details
@uniqueiniquity uniqueiniquity deleted the uniqueiniquity:stopInvalidatingOnOpenFileSave branch Jun 1, 2019
@uniqueiniquity uniqueiniquity restored the uniqueiniquity:stopInvalidatingOnOpenFileSave branch Jun 12, 2019
uniqueiniquity added a commit to uniqueiniquity/TypeScript that referenced this pull request Jun 12, 2019
…ngOnOpenFileSave

Stop invalidating module resolution cache when saving an open file
uniqueiniquity added a commit that referenced this pull request Jun 12, 2019
Port #31685 to release-3.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.