Cordova / PhoneGap / Ionic Support
I just rebased and pushed my older WIP branch, sk-cordova, which pretty much completes this task. :smile:
I mean for iOS. For Android, this is pretty much blocked on #262 being done.
👍 for Ionic support. Hopefully Ionic2!
This would be awesome and well received in the Ionic community for sure. Curious why this wouldn't Just Work given the recent realm-js release?
@mlynch I would assume because for phonegap, an interface between the js library to the native hardware of the device would need to be developed to actually bring the benefit of realms speed. But then again, I have no idea.
The main issue with supporting phonegap/cordova at the moment is the need to support android. React Native runs on JavascriptCore on both iOS and android which is how we support both platforms. This is not the case for cordova/phonegap.
+1
It's a good option to create a cordova-plugin to use realm-java and realm-cocoa?
As in https://github.com/mapsplugin/cordova-plugin-googlemaps
The main issue with supporting phonegap/cordova at the moment is the need to support android
@alazier can you expand on that?
@PierBover - the way the Realm binding works is that we hook directly into the JS context for whatever environment we are supporting. React-native uses the same version of JavascriptCore on both ios and android which makes integration pretty straightforward. Cordovoa uses whatever the builtin JS interpreter is on the device it is running on, which makes things much more difficult. It might be possible to make things work by rolling a custom version of Cordova but this isn't something we have looked into. If you just want to support Cordova/iOS then it should be possible to get things working using the current codebase by getting the JSContext from a webview and passing it into the Realm initialization methods, but this is not something that we can currently support or maintain.
Ok I see the problem.
Probably the best way to go for Cordova/Phonegap is making a native plugin (since you already have native iOS and Android libraries) with a JS wrapper API that mimics the one used in your React Native implementation.
My team really wants Realm for Cordova/Ionic. Any updates on if/when Cordova support would rollout?
+1
I believe a plugin approach such as the one described by @PierBover would be the easiest way to do it.
+1
+1 ionic2 support is really wanted in the community. This will open doors for PWA as well.
+1
+1
+1 IONIC2 support is wanted
+1
+1
+1
+1
Any news on this?
+1
As far as I know, this is not something that we are actively working on right now.
+1
Damn, it's a shame that this isn't something that's actively being worked on - i think it's a big market potentially.
In the meantime, if you're not working on this, can someone close it and update it with some official news?
In the meantime guys - the best alternative is PouchDB with the sqlite adapter.
@danmatthews yeah it's a shame. I develop ionic and react native apps. For react native you can use pouchdb-adapter-react-native-sqlite and pouchdb-react-native :-) and realmjs supports react native.
@danmatthews by the way the first link in your comment is broken
Yeah, sorry, the official news is that @istx25 is right. This is not something we are working on at the moment. I realize that it's a popular request and definitely something we will look into but at the moment, the JS team has plenty of work with the currently supported platforms. I'll keep the issue open as it's neither done nor rejected, just idle :-)