-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
chore(deps): update chokidar to v4 #5256
Open
ggodlewski
wants to merge
5
commits into
mochajs:main
Choose a base branch
from
ggodlewski:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6893764
chore(deps): update choikdar to v4
ggodlewski 90d7cce
Merge branch 'mochajs:main' into main
ggodlewski 65eee8d
chore: resolve comment issues
ggodlewski d214cda
fix: prevent traversing ignored directories
ggodlewski f9fa7e8
Remove unnecessary line
ggodlewski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
[Bug] I tried this PR out on real-world code and found a performance issue from files being renamed. I found it on the ESLint codebase but also reproduced it in isolation here: https://github.com/JoshuaKGoldberg/repros/tree/mocha-chokidar-v4-pr-watching. Could you please take a look?
tl;dr: in a minimal codebase with two root-level test files, re-watching is reported as taking >200ms
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.
How exactly are you renaming the file? I run
mv b.test.js z.test.js
and I don't have the state with 0 passing: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.
Interesting. I did it through the VS Code UI. This is on an m1 Mac.
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.
I'm running Ubuntu. I have no hardware to reproduce it. It's strange because the
tracker.regenerate();
is only triggered onevent === 'add'
. I don't see how the list of files can be empty during rename of 1 file. Maybe you can add some debug output so we can trace the tracker method calls?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.
👍 added to the README.md. Interestingly, the long delay of ~200ms only happens if an
npm install
populatednode_modules/
. If yourm -rf node_modules/
then the delay is only around 20-30ms.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.
I added one more improvement. Glob should not traverse
node_modules
. Can you check if it improves anything?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.
💯 that fixed it for me! Back to 0-1ms on the middle waiting.
+1 that it's a generalized solution too, not specific to
node_modules
. Nice 🙂