Update fsevents dependency to use napi #774
Closed
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.
This updated the fsevents dependency to use the napi tagged version (currently 2.0.2-pre-1)
There are a few API changes, and support for node-versions below v8 has been dropped, whence the major version bump. (v8.x support is not there currently but will become available through nodejs/node#25002)
The big advantage of this is that fsevents is now using N-API which means a single build works with all versions of node. No more node-pre-gyp downloading specific versions and upgrading with every new node release.
In addition fsevents now uses a single runloop/thread to listen for events which makes it significantly cheaper; and it reduces the API to just handle the native stuff, which is all chokidar uses which leads to eliminating a
stat
call per event, again making it a lot cheaper.I have also tested the regular binary against the upcoming version of electron (v4.0.0-beta7) and it works out of the box. So this should also eliminate some of the pain associated with that.