dorbel-tech / dorbel-app

Main dorbel node.js app
https://app.dorbel.com
0 stars 1 forks source link

React native research #1654

Open virtser opened 6 years ago

virtser commented 6 years ago

Following research native wrapper solution #1630

Please research (and POC if possible) our options to React native mobile app.

  1. All components stay as is, web components.
  2. Some components (please write which) requires their native alternatives to improve performance.

Keep in mind that our goal is to make a mobile app with auth0 native login (preferably) and push notifications interface (for chat notifications).

avnersorek commented 6 years ago

Some background -

To make a quick move to native, using React-Native, We will need to

  1. Create a new React-Native App
  2. Put our app in a React-Native Web-View, using react-native-webview-bridge in order to interact with native APIs
  3. Build and hope everything works :crossed_fingers:

Pros - From there we could probably migrate the app bit by bit to full React-Native but it's not clear how. Cons - We will depend on react-native-webview-bridge but the project's status is unclear. It's also unclear as to how the app will function inside the webview - but that goes for every other mobile wrapper as each one uses the original WebView a little differently. BUT unlike phone-gap which has a lot of track record "swallowing" full web apps, RN isn't really built for it and it's not a common use-case.

References - https://stackoverflow.com/questions/39800938/porting-a-full-blown-react-web-app-to-react-native https://github.com/alinz/react-native-webview-bridge

Nice to point out - The future is react-native-web, which means you start out building a react-native app, but then you can also compile it to web. Not really relevant for us at the moment (requires change of all render functions) but it's a good idea and it results in a maximum amount of code reuse - even a huge part of the view layer is reused.

avnersorek commented 6 years ago

Migrating Incrementally from a React App to React Native: Part 1 of 2 https://medium.com/rendez-voo/migrating-incrementally-from-a-react-app-to-react-native-part-1-of-2-4566626e4ac5

avnersorek commented 6 years ago

started working on a POC - generated a react-native app using react-native-cli and got app running on my phone. WebViewBridge still not working.

Regular WebView IS working (and running app.dorbel.com/search pretty nicely), so we might consider using that. JS2Native messaging is possible, but Native2JS messaging will need to be done using querystring params (or headers) using the WebView source prop.

So all in all this looks like it might happen but still need to continue with POC

avnersorek commented 6 years ago

@virtser I just want to stress that by no means this can be a "quick-win" The native app will have a whole set of different dependencies like build, E2E testing, running on different devices, etc... Even if getting the basic flows running can be done in a couple of weeks, all those things will require a lot of attention moving forward.

Not that I'm saying we shouldn't do that - but it's worth prioritizing accordingly because I think the only benefit here will be the IOS mobile push.

virtser commented 6 years ago

Yes, thats understood as I mentioned in #1647 What do yo mean just iOS push? No Android push?

On Sun, Oct 1, 2017 at 6:41 PM Avner Sorek notifications@github.com wrote:

@virtser https://github.com/virtser I just want to stress that by no means this can be a "quick-win" The native app will have a whole set of different dependencies like build, E2E testing, running on different devices, etc... Even if getting the basic flows running can be done in a couple of weeks, all those things will require a lot of attention moving forward.

Not that I'm saying we shouldn't do that - but it's worth prioritizing accordingly because I think the only benefit here will be the IOS mobile push.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/dorbel-tech/dorbel-app/issues/1654#issuecomment-333385196, or mute the thread https://github.com/notifications/unsubscribe-auth/AAcmbsc2f2oLJwBf6kRTr86nelTYoLqyks5sn7KPgaJpZM4Ppz1x .

--

David VirtserVP R&D @ dorbel M: +972-544-472-571

Linkedin https://il.linkedin.com/in/virtser | www.dorbel.com

avnersorek commented 6 years ago

I meant Android push can be done using a PWA/service worker (web push) so the marginal gain here is mostly IOS push.

On Oct 1, 2017 7:29 PM, "David Virtser" notifications@github.com wrote:

Yes, thats understood as I mentioned in #1647 What do yo mean just iOS push? No Android push?

On Sun, Oct 1, 2017 at 6:41 PM Avner Sorek notifications@github.com wrote:

@virtser https://github.com/virtser I just want to stress that by no means this can be a "quick-win" The native app will have a whole set of different dependencies like build, E2E testing, running on different devices, etc... Even if getting the basic flows running can be done in a couple of weeks, all those things will require a lot of attention moving forward.

Not that I'm saying we shouldn't do that - but it's worth prioritizing accordingly because I think the only benefit here will be the IOS mobile push.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/dorbel-tech/dorbel-app/issues/1654# issuecomment-333385196, or mute the thread https://github.com/notifications/unsubscribe-auth/ AAcmbsc2f2oLJwBf6kRTr86nelTYoLqyks5sn7KPgaJpZM4Ppz1x .

--

David VirtserVP R&D @ dorbel M: +972-544-472-571

Linkedin https://il.linkedin.com/in/virtser | www.dorbel.com

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/dorbel-tech/dorbel-app/issues/1654#issuecomment-333388366, or mute the thread https://github.com/notifications/unsubscribe-auth/ACHtjp-L_DT6VQ-3iFpzIT1tlhfXh_AUks5sn732gaJpZM4Ppz1x .

avnersorek commented 6 years ago

expo.io is the best way to build/test/deploy/publish with RN but I'm not sure we can use it - https://docs.expo.io/versions/latest/introduction/why-not-expo.html

virtser commented 6 years ago

Please sum up your research, create a repo and open a PR so we can review.