Closed achou11 closed 1 year ago
Template repo: https://github.com/digidem/nodejs-mobile-prebuilds-template
sodium-native: https://github.com/digidem/sodium-native-nodejs-mobile
crc-native: https://github.com/digidem/crc-native-nodejs-mobile
fs-native-extensions: https://github.com/digidem/fs-native-extensions-nodejs-mobile
quickbit-native: https://github.com/digidem/quickbit-native-nodejs-mobile
simdle-native: https://github.com/digidem/simdle-native-nodejs-mobile
udx-native: https://github.com/digidem/udx-native-nodejs-mobile
better-sqlite3: https://github.com/digidem/better-sqlite3-nodejs-mobile
In order to actually use Mapeo Core we need to get native modules to work with NodeJS Mobile React Native. The general plan is to create and host prebuilds of the relevant native modules outside the project, and then have a build script in this repo that pulls the prebuild and places it in the directory required by the NodeJS Mobile build process.
Rough steps are:
Doing a quick check using
npx native-modules
on the mapeo core repo lists these:The main ones are better-sqlite3 and (maybe) sodium-native (although using sodium-universal may allow us to tackle it later on). Hypercore ecosystem introduced quite a few more but hopefully they're not too tricky to get built (since they're rather small projects). There may be other ones coming for peer deps such as Fastify that aren't listed.
[x] 2. Create a repo that has a CI action to create prebuilds for our desired architectures and then upload as a GitHub artifacts.
[x] 3. Create a (postinstall?) script for this repo that pulls the desired prebuild artifacts and moves them to the correct directories. These directories are specified by NodeJS Mobile's React Native Android build process.
[x] 4. [maybe] Updating the backend build script that bundles the backend code. we do this to improve startup time and while I'm not sure what changes will be needed, I'm anticipating that something will need to be done here.