atom / node-pathwatcher

Path Watcher Node Module
http://atom.github.io/node-pathwatcher
MIT License
93 stars 47 forks source link

Enable v8 snapshot for this module #119

Closed as-cii closed 7 years ago

as-cii commented 7 years ago

This pull request changes path watcher so that it can be required while generating the snapshot. To do so we have:

  1. Changed HandleWatcher and PathWatcher to stop using Node's EventEmitter and replace it with event-kit.
  2. Moved the binding.setCallback call inside the watch function, so that we execute it just once the first time watch is called.
as-cii commented 7 years ago

After merging this I believe we should bump the major version in case someone is using PathWatcher as an event emitter. In Atom we re-export only File and Directory and, since their interface hasn't changed as part of this pull request, I feel like we can be pretty confident that upgrading this module won't break any third party packages.

/cc: @nathansobo

nathansobo commented 7 years ago

👍