-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Instead of clearing out all resolutions and closing all the directory watchers, mark everything as invalidated when changes affect module resolution #53882
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
Conversation
sheetalkamat
commented
Apr 17, 2023
- This avoids unnecessary watch closing and adding depending on resolution setting.
- Also changed how we toggle js setting for inferred project when inferred project becomes orphan. Before this change in inferred project with only js file, we would toggle it to non js when that js file is closed and then when another js file is opened reusing the inferred project we would retoggle it back to js project
…d so all watches are not cleared up
/user/username/projects/myproject/data.json: | ||
{"pollingInterval":500} *new* | ||
/user/username/projects/myproject/node_modules/@types: | ||
{"pollingInterval":500} *new* | ||
/user/username/projects/node_modules/@types: | ||
{"pollingInterval":500} *new* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These use to be deleted and created again when module resolution settings changed
@@ -515,7 +515,7 @@ Loading module as file / folder, candidate module location '/user/username/proje | |||
File '/user/username/projects/transitiveReferences/b.ts' does not exist. | |||
File '/user/username/projects/transitiveReferences/b.tsx' does not exist. | |||
File '/user/username/projects/transitiveReferences/b.d.ts' does not exist. | |||
File '/user/username/projects/transitiveReferences/b/package.json' does not exist. | |||
File '/user/username/projects/transitiveReferences/b/package.json' does not exist according to earlier cached lookups. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also dont need to re-read package json because of this.
@@ -90,10 +90,6 @@ Info seq [hh:mm:ss:mss] Config: /user/username/projects/myproject/jsconfig.json | |||
} | |||
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/jsconfig.json WatchType: Wild card directory | |||
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject 1 undefined Config: /user/username/projects/myproject/jsconfig.json WatchType: Wild card directory | |||
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /dev/null/inferredProject1* WatchType: Type roots |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was because inferred project was marked to be non js and it would mean change in options that affect module so earlier we were closing all the watchers, but now we keep them alive (just like if it would have been ts only inferred project to start with)
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/myproject/node_modules/@types 1 undefined Project: /user/username/projects/myproject/c/tsconfig.json WatchType: Type roots | ||
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/myproject/c/tsconfig.json WatchType: Type roots | ||
Info seq [hh:mm:ss:mss] Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /user/username/projects/node_modules/@types 1 undefined Project: /user/username/projects/myproject/c/tsconfig.json WatchType: Type roots | ||
Info seq [hh:mm:ss:mss] DirectoryWatcher:: Close:: WatchInfo: /user/username/projects/myproject/refs 1 undefined Project: /user/username/projects/myproject/c/tsconfig.json WatchType: Failed Lookup Locations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shows how we only close -not needed directory watcher only instead of deleting all and adding them back