realm-js icon indicating copy to clipboard operation
realm-js copied to clipboard

Cordova / PhoneGap / Ionic Support

Open timanglade opened this issue 10 years ago • 61 comments

timanglade avatar Feb 19 '16 01:02 timanglade

I just rebased and pushed my older WIP branch, sk-cordova, which pretty much completes this task. :smile:

appden avatar Feb 25 '16 01:02 appden

I mean for iOS. For Android, this is pretty much blocked on #262 being done.

appden avatar Feb 25 '16 01:02 appden

👍 for Ionic support. Hopefully Ionic2!

keithdmoore avatar May 07 '16 03:05 keithdmoore

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 avatar Jun 02 '16 21:06 mlynch

@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.

philliphartin avatar Jun 02 '16 22:06 philliphartin

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.

alazier avatar Jun 03 '16 05:06 alazier

+1

caiobalthazar avatar Jul 23 '16 23:07 caiobalthazar

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

douglasjunior avatar Jul 26 '16 14:07 douglasjunior

The main issue with supporting phonegap/cordova at the moment is the need to support android

@alazier can you expand on that?

PierBover avatar Sep 06 '16 20:09 PierBover

@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.

alazier avatar Sep 06 '16 20:09 alazier

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.

PierBover avatar Sep 06 '16 20:09 PierBover

My team really wants Realm for Cordova/Ionic. Any updates on if/when Cordova support would rollout?

virtualprodigy avatar Oct 17 '16 21:10 virtualprodigy

+1

ghost avatar Nov 10 '16 17:11 ghost

I believe a plugin approach such as the one described by @PierBover would be the easiest way to do it.

caiobalthazar avatar Nov 10 '16 19:11 caiobalthazar

+1

kitfactory avatar Nov 19 '16 02:11 kitfactory

+1 ionic2 support is really wanted in the community. This will open doors for PWA as well.

faraazc avatar Nov 24 '16 05:11 faraazc

+1

AresDev avatar Dec 05 '16 20:12 AresDev

+1

gozur avatar Dec 19 '16 06:12 gozur

+1 IONIC2 support is wanted

ghost avatar Dec 20 '16 17:12 ghost

+1

krasnokojiy avatar Dec 21 '16 16:12 krasnokojiy

+1

konrin avatar Dec 25 '16 19:12 konrin

+1

IvanAR avatar Jan 02 '17 14:01 IvanAR

+1

llearn avatar Jan 04 '17 04:01 llearn

Any news on this?

gkTim avatar Jan 26 '17 07:01 gkTim

+1

jruef avatar Feb 06 '17 15:02 jruef

As far as I know, this is not something that we are actively working on right now.

istx25 avatar Feb 06 '17 15:02 istx25

+1

zuhrulumam avatar Feb 15 '17 15:02 zuhrulumam

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 avatar Feb 15 '17 15:02 danmatthews

@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

jruef avatar Feb 16 '17 06:02 jruef

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 :-)

kristiandupont avatar Feb 16 '17 09:02 kristiandupont