Discord
Tags

When I interviewed for the iOS developer opening at Discord last spring, the tech lead Stanislav told me:

React Native is the future. We will use it to build our iOS app from scratch as soon as it becomes public.

As a native iOS developer, I strongly doubted using web technologies to build mobile apps because of my previous experiences with tools like PhoneGap. But after learning and using React Native for a while, I am glad we made that decision.

Efficiency

Although our iOS “team” is usually just me, the iOS app is still able to catch up with the lightning speed of our web and desktop development. Apple has recently allowed you to update the app over the air using JavaScriptCore without going through the App Store review process again. It is very helpful for a small startup without a fully dedicated iOS QA team doing thorough tests, since the iOS team is able to apply some hot fixes after shipping new features.

After using React Native for over a year, our iOS development cycle has significantly accelerated because of its great effectiveness. For example:

  • v 1.0 was built within two weeks upon the existing front-end infrastructure.
  • Flexbox’s style code is about half as long and far easier to understand than the code of Auto Layout.
  • iOS app and web app share 98% of the code of store and action in the Flux design pattern.

Performance

React Native runs Javascript on a background thread and sends a minimal amount of code to main thread. It turns out there is little performance difference between this and native iOS apps which are written in Objective-C or Swift!

However, when we started building the iOS app, the performance of the chat’s scroll view wasn’t satisfactory, especially for some active chat groups. We decided to use ComponentKit for chat and write the necessary bridges instead. The Animated library also cannot deliver the animations as smooth as the native while doing heavy duty works on the JS thread, so we keep using PopAnimation for our drawers.

We tried to run the app on Android too when React Native for Android came out, but unfortunately encountered some performance issues and decided to hold off. According to our lead Android dev Miguel:

Unfortunately Android devices have much greater variance in performance and tend to trail significantly behind iOS. We were able to get our app running fairly quickly, but the performance — specifically on touch events was not at an acceptable level even on higher end devices. In addition at that early stage there was still a lot missing in the React Native Android feature-set that would have made getting our prototype to production level more time consuming than our iOS effort.

Usability

The React Native project keeps making the development work easier and allowing the developers to focus on the core app features in every new release. I just can’t calculate how many hours it saves via the handy tools from its in-app developer menu.

One of my favorite features is Show Inspector. It immediately displays the interactive view hierarchies and all the necessary style info of the selected component and simply beats any other iOS inspector tools I’ve ever used.

Community

The React Native project pushes a new release biweekly with tens of new features and bug fixes. It is a double edge sword. Compared to the stable release of iOS every few months, the evolving code base costs extra time to upgrade especially for the app in production. So that’s why we only did four major upgrades of our forked React Native repo so far.

Since React Native is fairly new, the resources are limited and incomplete but will catch up with the other mature technologies in the near future given its increasing popularity. Below are some useful channels besides its repo that I use to ask question and get latest info:

Overall, React Native looks very promising and brings the mobile app development to a new level within our team. The transition from a native iOS developer like me is smoother than I originally thought. It also helps me to escape the pigeonhole at work as I am able to contribute to our web app which is written in React very easily.

Lastly, we’re always looking for talented engineers, designers, and other roles to join our team! Check out our Jobs page for openings (especially product designers plz come halp).

Contents
THE AUTHOR
MORE FROM