Comments (8)
Steps added to the first comment
from realm-js.
From what I can tell native modules on Android allow to use Java code, not C++ code. This probably means we will need to just define an API in Java that only includes native
methods that are then implemented in the JNI level. It's an extra level of indirection... is this what was in your mind?
from realm-js.
That's pretty much what I was thinking. The tricky part will be having our c++ objects communicate with react's c++ objects. If everything is just linked together in the ndk level then I could see this working out well.
from realm-js.
They did mention a native module written in C++ in the doc https://github.com/facebook/react-native/blob/b86a6e3b44a63e92cf3a7976d2fa26c4bf412df1/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModule.java
{@link NativeModule}s whose implementation is written in C++
- must not provide any Java code (so they can be reused on other platforms), and instead should
- register themselves using {@link CxxModuleWrapper}.
I can't find this class they're mentioning in the Javadoc CxxModuleWrapper
maybe we can use this wrapper to get hold of the context.
from realm-js.
@nhachicha that sounds promising. But I also can't find anything remotely similar to that in the code base. Perhaps the comment is stale? Would it be possible to have a Java module that calls into our own c++ code throught jni? If so how do we set this up? I'm not even sure where to begin.
from realm-js.
@alazier I'll give it a try once I finish this PR realm/realm-java#1809
from realm-js.
@alazier I created a sample project https://github.com/nhachicha/ReactNativeWithJni to showcase how we can create a native react module that uses JNI.
with this approach we can just expose the current Java binding as a JS module (since we're already traversing Java to call C/C++). What could be interesting in terms of performance is to manage to grab the JSContextRef
, I know you're using some kind of reflection in Objective-C to access this property since it's private. Does it make sense to send a PR or to ask FB to expose it via a method so third party libraries can inject their API?
from realm-js.
Making progress here. All that is left now is chrome debugging and cleanup/proper support from react-native.
from realm-js.
Related Issues (20)
- Store and retrieve flat dictionaries in Mixed
- Store and retrieve nested lists in Mixed
- Store and retrieve nested dictionaries in Mixed
- Data Sync incomplete on collections that app does not insert HOT 2
- posix_fallocate() failed: Operation not supported on transport endpoint HOT 2
- Trying to reset an embedded object to an invalid one updates the original with default values if ex. is caught
- Process keep hanging after electron app is closed (Windows) HOT 26
- Validate before creating
- Android: Setting recoil state yields "ownKeys target is non-extensible but trap result keys differ from target keys" on v12 HOT 9
- [React native] Decryption failed on real ios device HOT 2
- React Native - Android Build fails when realm is installed HOT 1
- Expo: Android builds failed when @realm/react installed HOT 1
- Realm Context not found in child component HOT 2
- Support DISTINCT queries on dictionary HOT 4
- Integrate Realm Core's `next-major` branch
- I get the following error when trying to access data in Atlas: _realm.useQuery is not a function HOT 1
- Custom hook re-render multiple components (All App tree) HOT 1
- Remove dependencies on `node-fetch` and use Node's internal `fetch` + `AbortSignal` instead
- Un-skip SSL tests on CI
- Inserting byte array data(buffer) is consuming more time compared to inserting the base64-encoded string equivalent(React native application)) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realm-js.