Live data from Hacker News

Ask HN: How are you building cross-platform (mobile and browser) apps?

news.ycombinator.com

31–40 of 84 posts

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#32
It's the third time I have to build the whole stack (web+ios+android).

For the first time, I used a webapp and was hoping that the ios/android experience would be good enough. Unfortunately, It wasn't and it was a big mistake. I'd only recommend this for quick mvp knowing that it'll need to be rewritten or if your audience really understand what it means to have a mobile webapp compared to a native app. I.e. if there's an IT department in place that can install it on the devices and understand the limitations.

For the second time, we went with ionic/phonegap. It was a huge improvement, but we hit too many limitations and scenarios where we wanted native tweaking for animations or handling the keyboard hiding fields or the topbar acting weird, etc. You don't see those issues at first.. but they start appearing as you start doing QA on more devices and with real users. And at that point, you've invested so much in trying to make it work that you can't just go back, so you start piling weird hacks on top of weird hacks.

For the third time, we went with react-native. Overall it was a great experience and unlike ionic, it's a real native app, not just a webview. We could reuse a big part of the code between web, ios and android. The issues we faced were often related to weird edge cases that are buggy within react-native itself such as input fields not working correctly when dictating or a "pull-to-refresh" supposed to be stateless but in practice being stateful and buggy if you call "refresh" on it twice within 30ms. However, it's a good feeling to know that when we'll have the time, we have the flexibility to either fix the library itself or re-write it (compared to ionic where we couldn't do much and web apps where the solution to most our problems would be to "wait a few years until the browsers decide to improve it".)

If I had to do it another time (a fourth time), I'd go with react-native again but I would make sure to stress test the libraries with real data on all the devices we'd want to support. Also, it's popular in the javascript ecosystem to have libraries that depend of another library that depends of another library that wraps another library.. in most cases, it's just better to write a quick wrapper for your app and only include the inner-most library that does most of the work anyway. Otherwise you're depending on too many authors and libraries quickly go out-of-sync and you're stuck with old versions that aren't compatible with new ones.

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#33

I use React + React Native for https://www.jqbx.fm . As a 1 man project it seemed like the only sensible way to build mobile (android/iOS) and browser versions. I can share almost all of the code (where applicable) so one can move a lot faster and have a lot less mental overhead. That being said React Native has stability and performance issues that are tricky and can hold up your app for a non-trivial amount of time…

Do you share components too? How are you doing styling? I'm using a mix of js variables for different platforms and scss files but I'm finding it kinda complicated. I would like to use styled-components somehow.

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#34

I use React + React Native for https://www.jqbx.fm . As a 1 man project it seemed like the only sensible way to build mobile (android/iOS) and browser versions. I can share almost all of the code (where applicable) so one can move a lot faster and have a lot less mental overhead. That being said React Native has stability and performance issues that are tricky and can hold up your app for a non-trivial amount of time…

Do you share components too? How are you doing styling? I'm using a mix of js variables for different platforms and scss files but I'm finding it kinda complicated. I would like to use styled-components somehow.

For JQBX the styling is done differently between mobile and web. I stared off using scss for web (old habits die hard) and then had to use JS styling for react-native. Not the biggest deal though since the UI is where the two apps diverge the most. Very few things use the exact same UI patterns between web and native. But if I were to do it again (and had a design laid out in advance) I would probably opt for JS-styled components across both versions- though the "CSS" syntax is a little different so you would need some way to port that. I think it still makes a bit of sense to keep styling separate between web and mobile though since you're dealing w/ a different interface... but like everything it depends on what you're building.

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#37

I use React + React Native for https://www.jqbx.fm . As a 1 man project it seemed like the only sensible way to build mobile (android/iOS) and browser versions. I can share almost all of the code (where applicable) so one can move a lot faster and have a lot less mental overhead. That being said React Native has stability and performance issues that are tricky and can hold up your app for a non-trivial amount of time…

Cool app! I got a little confused as to how to add songs once you're a DJ, but the whole things looks cool, and you seem to have a nice community already!

Re: Ask HN: How are you building cross-platform (mobile and browser) apps?

#39
We're running all our apps based on Ionic which works absolutely brilliant & allows for the deployment as PWA today or at any point in the future. That being said we primarily build b2b applications. Minor drawbacks to native in terms of UX performance exist, but tbh, if you know how to optimize rendering performance in a browser you'll get 99% of native performance by putting in the effort.

For us the ability to run on literally any(!) device (this includes for example also smart TVs) completely outweighs the potential (minor) performance drawbacks.

Post reply on HN