Skip to content
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

Update to Chokidar v3 #77143

Closed
paulmillr opened this issue Jul 10, 2019 · 22 comments
Closed

Update to Chokidar v3 #77143

paulmillr opened this issue Jul 10, 2019 · 22 comments
Assignees
Labels
debt Code quality issues file-watcher File watcher

Comments

@paulmillr
Copy link

paulmillr commented Jul 10, 2019

Hey! I wonder which steps would it take to:

  1. Update to chokidar v3
  2. Drop vscode-chokidar and vscode-fsevents packages.

Chokidar v3 incorporates a lot of improvements. We've decreased RAM consumption on large directories by a huge amount; and reduced dependency count by a factor of 13. All releases are signed now. See my blog post: Chokidar 3: How to save 32TB of traffic every week with one NPM package

Chokidar v3 requires nodejs 8 and higher. Unsure if that's good with vscode?

BTW, i'm keeping an eye on the Linux issue Ben mentioned.

cc @bpasero

@bpasero bpasero added the file-watcher File watcher label Jul 11, 2019
@bpasero bpasero self-assigned this Jul 11, 2019
@bpasero bpasero added this to the On Deck milestone Jul 11, 2019
@bpasero bpasero added the debt Code quality issues label Jul 11, 2019
@bpasero
Copy link
Member

bpasero commented Jul 11, 2019

Hi @paulmillr, yes we totally want to update and drop our custom forks.

I do not think there is something blocking for us to move to version 3. However, one thing I was hoping gets resolved, still seems to be an issue: paulmillr/chokidar#860 (and the predecessor paulmillr/chokidar#447).

Any thoughts? This is the cause of one of our most upvoted watcher issues: #3998

PS: nice blog post, and great outcome 👍

@paulmillr
Copy link
Author

For mac, I think the issue has been resolved if a user has fsevents.

For linux, i’ll dive into it.

@bpasero
Copy link
Member

bpasero commented Jul 12, 2019

@paulmillr I tested specifically on macOS (version 3.0), were there any changes that came in recently that could have an impact? Maybe you check both OS. This would also be a concern for Windows: up until today we use our own custom file watcher on Windows (C# based), but we would eventually want to change to a single solution.

@paulmillr
Copy link
Author

@bpasero check out the chokidar v2 vs v3 benchmarks — there were definitely some massive improvements across all platforms.

@ashthespy
Copy link

paulmillr/readdirp#99 (comment) is a possible blocker for this, as VS Code also runs on node v10.11.0 currently.

@paulmillr
Copy link
Author

Bigints are supported since 10.2 or so, I don't think this is a root cause of the issue.

@ashthespy
Copy link

Cross linking - electron/electron#15323 is the actual blocker.

@bpasero
Copy link
Member

bpasero commented Aug 6, 2019

@ashthespy your comment in paulmillr/readdirp#99 (comment) seems to suggest that this is fixed in Electron 4? VSCode is using Electron 4 since 2 months.

@ashthespy
Copy link

@ashthespy your comment in paulmillr/readdirp#99 (comment) seems to suggest that this is fixed in Electron 4? VSCode is using Electron 4 since 2 months.

Initially paulmillr/readdirp#99 (comment) seemed to suggest that it was a Node v10 vs v12 issue, but we did indeed figure out it's an electron issue.
So this isn't a blocker any more!

@paulmillr
Copy link
Author

readdirp-3.1.2 is out with the fix for Electron.

@bpasero
Copy link
Member

bpasero commented Aug 26, 2019

@paulmillr if we can get micromatch/anymatch#34 in, that would reduce our needed forks from 2 to 1. In order to get to 0 though we need to allow to set the options from chokidar too, or just hardcode the { dot: true } option.

@paulmillr
Copy link
Author

Easy

@paulmillr
Copy link
Author

@bpasero chokidar@master now uses [email protected] with dot: true by default.

@bpasero
Copy link
Member

bpasero commented Aug 30, 2019

@paulmillr awesome, thanks a ton!! once that is out on NPM we can drop all our forks 🚀

@paulmillr
Copy link
Author

@bpasero could you try how master works meanwhile?

@bpasero
Copy link
Member

bpasero commented Aug 30, 2019

@paulmillr my first testing with master looks good in terms of respecting ignore patterns with a leading "." so I think from that point of view, this change looks good to us.

Still have to do some regression testing to see if events are coming in as before. If you know anything I should watch out for, let me know. We currently only use the watcher on macOS and Linux.

@bpasero
Copy link
Member

bpasero commented Aug 30, 2019

Looks like paulmillr/chokidar#855 (comment) needs to be reopened, I see it in our tests too.

@bpasero
Copy link
Member

bpasero commented Aug 30, 2019

...I am not happy with the new performance on Linux. It seems better on macOS, but not on Linux in my testing. Will follow up in an issue.

Update: paulmillr/chokidar#882

@paulmillr
Copy link
Author

chokidar v3.1 is up!

@bpasero
Copy link
Member

bpasero commented Sep 17, 2019

via #81028

@bpasero bpasero closed this as completed Sep 17, 2019
@paulmillr
Copy link
Author

@bpasero let's update to 3.2, just released this

@bpasero
Copy link
Member

bpasero commented Oct 1, 2019

Will do next week, we close for endgame.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues file-watcher File watcher
Projects
None yet
Development

No branches or pull requests

4 participants