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
Contributor

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.

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
@uniqueiniquity uniqueiniquity deleted the stopInvalidatingOnOpenFileSave branch June 1, 2019 00:36
@uniqueiniquity uniqueiniquity restored the stopInvalidatingOnOpenFileSave branch June 12, 2019 18:07
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants