-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Respect FS_ACCURACY when determining if file is untouched #215
Conversation
Codecov Report
@@ Coverage Diff @@
## main #215 +/- ##
==========================================
- Coverage 92.21% 92.12% -0.09%
==========================================
Files 6 6
Lines 1040 1041 +1
Branches 248 249 +1
==========================================
Hits 959 959
- Misses 81 82 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
not sure that issue is related to this... It appears for me in some strange circumstances.. |
I am able to repro 100% on M1 mac. The issue seems to be due to fs.watch triggering a change event twice on every save - one as a "typical This is reproducible with just raw node script
Based on the commit I linked above, I am following that as precedent for filtering out these double events. This fixes my repro 100% of the time |
/cc @sokra |
Makes sense to me. I wonder if the Could you try if the problem is also fixed without the |
yep works fine for this issue. Kept the 2* because i wasnt sure if there was some nuance with "windowing" of events. Let me remove it now though. |
43fb9a9
to
3e59650
Compare
@sokra this good to go? some checks seem stuck, but idk if i am able to requeue them |
We were experiencing double compiling on single file changes during watch mode. We worked around it with |
Glad the patch is working for you. I'm ready to merge this and update deps in webpack whenever! |
Thanks |
Could u provide a patch version for this change? @sokra thank u~ |
Can we have this published? 🙏🏻 |
Should resolve webpack/webpack#15431
After noodling on the discussions there and looking at past similar work done (namely 164007c), I think this is the best way to resolve that issue while still doing best-effort to respect file systems with lower mtime accuracy.
Right now, the
if
check I am changing has an arbitrary 1s, while everywhere else is properly using the FS_ACCURACY, which will get updated to higher resolution if possible.I think this is the best we can do without adding an optional dep of
fsevents
(fwiw, for OSX, chokidar will either use fsevents, or fall back to polling)