Repository navigation
Conversation
… v5 unlink workaround Chokidar 6 makes `FSWatcher.close()` terminal, throwing synchronously if `watcher.add()` is called once closing has started. Guard `add()`, `remove()`, `scheduleBaselineCheck()`, and `checkChokidarBaselines()` against `watcher.closed`, and clear tracked file state when the watcher is closed. Additionally, replace the deprecated `usePolling` and `interval` Chokidar options with `backend` and `pollingInterval`. Remove the Chokidar 5 `unlink` re-watch workaround and its corresponding baseline check branch, as Chokidar 6 natively awaits recreated paths from their nearest existing ancestor across all watched directories.
There was a problem hiding this comment.
Code Review
This pull request simplifies the Chokidar file watcher implementation by removing complex baseline and unlink logic, and adds safety checks to prevent errors when adding or removing paths after the watcher is closed. The review feedback correctly points out that 'auto' is not a supported value for Chokidar's backend option and suggests using undefined instead to let Chokidar automatically select the appropriate backend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Chokidar 6 makes
FSWatcher.close()terminal, throwing synchronously ifwatcher.add()is called once closing has started. Guardadd(),remove(),scheduleBaselineCheck(), andcheckChokidarBaselines()againstwatcher.closed, and clear tracked file state when the watcher is closed.Additionally, replace the deprecated
usePollingandintervalChokidar options withbackendandpollingInterval. Remove the Chokidar 5unlinkre-watch workaround and its corresponding baseline check branch, as Chokidar 6 natively awaits recreated paths from their nearest existing ancestor across all watched directories.