Instagram Martin Bigio Feb 6, 2017

React Native at Instagram

Article Summary

Instagram stayed single-dex on Android while integrating React Native. Martin Bigio and the Core Client team reveal how they pulled it off without bloating their app.

In early 2016, Instagram began exploring React Native to boost developer velocity across iOS and Android. The challenge? Integrating it into a massive existing native app without sacrificing performance, binary size, or Instagram's single-dex status on Android.

Key Takeaways

Critical Insight

Instagram shipped features faster with React Native while maintaining their strict performance standards and single-dex Android build.

The team's approach to porting the Edit Profile view revealed surprising insights about React Native's startup overhead compared to native code.

About This Article

Problem

Instagram's React Native startup was slow because JavaScript bundles had to be injected into JavaScriptCore and native modules needed to be instantiated. The team wanted to measure this against native implementations to understand the performance gap.

Solution

Instagram's Core Client team ported the Edit Profile view to React Native. They used React Native team infrastructure like Random Access Module Bundling, Inline Requires, and Native Parallel Fetching to speed up startup times.

Impact

The Save team built the iOS saved posts list in React Native. Post Promote achieved 99% code sharing between iOS and Android, with faster startup times and better user experience compared to WebView implementations.