You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please elaborate more on your question, provide an example or add some other context. Ferric is meant to produce prebuilds for Android and iOS out of the box.
What do you mean by, "in case something is needed from it?"
I suspect this is mostly a case of missing examples and documentation. In its current form, loading the prebuild requires three things:
The prebuild conforms with the format specified in docs/PREBUILDS.md.
The app needs to configure Babel to use the Babel plugin (this requirement might be lifted when authoring libraries and not using existing packages with Node-API addons intended for Node.js):
The app needs to require the addon (the test app does this here which in turn defers to the main field of the ferric-example package here which does a require of the addon prebuild from the generated ferric_example.js.
Sorry 😔 I'm still not getting this. I'm genuinely curious, but I can't wrap my head around it.
Do you want to call into platform-specific native APIs (such as the Android SDK) from your Rust library code? Or do you want to load or call into your Node-API addon from native code (Java, Kotlin, Objective-C or Swift) - if yes for what purpose?
Can you speak a bit about the use-case? What are you trying to achieve here?
None at the moment, but I had some thoughts on building a library which could make use of this. But still not sure I will go forward with it. Some APIs from android or ios, might not be available on rust, so, some impl could end up needing a mix up.
Activity
shirakaba commentedon Jul 28, 2025
I wrote a walkthrough, Build and Run Node-API Modules in React Native, which shows how to create a Node-API module to run on Node.js, Android, and iOS.
I am not familiar with the Ferric side of things, but hopefully that fills in some of the gaps.
dougg0k commentedon Jul 28, 2025
I didnt check, though It might be possible by importing the .so file in android and the respective on ios.
I suppose having it added in the init or readme, would bring some clarity.
kraenhansen commentedon Jul 29, 2025
I don't fully understand your request.
Are you asking for ways to load the prebuilds outside of the context of React Native?
dougg0k commentedon Jul 29, 2025
No, in the context. But also in the native side.
kraenhansen commentedon Jul 29, 2025
Please elaborate more on your question, provide an example or add some other context. Ferric is meant to produce prebuilds for Android and iOS out of the box.
What do you mean by, "in case something is needed from it?"
dougg0k commentedon Jul 29, 2025
That was badly written. Fixed.
kraenhansen commentedon Jul 29, 2025
I suspect this is mostly a case of missing examples and documentation. In its current form, loading the prebuild requires three things:
react-native-node-api/apps/test-app/babel.config.js
Line 4 in 9b231c1
ferric-examplepackage here which does a require of the addon prebuild from the generatedferric_example.js.dougg0k commentedon Jul 29, 2025
That seem to be steps for JS though, not actually use the rust native API in the android/ios side.
this is somewhat what I previously meant, in case, it was needed.
kraenhansen commentedon Jul 30, 2025
Sorry 😔 I'm still not getting this. I'm genuinely curious, but I can't wrap my head around it.
Do you want to call into platform-specific native APIs (such as the Android SDK) from your Rust library code? Or do you want to load or call into your Node-API addon from native code (Java, Kotlin, Objective-C or Swift) - if yes for what purpose?
Can you speak a bit about the use-case? What are you trying to achieve here?
dougg0k commentedon Jul 30, 2025
None at the moment, but I had some thoughts on building a library which could make use of this. But still not sure I will go forward with it. Some APIs from android or ios, might not be available on rust, so, some impl could end up needing a mix up.
dougg0k commentedon Jul 30, 2025
I checked some information.
If the output supported multiple ABIs targets.
For android, in the most succinct way, would be something like.
In
build.gradleatandroid/app, addFor ios, not entirely sure yet, but likely to be with the
.podspecorPodfile.I suppose there is no real way to automate without specifying the settings.
kraenhansen commentedon Jul 30, 2025
Can't really comment meaningfully before I understand what you're trying to achieve.
But it does seem like you are painting the picture of what our host package is already doing while auto-linking.