Uh oh!
There was an error while loading. Please reload this page.
Watch extended configs if present - #41493
Conversation
bdf7c2e to
ad2fbaaCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
053e9b4 to
31f0d50CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
31f0d50 to
4d59cc6CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
588bee3 to
36c29cbCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d091cb9 to
4224dd7Compare
|
67dcc8e to
86905beCompareUh oh!
There was an error while loading. Please reload this page.
| ) { | ||
| const extendedSourceFiles = configFile.extendedSourceFiles || emptyArray; | ||
| // TODO(rbuckton): Should be a `Set` but that requires changing the below code that uses `mutateMap` | ||
| const newExtendedConfigFilesMap = arrayToMap(extendedSourceFiles, identity, returnTrue); |
There was a problem hiding this comment.
Key needs to be Path, value needs to be file name to watch
There was a problem hiding this comment.
This doesnot create the key with Path
There was a problem hiding this comment.
Ah, I missed the meaning of this the first time around. I'll pass something to allow converting from string to Path.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Michael Molisani (molisani)
left a comment
There was a problem hiding this comment.
Will update to correctly account for removals, and add new tests. Had a few questions about latest review.
Uh oh!
There was an error while loading. Please reload this page.
Michael Molisani (molisani)
commented
Dec 4, 2020
While creating a test case for removing projects, I noticed that I had not considered the builder's watch logic. I'll replicate the "shared" watcher pattern from the server here as well. |
1acd39c to
2284a6cCompare
Sheetal Nandi (sheetalkamat)
left a comment
There was a problem hiding this comment.
I have some more feedback but i am going to try fixing some of those myself as that might be easier
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| ) { | ||
| const extendedSourceFiles = configFile.extendedSourceFiles || emptyArray; | ||
| // TODO(rbuckton): Should be a `Set` but that requires changing the below code that uses `mutateMap` | ||
| const newExtendedConfigFilesMap = arrayToMap(extendedSourceFiles, identity, returnTrue); |
There was a problem hiding this comment.
This doesnot create the key with Path
Michael Molisani (molisani)
commented
Dec 10, 2020
Thank you very much for those suggestions. I merged all of them and then applied the |
Sheetal Nandi (sheetalkamat)
commented
Dec 11, 2020
Please cherry pick e2d178f as i dont have permission to update your fork. |
Added new `WatchType` for extended config files. Refactored watch map update to separate function, relocated call sites. Removed unnecessary test cases and relocated with new tests in programUpdates.
Update `updateExtendedConfigFilesWatch` to read from a `TsConfigSourceFile` to get `extendedSourceFiles`. Add watcher map to `ConfiguredProject` in the server. New test cases to verify correct events triggered and extended files are being watched properly.
Removes unnecessary actions in extended config watcher callback function. Updates tests to match.
New shared watcher map in ProjectService that stores callbacks per project to be invoked when the file watcher is triggered. The FileWatcher is created with the watch options of the first Project to watch the extended config.
Remove all server-related utility functions/types from watchUtilities. Store config-project mapping and config file watchers inside ProjectService with new private methods to add or remove projects.
Creates SharedExtendedConfigFileWatcher in both editorServices (tsserver) and tsbuildPublic. The file watcher is responsible for triggering a full project reload for the contained projects. Upon reload, any configs that are no longer related to a project have their watchers updated to match. New test cases to confirm that the file watchers for extended configs are closed when the project is closed.
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
3a0c0dd to
7d25e43CompareMichael Molisani (molisani)
commented
Dec 11, 2020
The unified |
Fixes#17753
Inspects
extendedSourceFilesfromconfigFileinCompilerOptionsand starts a watcher for each file. Watch callback invokesscheduleProgramReloadjust like the watcher for the main config file. Watcher pattern modelled after watcher map for missing files. Also provides shared watcher map for situations where multiple projects are open at once (tsbuild/tsserver).Added new test cases, including chain of extended configs and ones copied from
watchEnvironment/watchOptionswith extended configs to verify they are being watched.