<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Guilherme Bergue on Medium]]></title>
        <description><![CDATA[Stories by Guilherme Bergue on Medium]]></description>
        <link>https://medium.com/@bergueeg?source=rss-33de878851f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FmHhDXZqpds4FTwL0uCbXg.jpeg</url>
            <title>Stories by Guilherme Bergue on Medium</title>
            <link>https://medium.com/@bergueeg?source=rss-33de878851f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 00:29:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bergueeg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Reduced My React Native App Bundle Size by 70% ]]></title>
            <link>https://medium.com/@bergueeg/how-i-reduced-my-react-native-app-bundle-size-by-70-7505e67d0373?source=rss-33de878851f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7505e67d0373</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Guilherme Bergue]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 01:48:22 GMT</pubDate>
            <atom:updated>2025-03-20T01:48:22.031Z</atom:updated>
            <content:encoded><![CDATA[<h4>Optimizing Performance and Reducing App Size</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmdoeirXqpmhvvqYHlaDcA.png" /><figcaption>Created by ChatGPT</figcaption></figure><p>When migrating my app from React Native CLI to Expo, I configured expo-updates and performed an update via EAS. I noticed that the update file size was quite large, so I started investigating. Initially, I couldn&#39;t run react-native-bundle-visualizer, as I had to make some adjustments to Babel. Once I managed to get it working, here’s what I found.</p><h3>1. Analyzing the Bundle</h3><p>The first step was to understand what was making the bundle so large. To do this, I used react-native-bundle-visualizer, which allows visualizing the modules and dependencies that make up the bundle:</p><pre>npx react-native-bundle-visualizer</pre><p>This helped me identify unnecessary packages and heavy dependencies, here is the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*ol7ZBW_e7clLfZxvj7pPRA.png" /><figcaption>react-native-bundle-visualizer result</figcaption></figure><p>One of the biggest surprises was that Font Awesome was taking up a significant amount of space<strong>(6.39 MB)</strong>. Upon further investigation, I realized that due to the way imports were structured, all icons were being included in the bundle, even though I was only using a small subset.</p><h3>2. Fixing the Font Awesome imports</h3><p>Instead of using this:</p><pre>import { faHome } from &#39;@fortawesome/free-solid-svg-icons&#39;;</pre><p>I change to this:</p><pre>import { faHome } from &#39;@fortawesome/free-solid-svg-icons/faHome&#39;;</pre><p>This ensures that only that specific icon will be added to the bundle, allowing tree-shaking to remove unused icons.</p><h3>3. ReAnalyzing the Bundle</h3><p>After making these import changes, I ran react-native-bundle-visualizer again, and the results were impressive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*aMueQPIOq8E8mnh1BS8D8g.png" /><figcaption>react-native-bundle-visualizer result</figcaption></figure><blockquote>The bundle size, which initially contained <strong>9.43 MB</strong> of node_modules dependencies, was reduced to <strong>3.12 MB</strong>, achieving a ~<strong>67% reduction</strong>.</blockquote><h3>4. Where Else Could I Reduce More?</h3><p>As I continued analyzing, I noticed a package called text-encoding. I had no idea what it was or why it was included in the project. After digging deeper, I discovered that this package had been <strong>deprecated for over six years</strong>.</p><p>I then checked which package was still using it and found that react-native-qrcode-svg@6.3.2 depended on text-encoding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*omr3Itkj5MyyDR-rR2ySuQ.png" /><figcaption>react-native-qrcode-svg code</figcaption></figure><p>To resolve this, I looked into the library’s GitHub repository and found that in newer versions, this dependency had been removed. So, I updated react-native-qrcode-svg to the latest version in my project.</p><h3>5. Final results</h3><p>After implementing these changes, I ran react-native-bundle-visualizer again, and the final results were:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*Whi9UGpZnSkLfFjy-5MsEw.png" /><figcaption>final results</figcaption></figure><p>I achieved a total <strong>reduction of ~70%</strong> in my React Native app’s bundle size.</p><h3>Conclusion</h3><p>After applying these optimizations, my app’s bundle size was <strong>reduced by 70%</strong>, resulting in a lighter and more efficient application. This improvement not only positively impacted the user experience but also reduced download time and storage usage on the device.</p><p>If you are also facing issues with bundle size, I recommend checking your imports and dependencies to identify unnecessary bloat!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7505e67d0373" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>