hsjoberg / react-native-turbo-lnd

Pure C++ TurboModule for lnd! ⚡️
MIT License
2 stars 0 forks source link

Electron and NodeJS C++ addon support #2

Open hsjoberg opened 1 week ago

hsjoberg commented 1 week ago

This actually works. https://github.com/hsjoberg/node-addon-lnd You can create a NodeJS C++ addon that also talks to the CGO falafel bindings. This can then be used to create a react-native app for Linux using Electron and react-native-web.

The NodeJS C++ addon needs to expose the same core API as the C++ TurboModule.

When using Electron Forge, it will automatically compile the NodeJS C++ addon for Electron env by just reading the lib's binding.gyp file.

hsjoberg commented 1 week ago

One unanswered question is if we should have a helper to expose all gRPC methods to the electron bridge. Otherwise the user has to set this up themselves.