-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Consider replacing chokidar with filespy #2547
Comments
I just realized I'll have to add out-of-root watching to meet Vite's needs. I could write a wrapper package that does that by creating multiple watchers (one per root), but I'll wait for Evan's response first. |
Considering replacing the watcher may introduce unknown behavior changes, I don't think it's worthwhile to replacing it unless chokidar is causing real issues - and so far it seems to be working fine. I also don't think file watching is a perf bottleneck in any known cases unless there are benchmarks showing so. |
Parcel replaced Chokidar with their own C++ watcher (which is what One issue I've had with Chokidar is that it doesn't handle the renaming of directories properly. (paulmillr/chokidar#927) Additionally, having Watchman as an optional backend should improve Vite's DX substantially.
But I agree that such a migration shouldn't be taken lightly. Benchmarks would certainly be needed before taking on such an effort. |
not sure this would work well with pnpm |
@dominikg Not a problem with |
Since I was tagged... we replaced Chokidar in Parcel mainly because we ran into a lot of issues with it especially when building large projects, both on macOS and linux. Mainly this was due to running out of file descriptors due to watching individual files, and the slow crawl over the whole filesystem that chokidar does on startup. In addition, there were stability issues where the watcher would simply stop working after a while. This could have improved in the last couple years though, not sure. That said, the main reason we wrote our own module wasn't actually for watching but for caching. Parcel's watcher can be used to efficiently detect changes in files even after a restart, which makes it work almost like watch mode after a restart. Not sure if this is a problem vite has though. |
Is your feature request related to a problem? Please describe.
Vite could take advantage of Watchman when installed and the other benefits of using filespy, like event throttling, native performance (powered by
@parcel/watcher
), and more.Disclaimer: I haven't compared
chokidar
andfilespy
in a benchmark yet. Should probably do that.Describe the solution you'd like
Replace
chokidar
withfilespy
.The text was updated successfully, but these errors were encountered: