Microsoft Sparsha Saha

How Microsoft Keeps Android app size in check with React Native Upgrades

Original post Keeping Android app size in check with React Native Upgrades | by Sparsha Saha | Microsoft Mobile Engineering | Medium

Article Summary

Microsoft Teams faced a 1.2 MB app size bloat after upgrading React Native. Here's how they cut it down to just 0.48 MB.

The Microsoft Teams mobile engineering team shares their systematic approach to controlling Android app size during a React Native upgrade from 0.64.2 to 0.68.3. Larger app sizes directly impact downloads and user engagement, making this work critical.

Key Takeaways

Critical Insight

Through methodical analysis of shared libraries and removing unused new architecture components, Teams reduced their React Native upgrade bloat by 60%.

Continue reading

What This Article Covers

Problem

Microsoft Teams found that two shared libraries, reactnativejni and reactnativeutilsjni, were built from the same source code. This created unnecessary duplication in the Android app binary.

Solution

Sparsha Saha's team submitted a PR to the React Native repository that removed reactnativeutilsjni entirely and moved all its references into reactnativejni. This standardized the approach across the codebase.

Impact

The change reduced app size by 220 KB for all React Native 0.68.3+ apps. It shows how removing redundant components can lead to meaningful optimization gains across the ecosystem.

The team knows this size win is temporary: when they enable the new architecture, those bytes are coming back.

This page summarizes “Keeping Android app size in check with React Native Upgrades | by Sparsha Saha | Microsoft Mobile Engineering | Medium” by Microsoft, published Dec 8, 2020. All credit for the original work goes to the authors.

Read the original on medium.com (opens in new tab)

AI tools for React Native

Browse all AI tools →