nodejs-mobile / nodejs-mobile-react-native

Node.js for Mobile Apps React Native plugin
https://nodejs-mobile.github.io
MIT License
177 stars 43 forks source link

Can I use the hypercore/hyperswarm/hyperbee libraries with this? #60

Closed saimon-moore closed 11 months ago

saimon-moore commented 11 months ago

i.e. Will I have issues building these libraries (since they depend on other native libraries)?

gmaclennan commented 11 months ago

Hi @saimon-moore yes you can, although you need to deal with building the native dependencies. We prebuild the native modules in our app CoMapeo to avoid difficulties for individual contributors trying to build locally. We are creating prebuilds for the hyper- deps (no guarantees that these will be reliably maintained, because they are mainly for our own internal use):

The template we use for creating prebuilds is here: https://github.com/digidem/nodejs-mobile-prebuilds-template

Our build process for loading these prebuilt native modules is here: https://github.com/digidem/CoMapeo-mobile/blob/7e517449306f0a65c2f50f6f5695a4fd474a496d/scripts/build-backend.mjs

It's possible to build the hyper deps as part of the nodejs-mobile build process, without creating prebuilds, but it might need a bit more work setting up the right build environment.