filer
filer copied to clipboard
Evaluate our use of lib/intercom.js, lib/eventemitter.js
The intercom.js project has been dead for a while. We've got a small version of it in lib/intercom.js
, which we use to create filesystem watches across windows.
I suspect there are more modern ways to do this, which we can either build or use via a dep. Let's see if we can update this.
I worked on this a bit tonight, trying to remove https://github.com/filerjs/filer/blob/master/lib/eventemitter.js and instead use a bundled/node.js EventEmitter via Parcel. I got stuck because it requires surgery to intercom.js. Probably doing both as part of the same bug makes sense.
https://github.com/pubkey/broadcast-channel might be a better solution here.
BroadcastChannel
s are available in Chrome and Firefox, but not in Edge or Safari (yet), see https://caniuse.com/#feat=broadcastchannel.
We'd have to polyfill for a while to make this work. I think that's probably OK, since the polyfill does exactly what intercom is doing now: use localStorage
events.