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 chokidar to 3.3.0 #153

Merged
merged 8 commits into from
May 16, 2020
Merged

Conversation

coreyward
Copy link

Regardless of what happens in watchpack 2.0.0, this fix will sidestep node-gyp issues for at least several hundred macOS Catalina users. The tests still turn up green w/o changes, but perhaps the coverage is poor? Fixes #130.

@jsf-clabot
Copy link

jsf-clabot commented Mar 31, 2020

CLA assistant check
All committers have signed the CLA.

@alexander-akait
Copy link
Member

It is breaking change

@coreyward
Copy link
Author

@evilebottnawi Please provide a failing test. If you’re not willing to do the work to make this function I need to know where it fails.

christopherthielen added a commit to ui-router/core that referenced this pull request Apr 19, 2020
…s in a row.

without this yarn resolution, karma runner fails on mac with 'fsevents is not a constructor'
see: webpack/watchpack#153 webpack/watchpack#130
christopherthielen added a commit to ui-router/core that referenced this pull request Apr 19, 2020
…ks in a row.

 without this yarn resolution, karma runner fails on mac with 'fsevents is not a constructor'

 see:
 webpack/watchpack#153
 webpack/watchpack#130
mergify bot pushed a commit to ui-router/core that referenced this pull request Apr 19, 2020
…ks in a row.

 without this yarn resolution, karma runner fails on mac with 'fsevents is not a constructor'

 see:
 webpack/watchpack#153
 webpack/watchpack#130
@RDIL
Copy link

RDIL commented Apr 22, 2020

v3 requires at least node 8, maybe it is time to drop smaller versions?

@sokra
Copy link
Member

sokra commented Apr 25, 2020

The tests still turn up green w/o changes

Installation fails to start on node 6, which seem to be expected as node 6 support was dropped.

But the tests are also failing on node 8 on linux and windows (not on mac). This is unexpected.

@sokra
Copy link
Member

sokra commented Apr 26, 2020

The problem seem to be caused by bugs in readdirp. These bugs are already fixed in a newer version. I was able to fix it locally by enforcing readirp@3.4.0, but this is not in the current range of chokidar. We need a new chokidar version pushing readdirp to 3.4.0. @paulmillr

@sokra
Copy link
Member

sokra commented Apr 26, 2020

hmm this fixes only the problems on linux. Windows is still broken on node.js 8

@paulmillr
Copy link
Contributor

Pushing new chokidar is simple. What exactly is broken on node 8 @ windows? Hard to tell from tests.

@paulmillr
Copy link
Contributor

BTW I suggest to switch to GitHub actions. It supports all three platforms.

@paulmillr
Copy link
Contributor

paulmillr commented Apr 26, 2020

Doesn't seem like the close method was updated to use asynchronous chokidar.watcher.close - the only API change in chokidar 3. We've decided to adjust it because it's not possible to stop all IO syncronously.

See this pull request for reference: webpack/webpack-dev-server#2539

@sokra
Copy link
Member

sokra commented Apr 26, 2020

What exactly is broken on node 8 @ windows? Hard to tell from tests.

Not sure yet. Errors are weird.

On linux node 8 it also logs:

(node:5243) UnhandledPromiseRejectionWarning: TypeError: this._removeWatcher is not a function
    at DirEntry.remove (/home/travis/build/webpack/watchpack/node_modules/chokidar/index.js:161:14)
    at <anonymous>
(node:5243) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5243) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:5243) UnhandledPromiseRejectionWarning: TypeError: this._removeWatcher is not a function
    at DirEntry.remove (/home/travis/build/webpack/watchpack/node_modules/chokidar/index.js:161:14)
    at <anonymous>
(node:5243) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)

remove seem to be an async method but none of its callsites handle the returned promise. Seems remove should handle the case that the DirEntry can be disposed duing the async readdir operation.

@sokra
Copy link
Member

sokra commented Apr 26, 2020

Doesn't seem like the close method was updated to use asynchronous chokidar.watcher.close - the only API change in chokidar 3. We've decided to adjust it because it's not possible to stop all IO syncronously.

I added a catch handler there. The operation can continue in background, consumers of watchpack are not interested when the watcher is fully stopped. I assume it won't emit change events any longer once close has been called.

@sokra
Copy link
Member

sokra commented Apr 26, 2020

What exactly is broken on node 8 @ windows? Hard to tell from tests.

Not sure yet. Errors are weird.

I guess it's the readdirp thing. appveyor CI incorrectly runs npm install instead of yarn, which ignores the resolutions workaround I added.

@paulmillr
Copy link
Contributor

Pushing 3.4 in a bit.

@codecov
Copy link

codecov bot commented Apr 26, 2020

Codecov Report

Merging #153 into watchpack-1 will decrease coverage by 0.64%.
The diff coverage is 81.25%.

Impacted file tree graph

@@               Coverage Diff               @@
##           watchpack-1     #153      +/-   ##
===============================================
- Coverage        95.22%   94.57%   -0.65%     
===============================================
  Files                3        4       +1     
  Lines              356      369      +13     
  Branches            97       98       +1     
===============================================
+ Hits               339      349      +10     
- Misses              17       20       +3     
Impacted Files Coverage Δ
lib/DirectoryWatcher.js 94.62% <80.00%> (-0.38%) ⬇️
lib/chokidar.js 81.81% <81.81%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88e13a6...f53f6c7. Read the comment docs.

@paulmillr
Copy link
Contributor

Is there any point in keeping old chokidar around? webpack-dev-server switched to v3 completely. You'll just keep seeing v2-related warnings.

@sokra
Copy link
Member

sokra commented Apr 28, 2020

Is there any point in keeping old chokidar around?

Yep to not break semver. We must keep support for node.js 6 in this major version. As chokidar doesn't support node 6, we fallback to old chokidar for node 6.

These warnings seem to be a bit weird anyway. Why do you need to tell someone that it doesn't work for node 14 when they not using node 14 anyway? These warnings should only appear for node 14 users. Or even better would be if node 14 users get an error.

@paulmillr
Copy link
Contributor

Because it can work. Or it can break. It doesn't always break. We've been receiving bug reports over and over regarding old versions. The amount of bug reports keeps getting increased for those. We need to make users upgrade at some point.

@surfaceowl
Copy link

@sokra

...Why do you need to tell someone that it doesn't work for node 14 when they not using node 14 anyway? These warnings should only appear for node 14 users.

I prefer the warnings so I can see potential problems in advance, rather than upgrading node and then discovering a branch won't build.

Also - chokidar bumped up to @v3.4.0 a few weeks ago, looks to be version bump on internal library for typing

https://www.npmjs.com/package/chokidar

@sokra sokra merged commit 59a4990 into webpack:watchpack-1 May 16, 2020
@sokra
Copy link
Member

sokra commented May 16, 2020

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants