Improve large watcher events payload experience #9583
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
↪️ Pull Request
On large projects after branch changes or yarn installs the watcher can take a very long time to respond with the changed files. The cache invalidation in
respondToFSEvents
can then often take an extremely long time to process all the events. This PR attempts to make the experience nicer with the following changes:RequestGraph.respondToFSEvents
which will result in using a fresh cache if it times outrespondToFSEvents
, this ensures we don't do extra work when bailouts occurI've also added bonus change. I've added a new
meta
property to theDiagnostic
type. This allows us to forward extra information to our reporters from the logger for analytics purposes.✔️ PR Todo