Happy0 / ssb-chess

A library for building scuttlebutt chess clients with
GNU General Public License v2.0
63 stars 16 forks source link

Remove dependency on patchcore (for browser compatibility) #88

Open Happy0 opened 3 years ago

Happy0 commented 3 years ago

If we want to get ssb-chess into the browser eventually, we should get rid of the patchcore dependency which I think is only used to wrap the call through to ssb-backlinks at the moment.

Patchcore brings in dependencies which assume a nodejs environment (such as ssb-client, secret-handshake, etc.)

A good way to do this might be to 'abstract' the things we expect / need from the ssb-client sbot object that is passed as a parameter to this module into functions that can be implemented in different ways depending on what environment it is in rather than requiring ssb-client itself.

E.g. expect an object that has the following functions:

backlinks,
messagesByType,
publish,
get,
// Social graph functions to find friends / followees
...