<?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 Rafi zimraan arjuna wijaya on Medium]]></title>
        <description><![CDATA[Stories by Rafi zimraan arjuna wijaya on Medium]]></description>
        <link>https://medium.com/@rafizimraanarjunawijaya?source=rss-f5bd99ec0432------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yuL5f1C8bHwFEQPrIUIWIg.jpeg</url>
            <title>Stories by Rafi zimraan arjuna wijaya on Medium</title>
            <link>https://medium.com/@rafizimraanarjunawijaya?source=rss-f5bd99ec0432------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:03:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rafizimraanarjunawijaya/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[Why I Stopped Using So Many Hooks in React]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/why-i-stopped-using-so-many-hooks-in-react-5cfcb9e67fd0?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/5cfcb9e67fd0</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 02:11:30 GMT</pubDate>
            <atom:updated>2026-04-15T02:11:30.054Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DBBgSZ-dodvOBwpCrJKI-w.png" /></figure><h3>We were promised simplicity. We got “Logic Fog.” Here is why I’m returning to clean, predictable patterns and how you can too.</h3><h3>The Day I Lost Control of My Code</h3><p>It was 2 AM, and I was staring at a 15-line useEffect dependency array. Every time I changed a single variable, the component either entered an infinite loop or failed to update the UI entirely.</p><p>I had built a “Hook Monster.”</p><p>On paper, everything looked correct. I was using useMemo for performance, useCallback for functions, and custom hooks to &quot;clean up&quot; the code. But in reality, the component was a fragile house of cards. I realized that I wasn&#39;t writing UI logic anymore; I was spending 90% of my time fighting with React’s synchronization engine.</p><h3>The Problem: The “Hook Trap” and Logic Fog</h3><p>The React community often treats Hooks as a silver bullet. The logic goes: <em>“Is your component too big? Just throw it into a custom hook!”</em></p><p>But here is the hard truth: <strong>Moving messy logic from a component into a custom hook is just moving the mess to a different folder.</strong></p><p>When we overuse hooks, we create <strong>Logic Fog</strong>. The actual intent of the component — to render a user interface — gets buried under layers of useState, useEffect, and complex dependency tracking. We’ve traded &quot;Wrapper Hell&quot; for &quot;Synchronization Hell.&quot;</p><h3>Why the Standard Solutions Fail</h3><ul><li><strong>Custom Hooks as Black Boxes:</strong> You call useAuth(), but you have no idea that inside it triggers three other hooks that might re-render your entire app.</li><li><strong>Over-Memoization:</strong> We use useMemo everywhere &quot;just in case,&quot; adding cognitive load and memory overhead for calculations that are actually very cheap.</li><li><strong>Effect Chains:</strong> useEffect A triggers a state change, which triggers useEffect B, which causes an infinite loop. Debugging this is a developer&#39;s nightmare.</li></ul><h3>The Solution: The “Readability-First” Framework</h3><p>I decided to stop being “clever” and start being “clear.” I shifted my strategy from <em>Reactive-everything</em> to <em>Predictable-logic</em>.</p><h3>1. The Logic Decoupling (Pure JS)</h3><p>If logic doesn’t need the React lifecycle, keep it out of React. Calculations, data transformations, and validation should be pure JavaScript functions. They are easier to test and zero-cost to render.</p><h3>2. State Consolidation (The Reducer Pattern)</h3><p>Multiple useState calls are often a sign that your state is related. Using useReducer makes state transitions explicit and easy to track in Redux DevTools or simple logs.</p><h3>3. Example: From Chaos to Clarity</h3><p>JavaScript</p><pre>// ❌ THE &quot;HOOK MONSTER&quot; (Hard to track, fragile dependencies)<br>const UserProfile = ({ id }) =&gt; {<br>  const [user, setUser] = useState(null);<br>  const [posts, setPosts] = useState([]);<br>  const [isEditing, setIsEditing] = useState(false);<br>  const [search, setSearch] = useState(&quot;&quot;);</pre><pre>  useEffect(() =&gt; {<br>    fetchUser(id).then(u =&gt; setUser(u));<br>  }, [id]);</pre><pre>  // Imagine 5 more hooks here...<br>  const filteredPosts = useMemo(() =&gt; {<br>    return posts.filter(p =&gt; p.title.includes(search));<br>  }, [posts, search]);</pre><pre>  return (/* ... 50 lines of JSX ... */);<br>};</pre><pre>// ✅ THE REFACTORED APPROACH (Predictable and Clean)<br>// Logic is moved OUTSIDE the component<br>const filterPosts = (posts, query) =&gt; posts.filter(p =&gt; p.title.includes(query));</pre><pre>const profileReducer = (state, action) =&gt; {<br>  switch (action.type) {<br>    case &#39;LOAD_USER&#39;: return { ...state, user: action.payload, loading: false };<br>    case &#39;SET_SEARCH&#39;: return { ...state, search: action.payload };<br>    default: return state;<br>  }<br>};</pre><pre>const UserProfile = ({ id }) =&gt; {<br>  const [state, dispatch] = useReducer(profileReducer, initialValue);</pre><pre>  useEffect(() =&gt; {<br>    api.get(`/user/${id}`).then(res =&gt; dispatch({ type: &#39;LOAD_USER&#39;, payload: res }));<br>  }, [id]);</pre><pre>  // No useMemo needed if the calculation is simple and clean<br>  const displayPosts = filterPosts(state.posts, state.search);</pre><pre>  return (<br>    &lt;section&gt;<br>      &lt;SearchBar onChange={(val) =&gt; dispatch({ type: &#39;SET_SEARCH&#39;, payload: val })} /&gt;<br>      &lt;PostList data={displayPosts} /&gt;<br>    &lt;/section&gt;<br>  );<br>};</pre><h3>What I’m Doing Differently Moving Forward</h3><p>I have replaced my “hook-first” mentality with a <strong>“logic-first”</strong> one. Here is my new playbook:</p><ul><li><strong>The “Three State” Rule:</strong> If I find myself writing more than three useState hooks in one file, I force myself to use useReducer. It centralizes the &quot;how&quot; and &quot;why&quot; of state changes.</li><li><strong>React as a Thin Layer:</strong> My components are now just “translators” that turn data into HTML. The heavy lifting happens in pure JS files that don’t even know React exists.</li><li><strong>Dependency Audits:</strong> Before adding a variable to a useEffect array, I ask: <em>&quot;Can I achieve this through an event handler instead?&quot;</em> Often, the answer is yes.</li><li><strong>Prioritize the “Next Dev”:</strong> I write code for the person who will maintain it six months from now. That person is usually me, and I don’t want to hate my past self.</li></ul><h3>Closing: The Craft of Balance</h3><p>At the end of the day, our job isn’t to use every feature a library offers. Our job is to solve problems with the least amount of complexity possible. Hooks are an incredible tool, but like any power tool, if you use them without a plan, you’re going to make a mess.</p><p>I’ve learned that a “clean” component isn’t one that uses the most advanced patterns — it’s the one that tells a clear story.</p><p><strong>Stop fighting the lifecycle. Start writing logic. Your future self (and your team) will thank you.</strong></p><p><em>What about you? Have you ever felt “Hook Fatigue”? Share your horror stories or your favorite refactoring tips in the comments below. Let’s build better, simpler interfaces together.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cfcb9e67fd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Biggest Refactor We’ve Ever Done in React Native: From Spaghetti to Scalable Modularization]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/the-biggest-refactor-weve-ever-done-in-react-native-from-spaghetti-to-scalable-modularization-b1aae2750e6a?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1aae2750e6a</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[technical-debt]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 15:49:13 GMT</pubDate>
            <atom:updated>2026-04-14T15:49:13.580Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZOakZhW75VLKw-9JmBM8ZQ.png" /></figure><p>It was 2:00 AM, and I was staring at a stack trace that made no sense. We had a production bug in the checkout flow, but the code causing the crash was located in a “utils” folder inside the authentication module.</p><p>Our React Native codebase had become a giant, sentient ball of yarn. Every time we pulled one thread to fix a bug, a feature on the other side of the app would unravel. This is the story of how we stopped “just shipping features” and spent three months gutting our architecture to save our sanity.</p><h3>The Biggest Refactor We’ve Ever Done in React Native: From Spaghetti to Scalable Modularization</h3><p>It was 2:00 AM, and I was staring at a stack trace that made absolutely no sense. We had a critical production bug in the checkout flow, but the code causing the crash was located in an obscure utils folder inside the authentication module.</p><p>I remember leaning back, rubbing my eyes, and realizing that our React Native codebase had become a giant, sentient ball of yarn. Every time we pulled one thread to fix a bug, a feature on the opposite side of the app would unravel.</p><p>This wasn’t just a “bad day.” This was the result of two years of “shipping fast” without looking back. This is the story of how we stopped the bleeding and executed a massive refactor — moving from a monolithic mess to a modular architecture — to save our app, our team, and our sanity.</p><h3>The Hook: A Personal Tale of Technical Debt</h3><p>When we started this project, we were a “lean” team of three. We followed the standard React Native boilerplate: components/, screens/, services/, and utils/. It was fast, it was intuitive, and it worked—until it didn&#39;t.</p><p>Fast forward 18 months: our team grew to 15 developers, and we had over 100 screens. Suddenly, a simple change to a button component required updating 20 different test snapshots. A “quick fix” in the API layer would break the navigation state in a completely unrelated module.</p><p>The frustration was palpable. Every Sprint Planning felt like a negotiation with a terrorist — the “terrorist” being our own legacy code. We were paying so much “interest” on our technical debt that new features took three times longer than they did a year ago. We were at a breaking point.</p><h3>The Real Problem: The “Import Web” and Shared State</h3><p>The core issue wasn’t just “messy code.” It was <strong>tight coupling</strong>. We had fallen into three major traps that are common in growing React Native apps:</p><h3>1. The God-File Syndrome</h3><p>Our GlobalStore.ts (Redux/Zustand) had become a dumping ground. It handled everything: user authentication, cart items, theme settings, and even temporary UI flags for the onboarding tutorial. Because everything lived in one place, every component felt entitled to access (and change) any piece of data.</p><h3>2. Circular Dependencies</h3><p>Because we organized by <em>type</em> (all screens in one folder), screens frequently imported from each other.</p><ul><li>LoginScreen imported ProfileScreen for a redirect.</li><li>ProfileScreen imported SettingsScreen.</li><li>SettingsScreen eventually imported something that led back to LoginScreen.</li></ul><p>This created a “dependency hell” that made the Metro bundler crawl and made unit testing almost impossible.</p><h3>3. The “Utils” Black Hole</h3><p>Anything that didn’t have a clear home ended up in src/utils. Eventually, utils became a 5,000-line directory that every single file in the project relied on. Changing a date formatter in utils could literally crash the payment gateway.</p><h3>Why Common Solutions Failed Us</h3><p>We didn’t jump into a massive refactor immediately. We tried the “standard” advice first, but it failed for specific reasons:</p><ul><li><strong>Atomic Design:</strong> We tried splitting everything into Atoms, Molecules, and Organisms. While the UI looked cleaner, the <em>logic</em> was still tangled. We just ended up with “Atomic Spaghetti.”</li><li><strong>More Documentation:</strong> We wrote a 40-page Confluence doc on “How to Write Code.” No one read it. In the heat of a deadline, developers will always take the path of least resistance.</li><li><strong>Micro-frontends for Mobile:</strong> We considered Repack/Module Federation, but the infrastructure overhead was too much for our team size. We needed a solution that lived within a single repository but provided the discipline of multiple apps.</li></ul><h3>Our Solution: Domain-Driven Modularization</h3><p>We realized that architecture isn’t about where you put files; it’s about <strong>where you draw boundaries.</strong> We decided to treat every major feature as a “Mini-App.”</p><h3>The Strategy: Feature-Based Architecture</h3><p>We moved away from a “Horizontal Layered” structure to a “Vertical Feature” structure. Here is how it looks:</p><p>Plaintext</p><pre>src/<br>  core/           # Shared UI, Network, Theme (The Foundation)<br>  features/<br>    auth/         # Everything related to Login/Signup<br>      api/<br>      components/<br>      hooks/<br>      index.ts    # The PUBLIC API (The &quot;Gatekeeper&quot;)<br>    checkout/<br>    profile/<br>  app/            # Entry point, Main Navigation</pre><h3>The “Public API” Rule (The Game Changer)</h3><p>The most important rule we implemented was the <strong>Index Gatekeeper</strong>. A feature (e.g., checkout) can only import from another feature (e.g., auth) through its index.ts file.</p><p>If a file isn’t exported in index.ts, it is <strong>private</strong>. If a developer tries to deep-import a private file, our linting rules block the PR.</p><h3>Concrete Example: The Code Transformation</h3><p><strong>Before (The Mess):</strong></p><p>TypeScript</p><pre>// features/checkout/PaymentButton.tsx<br>import { useUserStore } from &#39;../auth/store/userStore&#39;; // Direct leak<br>import { validateSession } from &#39;../auth/api/authActions&#39;; // Direct coupling<br>import { Colors } from &#39;../../constants/colors&#39;;</pre><pre>export const PaymentButton = () =&gt; {<br>  const { user } = useUserStore(); // Checkout knows too much about Auth internals<br>  // ... logic<br>};</pre><p><strong>After (The Modular Way):</strong></p><p>TypeScript</p><pre>// features/auth/index.ts (The Public API)<br>export { useUserIdentity } from &#39;./hooks/useUserIdentity&#39;;<br>export { AuthButton } from &#39;./components/AuthButton&#39;;<br>// validateSession and userStore stay PRIVATE</pre><p>TypeScript</p><pre>// features/checkout/components/PaymentButton.tsx<br>import { useUserIdentity } from &#39;@features/auth&#39;; // Importing from the Public API<br>import { Button } from &#39;@core/components&#39;; // Shared UI<br>import { useCheckoutLogic } from &#39;../hooks/useCheckoutLogic&#39;;</pre><pre>export const PaymentButton = () =&gt; {<br>  const { identity } = useUserIdentity(); // Checkout only sees what Auth allows<br>  const { processPayment, loading } = useCheckoutLogic(identity);</pre><pre>  return (<br>    &lt;Button <br>      label=&quot;Pay Now&quot; <br>      onPress={processPayment} <br>      isLoading={loading} <br>    /&gt;<br>  );<br>};</pre><h3>Technical Insights: Architecture Evolves</h3><p>The biggest lesson we learned? <strong>Architecture is a living organism.</strong> What worked for 3 developers will kill a team of 15.</p><p>During the refactor, we used <strong>ESLint</strong> to enforce these boundaries. We used the no-restricted-imports rule to prevent features from reaching into each other&#39;s &quot;guts.&quot;</p><p>JSON</p><pre>// .eslintrc.js excerpt<br>&quot;no-restricted-imports&quot;: [&quot;error&quot;, {<br>  &quot;patterns&quot;: [{<br>    &quot;group&quot;: [&quot;@features/*/*&quot;],<br>    &quot;message&quot;: &quot;Private feature internals are not allowed. Please use the public API via @features/feature-name instead.&quot;<br>  }]<br>}]</pre><p>This simple rule shifted the culture. Developers started thinking: <em>“Should I really expose this internal state, or should I provide a clean hook for it?”</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1aae2750e6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How a Silent Crash Almost Ruined Our Launch (and Why Logs Aren’t Enough)]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/how-a-silent-crash-almost-ruined-our-launch-and-why-logs-arent-enough-ef115804ca46?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef115804ca46</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[android-development]]></category>
            <category><![CDATA[tech-lessons]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 08:03:11 GMT</pubDate>
            <atom:updated>2026-04-13T08:03:11.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r-3TYtLK2zgHKCsmRzTqMQ.png" /></figure><p>It was 11 PM on a Friday — the “Golden Hour” of a major app release. We had just pushed our latest build to 50,000 users. The dashboard showed a steady stream of traffic. No server errors. No angry emails. Everything looked perfect.</p><p>Or so I thought.</p><p>Two hours later, I noticed something chilling: <strong>The conversion rate for our new checkout feature was 0%.</strong> Not low. Zero.</p><p>In this article, I’ll share how a “silent crash” almost cost us a quarter’s worth of revenue, why our standard debugging failed, and how shifting to a proactive observability mindset saved our release.</p><h3>The Frustration: The Bug That Didn’t Exist</h3><p>As a developer, your worst nightmare isn’t a crash; it’s a <strong>silent failure</strong>.</p><p>We had implemented a new payment validation logic. In our local testing, it worked. In staging, it worked. But in the wild, a specific edge case — a null value from a legacy API — was triggering a caught exception that we had “safely” handled with an empty catch block.</p><p>Kotlin</p><pre>// The mistake: Swallowing the error<br>try {<br>    val status = paymentProcessor.verify(transactionId)<br>    updateUI(status)<br>} catch (e: Exception) {<br>    // We thought we were being &quot;safe&quot; by not crashing the app,<br>    // but we left the user stuck on a loading spinner forever.<br>    hideLoading() <br>}</pre><p>Because the app didn’t “hard crash,” our basic analytics didn’t flag anything. To the system, the user just… stopped. This is the <strong>frustration of false stability.</strong></p><h3>Why Common Solutions Failed</h3><p>Normally, we rely on <strong>Logcat</strong> or simple <strong>Print Statements</strong>. But once the app is in the hands of 50,000 people across different time zones and devices, logs are useless.</p><ul><li><strong>Manual Testing:</strong> We couldn’t replicate the specific network latency of a user in a rural area.</li><li><strong>User Reports:</strong> By the time a user emails support, you’ve already lost them.</li></ul><h3>The Turning Point: Implementing Crashlytics the Right Way</h3><p>We realized we needed more than just a “crash reporter.” We needed <strong>observability</strong>. We integrated <strong>Firebase Crashlytics</strong>, but instead of just waiting for the app to die, we used <strong>Non-Fatal Exceptions</strong>.</p><h3>The Technical Fix</h3><p>We refactored our error handling to “scream” to the dashboard whenever a silent failure occurred, without ruining the user experience.</p><p>Kotlin</p><pre>// The Solution: Observability with Crashlytics<br>try {<br>    val status = paymentProcessor.verify(transactionId)<br>    updateUI(status)<br>} catch (e: Exception) {<br>    hideLoading()<br>    showErrorMessage(&quot;Something went wrong. Please try again.&quot;)<br>    <br>    // Log the &quot;silent&quot; crash to Crashlytics<br>    FirebaseCrashlytics.getInstance().apply {<br>        setCustomKey(&quot;transaction_id&quot;, transactionId)<br>        setCustomKey(&quot;network_type&quot;, getNetworkStatus())<br>        recordException(e) // This makes the invisible, visible.<br>    }<br>}</pre><h3>The Result</h3><p>Within 5 minutes of deploying the hotfix, our Crashlytics dashboard lit up. We saw exactly which line was failing and, more importantly, the <strong>Custom Keys</strong> told us it only happened on slow 3G connections. We fixed the logic, pushed an update, and the conversion rate bounced back.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef115804ca46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mengapa Kami Menghapus Dark Mode (Sementara)]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/mengapa-kami-menghapus-dark-mode-sementara-b2f7e9714a4a?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2f7e9714a4a</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[uiux-design-trends]]></category>
            <category><![CDATA[design-system-tips]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[tech-insights]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Wed, 08 Apr 2026 09:32:15 GMT</pubDate>
            <atom:updated>2026-04-08T09:32:15.553Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-VgNNyrFSZXVof569S79g.png" /></figure><p>Pekan lalu, saya melakukan sesuatu yang bagi sebagian desainer dan user adalah sebuah “dosa besar”: <strong>Saya menghapus opsi Dark Mode dari aplikasi kami.</strong></p><p>Keputusan ini memicu debat panas di Slack. “Bagaimana dengan kenyamanan mata pengguna?” atau “Ini kan standar aplikasi modern!”. Namun, setelah melihat tumpukan hutang teknis (<em>technical debt</em>) yang kian menggunung, saya tahu ini adalah langkah mundur yang diperlukan untuk melompat lebih jauh.</p><h3>Masalah: Ketika Estetika Menjadi Beban</h3><p>Semua bermula dari ambisi. Kami ingin aplikasi kami terlihat keren dengan fitur <em>dark mode</em> yang otomatis. Namun, kenyataannya? UI kami menjadi sangat kompleks. Setiap kali kami menambah fitur baru, developer harus mengecek dua kali lipat variabel warna.</p><p>Kesalahan terbesar kami adalah <strong>tidak memiliki pondasi yang kuat</strong>. Kami langsung melompat ke fitur tanpa membereskan <em>Design System</em> terlebih dahulu. Akibatnya:</p><ul><li>Warna abu-abu di halaman A berbeda dengan halaman B.</li><li>Kontras teks seringkali tidak lolos standar aksesibilitas (WCAG).</li><li><em>Maintenance</em> menjadi mimpi buruk.</li></ul><h3>Solusi Teknis: Menstabilkan Design System</h3><p>Kami memutuskan untuk “puasa” <em>dark mode</em> selama satu kuartal. Fokus kami dialihkan sepenuhnya untuk membangun <strong>Design System Stabilization</strong>. Kami mengganti semua <em>hardcoded colors</em> dengan <strong>Design Tokens</strong>.</p><p>Daripada menulis warna seperti ini: color: #1A1A1A;</p><p>Kami beralih ke struktur yang semantik. Berikut adalah contoh bagaimana kami merapikan <em>theme provider</em> kami menggunakan React/CSS-in-JS agar di masa depan, aktivasi <em>dark mode</em> hanya memerlukan satu baris kode, bukan ribuan:</p><p>JavaScript</p><pre>// Struktur Design Tokens yang kami standarisasi<br>const lightTheme = {<br>  background: {<br>    primary: &quot;#FFFFFF&quot;,<br>    secondary: &quot;#F4F4F7&quot;,<br>  },<br>  text: {<br>    main: &quot;#121212&quot;,<br>    muted: &quot;#666666&quot;,<br>  },<br>  accent: &quot;#3B82F6&quot;,<br>};</pre><pre>// Insight: Jangan gunakan nama warna (blue), gunakan peran warna (accent/action)<br>const GlobalStyle = createGlobalStyle`<br>  body {<br>    background-color: ${(props) =&gt; props.theme.background.primary};<br>    color: ${(props) =&gt; props.theme.text.main};<br>    transition: all 0.2s ease-in-out;<br>  }<br>`;</pre><p>Dengan standarisasi ini, kami memangkas kompleksitas kode hingga <strong>40%</strong>. Kami tidak lagi menebak warna apa yang harus dipakai; kami cukup merujuk pada token yang sudah disepakati.</p><h3>Insight: Kedisiplinan Fitur (Feature Discipline)</h3><p>Bagi Anda yang sudah di level <em>intermediate</em> atau senior, Anda akan paham bahwa <strong>“No” is a powerful word.</strong></p><p>Banyak tim gagal karena terjebak dalam <em>Feature Creep</em> — terus menambah fitur tanpa memikirkan skalabilitas jangka panjang. Menghapus <em>dark mode</em> sementara adalah bentuk <strong>Feature Discipline</strong>. Kami memilih untuk memiliki satu mode (Light Mode) yang sempurna, daripada dua mode yang setengah matang dan penuh <em>bug</em>.</p><blockquote><em>“Kedewasaan sebuah tim produk diukur bukan dari seberapa banyak fitur yang mereka rilis, tapi dari keberanian mereka memprioritaskan stabilitas sistem di atas tren sesaat.”</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2f7e9714a4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When a Slow API Makes Your App Look Like Amateur Work]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/when-a-slow-api-makes-your-app-look-like-amateur-work-f56d56b396b5?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/f56d56b396b5</guid>
            <category><![CDATA[web-performance]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 06:35:30 GMT</pubDate>
            <atom:updated>2026-04-07T06:35:30.860Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N1IAVZEK-WJn2Ejpptu-zw.png" /></figure><p>It was 11:00 PM on a Tuesday, and I was staring at a loading spinner that felt like it was mocking me.</p><p>I had just shipped what I thought was a “clean” feature for our mobile dashboard. On my high-end MacBook, using a local development server, everything was snappy. But there I was, sitting on my couch with a weak 4G connection, watching my app struggle to breathe.</p><p>The UI was beautiful, the animations were smooth, but the data took four seconds to arrive. To the user, my “perfect” app wasn’t sophisticated — it was broken.</p><h3>The Invisible Killer: The Latency Death Spiral</h3><p>Most developers think “performance” is about how fast their code runs. In reality, for 90% of mobile apps, performance is about <strong>how long the user has to wait for the network.</strong></p><p>The problem I faced was a classic <strong>N+1 request chain</strong>. To render a single dashboard screen, the app was making:</p><ol><li>A request for the user profile.</li><li>A request for the notification count.</li><li>Three separate requests for different data widgets.</li></ol><p>On a fast connection, this is manageable. On a mobile network with a 300ms round-trip time (RTT), those five requests — even if processed in parallel — create a bottleneck. Toss in a little bit of packet loss, and your “premium” app feels like a legacy website from 2005.</p><h3>Why “Just Making the Server Faster” Usually Fails</h3><p>When we see slow APIs, our first instinct is to optimize the database or add more RAM to the server. But here’s the cold truth: <strong>You can have a 10ms database query, but if the user’s mobile carrier has a 500ms lag, your backend optimization is invisible.</strong></p><p>The bottleneck isn’t the processing; it’s the <strong>overhead of the handshake.</strong></p><h3>The Strategy: Batching and Caching</h3><p>To fix this, I had to stop treating the network as a reliable, infinite pipe and start treating it as an expensive, fragile resource. I implemented a two-pronged attack: <strong>Request Batching</strong> and <strong>Aggressive Caching.</strong></p><h3>1. Request Batching (The Gateway Pattern)</h3><p>Instead of letting the mobile app orchestrate five different calls, I created a “BFF” (Backend for Frontend) endpoint. The app asks for everything it needs in one go, and the server — which has a high-speed connection to the database — assembles the data.</p><p><strong>The “Amateur” Way (Multiple Calls):</strong></p><p>JavaScript</p><pre>// This kills performance on mobile<br>const profile = await api.get(&#39;/user/profile&#39;);<br>const stats = await api.get(&#39;/user/stats&#39;);<br>const settings = await api.get(&#39;/user/settings&#39;);</pre><p><strong>The “Pro” Way (Batching):</strong></p><p>JavaScript</p><pre>// One request, one handshake<br>const dashboardData = await api.get(&#39;/v1/batch/dashboard&#39;);</pre><pre>/* Response: {<br>  &quot;profile&quot;: {...},<br>  &quot;stats&quot;: {...},<br>  &quot;settings&quot;: {...}<br>}<br>*/</pre><h3>2. Smart Caching with “Stale-While-Revalidate”</h3><p>Users hate spinners. The best way to hide latency is to show them <em>something</em> immediately. By using a Stale-While-Revalidate (SWR) pattern, I show the data from the last session while the new data fetches in the background.</p><p>JavaScript</p><pre>async function getDashboardData() {<br>  // 1. Check local cache first<br>  const cachedData = await storage.get(&#39;dashboard_cache&#39;);<br>  if (cachedData) {<br>    updateUI(cachedData); // Show old data immediately<br>  }</pre><pre>  try {<br>    // 2. Fetch fresh data from API<br>    const freshData = await api.get(&#39;/v1/batch/dashboard&#39;);<br>    <br>    // 3. Update cache and UI<br>    await storage.save(&#39;dashboard_cache&#39;, freshData);<br>    updateUI(freshData);<br>  } catch (error) {<br>    console.error(&quot;Network failed, but user still sees cached data!&quot;);<br>  }<br>}</pre><h3>The Real Insight: Perceived Performance &gt; Real Performance</h3><p>After implementing these changes, the app didn’t actually download data that much faster — but it <strong>felt</strong> instantaneous.</p><p>This is the concept of <strong>Perceived Performance.</strong> A user doesn’t care if the API takes 200ms or 500ms if they are looking at a “Skeleton Screen” or cached data from 10 minutes ago. If the UI responds immediately to their touch, the app is “fast.” If the UI hangs while waiting for a network handshake, the app is “bad.”</p><blockquote><strong><em>Lesson learned:</em></strong><em> Your job isn’t to eliminate latency (physics won’t let you); your job is to </em><strong><em>hide</em></strong><em> it.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f56d56b396b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Every Mobile Engineer Needs to Break the “API Dependency” Habit (And Learn Backend)]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/why-every-mobile-engineer-needs-to-break-the-api-dependency-habit-and-learn-backend-21c4531340cc?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/21c4531340cc</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[fullstackmindset]]></category>
            <category><![CDATA[career-in-tech]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[mobile-development]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 07:14:49 GMT</pubDate>
            <atom:updated>2026-04-06T07:14:49.656Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j0uYdna15dVrXC9imlnuCA.png" /></figure><h3>The Hidden Ceiling in Your Mobile Career</h3><p>Two years ago, I sat in front of my monitor at 2:00 AM, staring at an Android Studio debugger that seemed to be mocking me. The e-commerce app we were building kept crashing at the checkout stage — specifically when the user hit the “Pay” button.</p><p>The problem was a classic: the API was returning a data format that changed overnight without any documentation. A price field that used to be an integer suddenly became a string because of a silent migration in the database.</p><p>I did what 90% of mobile engineers do: I opened Slack, tagged the backend team, and wrote: <em>“Hey, the API is broken. Price is returning a string now. Please fix it, I’m blocked.”</em></p><p>Then, I waited. And waited. Two days later, the backend team finally responded after clearing their sprint backlog. In that moment, I realized something bitter: <strong>As a mobile engineer, I was merely a “servant” to a system I didn’t understand.</strong> Absolute dependency on an API isn’t just a productivity killer; it’s a ceiling on your strategic value as an engineer.</p><h3>The Problem: The “Black Box” API Dependency</h3><p>The biggest issue in the mobile development industry today is the sharp dichotomy between “Client-side” and “Server-side.” We often feel our job is done once we’ve designed a beautiful UI and made a successful fetch() call.</p><p>However, this “Black Box” mentality creates several critical issues that stunt our career growth:</p><ol><li><strong>Stagnant Velocity:</strong> Every time a minor UI change requires new data, you have to wait for the backend team to release a new endpoint. You become your own bottleneck.</li><li><strong>Lack of Context:</strong> You don’t know why a request takes 5 seconds. Is it a network handshake issue, or an inefficient database query? Without backend knowledge, you’re just guessing.</li><li><strong>The “Throw it Over the Wall” Culture:</strong> We tend to blame the backend when an error occurs without providing a helpful diagnosis. This creates unnecessary friction between teams.</li></ol><p>Many engineers try to solve this by simply reading Swagger or Postman documentation. But let’s be honest: <strong>Reading the manual is not the same as understanding the engine.</strong></p><h3>Why Standard Solutions Fail</h3><p>Typically, companies try to fix this collaboration gap with conventional methods:</p><ul><li><strong>Stricter API Documentation:</strong> Edge cases will still slip through.</li><li><strong>More Sync Meetings:</strong> More meetings mean less time for actual coding.</li><li><strong>Mock Servers:</strong> These provide an illusion of progress but rarely represent the server’s true behavior in production.</li></ul><p>These solutions fail because they treat the <strong>symptom</strong>, not the <strong>root cause</strong>. The root cause is a lack of <strong>Backend Literacy</strong>. Without understanding how data is processed, stored, and piped, you will always be reactive rather than proactive.</p><h3>The Solution: Building the “Full-Stack Mindset”</h3><p>The real solution isn’t necessarily switching careers to become a Backend Developer. It’s about achieving <strong>Backend Literacy</strong> — the ability to understand, diagnose, and contribute to the server-side ecosystem.</p><p>Here is how a “Full-stack mindset” will 10x your value in the job market:</p><h3>1. Understanding the “Cost of Data”</h3><p>When you understand how databases work (like indexing in PostgreSQL), you stop requesting massive data objects. You start thinking: <em>“Do I really need this entire 50-field User object, or just the ID and Avatar to save bandwidth?”</em></p><h3>2. Debugging Beyond the Client</h3><p>Instead of just looking at Logcat or Xcode logs, you can open the backend repository, look at the controller logic, and find the error yourself. Imagine your value when you go to the backend team with a solution: <em>&quot;Hey, I checked the filtering logic; there’s a conditional error on line 42. I’ve opened a Draft PR for it.&quot;</em></p><h3>Technical Example: From Passive Consumer to Active Architect</h3><p>Let’s look at the transition. Suppose you are building a <strong>User Profile</strong> feature.</p><h3>The “Old” Way (Passive Consumption)</h3><p>Previously, you would just write the interface and pray the API doesn’t break.</p><p>Kotlin</p><pre>// Mobile Side (Kotlin/Retrofit)<br>interface UserApiService {<br>    @GET(&quot;users/{id}&quot;)<br>    suspend fun getUserProfile(@Path(&quot;id&quot;) id: String): UserResponse<br>}<br>// If this returns a 500 error, you are stuck waiting for the Backend dev.</pre><h3>The “New” Way (Backend Literacy with Ktor)</h3><p>With backend literacy, you can read (or even write) the logic. Notice how modern backend code (like Ktor) looks remarkably similar to mobile code. You can now spot errors or optimize queries yourself.</p><p>Kotlin</p><pre>// Backend Side (Kotlin/Ktor) - This is where the magic happens<br>routing {<br>    get(&quot;/users/{id}&quot;) {<br>        val userId = call.parameters[&quot;id&quot;]<br>        <br>        // As a mobile dev, you know exactly what the UI needs.<br>        // You can optimize the query to fetch ONLY required fields.<br>        val user = db.transaction {<br>            UserTable.select { UserTable.id eq userId }<br>                .map { User(it[name], it[avatarUrl], it[isPremium]) }<br>                .firstOrNull()<br>        }</pre><pre>        if (user != null) {<br>            call.respond(HttpStatusCode.OK, user)<br>        } else {<br>            // You can define custom error codes that your <br>            // Mobile App actually knows how to handle.<br>            call.respond(HttpStatusCode.NotFound, mapOf(&quot;error&quot; to &quot;USER_NOT_FOUND&quot;))<br>        }<br>    }<br>}</pre><p>By understanding this, you move from being an “API Consumer” to an “API Architect.”</p><h3>A Practical Strategy: Start Today</h3><p>Don’t try to learn the entire backend ecosystem overnight. Use this “Incremental Learning” strategy:</p><h3>🔹 Step 1: Deep Dive into Protocols (Not Just URLs)</h3><p>Go beyond knowing HTTP Status 200 or 404. Learn how HTTP/2 works, the benefits of gRPC, and how JWT authentication headers are handled securely.</p><h3>🔹 Step 2: Take Ownership of the API Contract</h3><p>In your next project, don’t let the backend team define the contract in isolation. Advocate for <strong>API-First Design</strong>. You should design the JSON schema because you are the one who knows how that data will be consumed by the UI.</p><h3>What I Will Do Differently From Now On</h3><p>After my 2:00 AM epiphany, I completely changed my workflow. I no longer see myself as just a “Mobile Engineer,” but as a <strong>Product Engineer</strong> with a specialization in mobile.</p><p>Moving forward, this is my professional commitment:</p><ul><li><strong>Stop Blaming, Start Diagnosing:</strong> If an API fails, I will inspect the backend code first before complaining.</li><li><strong>Optimize for Performance, Not Convenience:</strong> I will design mobile architectures that respect server resources.</li><li><strong>Advocate for Shared Tooling:</strong> I will push for tools like GraphQL or Protocol Buffers that force both teams to speak the same language.</li></ul><h3>Conclusion: The Future is T-Shaped</h3><p>The software engineering world is becoming increasingly competitive. Top-tier tech companies are no longer looking for people who can “just polish a UI.” They are looking for <strong>T-Shaped Engineers</strong>: individuals with deep expertise in one area (Mobile) but a strong foundation in another (Backend).</p><p>Learning the backend isn’t about increasing your workload. It’s about liberating yourself from dependency, accelerating your development cycle, and ultimately building more resilient products.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21c4531340cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Bug That Only Exists in Production: A $50,000 Lesson in Infrastructure Discipline]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/the-bug-that-only-exists-in-production-a-50-000-lesson-in-infrastructure-discipline-dcc215bb600a?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/dcc215bb600a</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[life-programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[site-reliability-engineer]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Fri, 03 Apr 2026 06:19:11 GMT</pubDate>
            <atom:updated>2026-04-03T06:19:11.820Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I7GE1e5Im9mJb71JOSQwVQ.png" /></figure><p>It was 2:00 AM on a Tuesday when my phone screamed. PagerDuty wasn’t just notifying me; it was judging me.</p><p>Our latest deployment — a seemingly “minor” update to the payment gateway — had just gone live. On my local machine, it worked perfectly. In the staging environment, it passed every integration test with flying colors. But the moment it hit the production servers? <strong>Total silence.</strong> No payments were processing, and the error logs were a cryptic mess of 502 Bad Gateway and Connection Timeout.</p><p>I felt that cold pit in my stomach. We were losing roughly $5,000 every ten minutes.</p><h3>The Frustration: “But It Worked on My Machine!”</h3><p>We’ve all been there. You spend hours meticulously crafting code, writing unit tests, and double-checking logic. You push to the dev branch, and it’s green. You push to staging, and the QA team gives the thumbs up.</p><p>Then, the “Production Ghost” appears.</p><p>For this specific bug, I spent three hours frantically digging through logs. I checked the database indexes, the API payloads, and the SSL certificates. Everything looked identical to staging. Yet, production was dying under the weight of real traffic while staging sat comfortably in its pristine, low-traffic bubble.</p><p>The frustration wasn’t just about the bug; it was about the <strong>uncertainty</strong>. If the environments are supposed to be “the same,” why is the behavior so radically different?</p><h3>The Real Problem: The Hidden Gap of Environment Mismatch</h3><p>After a grueling “war room” session, we found the culprit: a slight mismatch in the Nginx configuration and a different version of the connection pooling library used by the production OS.</p><p>In staging, we used a lightweight Docker image. In production, we were running on legacy bare-metal instances with a “slightly” older kernel. This is the <strong>Environment Mismatch</strong> trap.</p><p>We often think of environments as just “where the code lives,” but an environment is a complex stack:</p><ul><li><strong>The OS Kernel &amp; Libraries:</strong> Version 2.1.0 vs 2.1.1 can be the difference between a stable connection and a memory leak.</li><li><strong>The Data Volume:</strong> Staging usually has 1GB of “mock” data; Production has 5TB of messy, fragmented real-world data.</li><li><strong>The Network Topology:</strong> Firewalls, load balancers, and CDNs that exist in production but are “simulated” in staging.</li></ul><h3>Why Common Solutions Fail</h3><p>Most teams try to fix this by:</p><ol><li><strong>Manual Syncing:</strong> “I’ll just remember to update the config on both servers.” (Spoiler: You won’t).</li><li><strong>“Works on My Machine” Mentality:</strong> Assuming Docker solves everything. (It doesn’t if your Docker Compose isn’t mirroring the production orchestration).</li><li><strong>Testing in Production:</strong> Risky, unprofessional, and eventually, expensive.</li></ol><h3>The Solution: Achieving True Staging Parity</h3><p>If you want to stop waking up at 2:00 AM, you need <strong>Staging Parity</strong>. This isn’t just a buzzword; it’s a technical mandate that your staging environment must be a “pixel-perfect” clone of production.</p><h3>1. Infrastructure as Code (IaC)</h3><p>Stop configuring servers via SSH. Use Terraform or Pulumi. If the infrastructure isn’t defined in code, it doesn’t exist. By using the same script to spin up staging and production, you guarantee that the underlying hardware and network settings are identical.</p><h3>2. Parity in Data Gravity</h3><p>Don’t test with “Alice” and “Bob” entries. Use a sanitized, anonymized snapshot of production data in your staging environment. Performance bugs often hide in the scale of the data, not the logic of the code.</p><h3>3. Parity in Observability</h3><p>If your production has Datadog or New Relic, your staging must have it too. You need to see the same metrics and traces in staging to catch anomalies <em>before</em> they become outages.</p><h3>The Insight: Infrastructure Discipline is the Ultimate Skill</h3><p>Through this failure, I realized that a “Senior Engineer” isn’t someone who writes the cleverest code. <strong>A Senior Engineer is someone who respects the infrastructure.</strong></p><p>The bug didn’t happen because my logic was bad; it happened because my <strong>Infrastructure Discipline</strong> was weak. I treated the environment as an afterthought — a box to put my code in — rather than a fundamental part of the system.</p><p><strong>Infrastructure Discipline means:</strong></p><ul><li>Never making a “quick fix” in the production console.</li><li>Treating a mismatch between staging and production as a <strong>Critical Bug</strong>, even if no errors are showing yet.</li><li>Automating everything so that human error is removed from the deployment equation.</li></ul><h3>What I Will Do Differently Moving Forward</h3><p>This experience changed my entire workflow. From now on, my definition of “Done” has shifted:</p><ol><li><strong>Environment Audit First:</strong> Before writing a single line of a new feature, I check if the staging environment accurately reflects the current production state.</li><li><strong>Log Parity:</strong> I ensure that the logging levels and output formats are identical. If I can’t debug it in staging, I won’t ship it to production.</li><li><strong>Strict IaC Reviews:</strong> Infrastructure changes now go through the same rigorous Pull Request process as our core application code.</li></ol><h3>Summary for the Modern Dev</h3><p>The next time you see a bug that only appears in production, don’t just fix the code. <strong>Fix the gap.</strong> Close the distance between your development world and the real world. That is how you build software that scales, and more importantly, how you get a full night’s sleep.</p><h3>💡 Example of the Technical Fix (Code Snippet)</h3><p>If you are using Docker, ensure your docker-compose.yml isn&#39;t just for local dev. Use overrides to maintain parity while allowing for minor local differences:</p><p>YAML</p><pre># docker-compose.base.yml (The Source of Truth)<br>services:<br>  api:<br>    image: my-app:latest<br>    environment:<br>      - DB_CONNECTION_LIMIT=50 # Matches Prod!<br>      - NODE_ENV=production</pre><pre># docker-compose.prod.yml<br>services:<br>  api:<br>    extends:<br>      file: docker-compose.base.yml<br>      service: api<br>    deploy:<br>      replicas: 10</pre><p><em>By moving the “Production-like” settings into the base file, you force your local and staging environments to behave like the real thing.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dcc215bb600a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We’ve Been Using AsyncStorage Wrong for Years]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/weve-been-using-asyncstorage-wrong-for-years-2ff99726791d?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ff99726791d</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[performance-tech]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 06:14:58 GMT</pubDate>
            <atom:updated>2026-04-01T06:14:58.251Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M31-nv8eh4_fQ1j4bWPakQ.png" /></figure><h3>The 2 AM Crash That Changed Everything</h3><p>It was 2:14 AM on a Tuesday when my phone vibrated off the nightstand. As a Lead Engineer, you learn to dread that specific rhythm of PagerDuty alerts.</p><p>Our React Native app, which served over 500,000 monthly active users, was melting down. But it wasn’t a server outage. It wasn’t a botched deployment. It was something far more insidious: <strong>Data Corruption.</strong></p><p>Users were opening the app only to find themselves logged out. Worse, some were seeing cached data from <em>other</em> accounts, while others experienced infinite loading screens because their local configuration files had turned into unreadable “junk” strings.</p><p>For three years, we had relied on AsyncStorage as our &quot;source of truth&quot; for local persistence. We followed the documentation. We used it for auth tokens, user preferences, and small offline caches. We thought we were safe.</p><p><strong>We were wrong.</strong></p><h3>The Hidden Trap of AsyncStorage</h3><p>If you’ve built a React Native app in the last few years, AsyncStorage was likely your first choice. It’s the &quot;official&quot; recommendation. It’s simple, it’s asynchronous, and it &quot;just works&quot;—until it doesn&#39;t.</p><h4>1. The SQLite Bottleneck</h4><p>On Android, AsyncStorage is typically backed by SQLite. While SQLite is robust, the way AsyncStorage interfaces with it involves a massive amount of overhead. Every time you read or write, you are crossing the &quot;Bridge&quot;—the communication layer between JavaScript and Native code.</p><p>When your app grows, and you start firing multiple getItem and setItem calls during startup, you create a traffic jam. In our case, this &quot;jam&quot; led to race conditions where the bridge would drop calls or return null because the operation timed out.</p><h4>2. The 6MB Limit Ghost</h4><p>Many developers don’t realize that on Android, AsyncStorage has a default limit (often around 6MB). While you can increase this in MainApplication.java, most teams don&#39;t realize they&#39;ve hit the limit until users start reporting that their settings aren&#39;t saving. When the storage is full, AsyncStorage fails silently or, worse, corrupts the existing JSON string.</p><h4>3. Lack of Encryption</h4><p>This was our biggest “facepalm” moment during a security audit. AsyncStorage stores data in <strong>plaintext</strong>. If a device is compromised, you are essentially leaving the keys to the castle under the doormat.</p><h3>Why the “Common Solutions” Failed Us</h3><p>When we first noticed the corruption, we tried to “patch” it. We implemented:</p><ul><li><strong>Redux-Persist Transformations:</strong> To validate data before saving.</li><li><strong>Retry Logic:</strong> To attempt reading the data again if it returned null.</li><li><strong>JSON Schema Validation:</strong> To ensure the data wasn’t “junk.”</li></ul><p>None of it worked. Why? Because the problem wasn’t in our logic; it was in the <strong>Storage Architecture</strong> itself. We were trying to build a skyscraper on a foundation made of sand.</p><h3>The Solution: Migrating to MMKV and Secure Store</h3><p>After a week of debugging and losing sleep, we made the radical decision to rip out AsyncStorage entirely. We moved to a two-tier storage architecture:</p><h4>Tier 1: The Speed King (MMKV)</h4><p>For 90% of our data (preferences, UI state, non-sensitive cache), we migrated to <strong>MMKV</strong>. MMKV is a key-value storage framework developed by Tencent. Unlike AsyncStorage, it is written in C++ and uses <strong>JSI (JavaScript Interface)</strong> instead of the Bridge.</p><p><strong>Why MMKV changed the game for us:</strong></p><ul><li><strong>Synchronous Access:</strong> No more await. You can read data just like a standard JS object.</li><li><strong>Performance:</strong> It is roughly <strong>30x faster</strong> than AsyncStorage.</li><li><strong>Zero-Copy:</strong> It maps files directly into memory, preventing the “bridge lag.”</li></ul><h4>Tier 2: The Vault (SecureStore)</h4><p>For auth tokens and PII (Personally Identifiable Information), we moved these to the iOS Keychain and Android Keystore using react-native-keychain.</p><h3>The Technical Solution: How We Migrated</h3><p>You can’t just delete the old storage; you’ll log out every single user. We had to write a “Migration Bridge.”</p><p>TypeScript</p><pre>// Example of a Migration Logic<br>async function migrateFromAsyncStorage() {<br>  const hasMigrated = mmkvStorage.getBoolean(&#39;has_migrated_to_mmkv&#39;);</pre><pre>  if (!hasMigrated) {<br>    const allKeys = await AsyncStorage.getAllKeys();<br>    const allData = await AsyncStorage.multiGet(allKeys);</pre><pre>    for (const [key, value] of allData) {<br>      if (value) {<br>        // Move to MMKV<br>        mmkvStorage.set(key, value);<br>      }<br>    }</pre><pre>    mmkvStorage.set(&#39;has_migrated_to_mmkv&#39;, true);<br>    await AsyncStorage.clear(); <br>  }<br>}</pre><h3>What I Will Do Differently Moving Forward</h3><p>Looking back, the mistake wasn’t using AsyncStorage—it was using it blindly. As engineers, we often treat storage as a &quot;black box&quot; that just works.</p><p><strong>Moving forward, these are my three golden rules for Storage Architecture:</strong></p><ul><li><strong>Categorize Your Data:</strong> Before writing a single line of code, decide: Is this data <strong>Sensitive</strong> (Keychain), <strong>Ephemeral</strong> (State), or <strong>Persistent</strong> (MMKV)?</li><li><strong>Avoid the Bridge:</strong> The React Native Bridge is a bottleneck. Always prefer JSI-based libraries for high-frequency operations.</li><li><strong>Fail Loudly, Not Silently:</strong> If your storage fails, your app should know exactly why.</li></ul><h3>Final Thought</h3><p>We spent years fighting a tool that was never meant to handle the scale we gave it. Don’t let your “standard” stack become your “stagnant” stack. If you are still using AsyncStorage for everything, it&#39;s time to audit your architecture—before you get that 2 AM phone call.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ff99726791d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Cost of Animations in React Native: Why Your App Feels “Cheap”]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/the-hidden-cost-of-animations-in-react-native-why-your-app-feels-cheap-920769ea2f3a?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/920769ea2f3a</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[app-performance]]></category>
            <category><![CDATA[mobile-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 02:17:23 GMT</pubDate>
            <atom:updated>2026-03-31T02:17:23.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*McDJfFbtjkyfhVpeM23zYA.png" /></figure><p>Two months ago, I stayed up until 3:00 AM debugging a shopping cart transition. On my high-end iPhone 15 Pro, the animation looked buttery smooth. I was proud. I pushed the code, went to sleep, and woke up to a Slack channel full of complaints from our beta testers in emerging markets.</p><p>“The app feels laggy,” they said. “The checkout button stuttered, and I accidentally double-clicked.”</p><p>When I tested the app on a mid-range Android device, I saw the horror. The 60fps dream had turned into a 15fps nightmare. This is the <strong>Hidden Cost of Animations</strong> in React Native: if you do them wrong, you aren’t just making the app “look bad” — you are actively killing your user retention.</p><h3>The Frustration: The “Jank” Trap</h3><p>We’ve all been there. You use the standard Animated API from React Native. It’s intuitive, it’s built-in, and for a simple fade-in, it works. But as soon as you try to build a complex gesture-based interaction—like a Tinder-style swipe or a collapsible header—the <strong>Bridge</strong> starts to scream.</p><p>The problem is the architecture. In standard React Native animations, the calculated values have to travel back and forth across the “Bridge” between the JavaScript thread and the Native thread every single frame.</p><blockquote><strong><em>The Math of Failure:</em></strong><em> To maintain 60fps, you have exactly </em><strong><em>16.67ms</em></strong><em> to calculate a frame. If your JS thread is busy fetching API data or re-rendering a heavy component, that frame is dropped.</em></blockquote><blockquote><strong><em>Dropped Frame = Jank.</em></strong></blockquote><h3>Why Common Solutions Fail</h3><p>Most developers try to fix this by:</p><ol><li><strong>Optimizing </strong><strong>shouldComponentUpdate</strong>: This helps, but it doesn&#39;t solve the Bridge bottleneck.</li><li><strong>Using </strong><strong>useNativeDriver: true</strong>: This is a better step, but it’s extremely limited. It only supports non-layout properties (like opacity and transform). You can’t animate width, height, or flexbox using the native driver in the standard API.</li></ol><p>When your UI feels unresponsive, users subconsciously lose trust. A “janky” app feels like a “cheap” app.</p><h3>The Solution: Reanimated + The Native Driver</h3><p>To build world-class interfaces, you have to move the logic <strong>off the JavaScript thread entirely.</strong> This is where <strong>React Native Reanimated</strong> (v3) comes in. It allows you to write your animation logic in JS, but it runs on the UI thread using “worklets.”</p><h3>The Technical Fix: A Smooth Interaction</h3><p>Let’s look at a common scenario: A scale-and-fade interaction that remains smooth even if the JS thread is blocked.</p><p>JavaScript</p><pre>import React from &#39;react&#39;;<br>import { StyleSheet, View, Button } from &#39;react-native&#39;;<br>import Animated, { <br>  useSharedValue, <br>  useAnimatedStyle, <br>  withSpring, <br>  withTiming <br>} from &#39;react-native-reanimated&#39;;</pre><pre>export default function SmoothComponent() {<br>  // 1. Shared values live on the UI thread<br>  const scale = useSharedValue(1);<br>  const opacity = useSharedValue(1);</pre><pre>  const animatedStyle = useAnimatedStyle(() =&gt; {<br>    return {<br>      opacity: opacity.value,<br>      transform: [{ scale: scale.value }],<br>    };<br>  });</pre><pre>  const handlePress = () =&gt; {<br>    // 2. Animations are triggered and calculated on the Native side<br>    scale.value = withSpring(1.5);<br>    opacity.value = withTiming(0.5, { duration: 500 });<br>  };</pre><pre>  const handleRelease = () =&gt; {<br>    scale.value = withSpring(1);<br>    opacity.value = withTiming(1);<br>  };</pre><pre>  return (<br>    &lt;View style={styles.container}&gt;<br>      &lt;Animated.View style={[styles.box, animatedStyle]} /&gt;<br>      &lt;Button <br>        title=&quot;Animate&quot; <br>        onPressIn={handlePress} <br>        onPressOut={handleRelease} <br>      /&gt;<br>    &lt;/View&gt;<br>  );<br>}</pre><pre>const styles = StyleSheet.create({<br>  container: { flex: 1, alignItems: &#39;center&#39;, justifyContent: &#39;center&#39; },<br>  box: { width: 100, height: 100, backgroundColor: &#39;#6200ee&#39;, borderRadius: 20 },<br>});</pre><h3>Why this works:</h3><ul><li><strong>Worklets:</strong> The logic inside useAnimatedStyle is serialized and sent to the UI thread once.</li><li><strong>No Bridge Traffic:</strong> During the animation, no data is sent back to the JavaScript thread. Even if you run a heavy while(true) loop in your main JS code, this animation will still hit a perfect 60fps.</li></ul><h3>Lessons Learned: UI Smoothness = Retention</h3><p>Through this process, I realized that performance isn’t a “feature” — it’s a prerequisite.</p><ul><li><strong>Don’t trust the Simulator:</strong> Always test animations on a $100 Android phone. If it works there, it works anywhere.</li><li><strong>The 16ms Rule:</strong> If your interaction takes longer than 16ms to calculate, you are losing money. Users associate lag with bugs and insecurity.</li><li><strong>Invest in Reanimated Early:</strong> Don’t wait until the app is finished to “fix” animations. Implementing Reanimated from the start saves dozens of hours of refactoring later.</li></ul><h3>What I’m Doing Differently Moving Forward</h3><p>Moving forward, I’m changing my workflow entirely. I am no longer treating animations as “polish” added at the end of a sprint.</p><ul><li><strong>Native-First Mentality:</strong> If an animation cannot be run on the native driver, I will redesign the interaction to ensure it can.</li><li><strong>Performance Monitoring:</strong> I’ve started using the Flashlight tool to measure the “Score” of my UI interactions during CI/CD.</li><li><strong>Interaction Design:</strong> I’m spending more time in the “Gesture Handler” documentation. Smooth scrolling and dragging are the soul of a mobile app.</li></ul><p>The “Hidden Cost” of animations isn’t the development time — it’s the users you lose when your app feels sluggish. Use the native driver, move logic to the UI thread, and build something that feels as premium as it looks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=920769ea2f3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Lost 20% of Our Users Because Our Login Flow Was Too “Secure”]]></title>
            <link>https://rafizimraanarjunawijaya.medium.com/we-lost-20-of-our-users-because-our-login-flow-was-too-secure-98178b9f4974?source=rss-f5bd99ec0432------2</link>
            <guid isPermaLink="false">https://medium.com/p/98178b9f4974</guid>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[ux-design]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Rafi zimraan arjuna wijaya]]></dc:creator>
            <pubDate>Mon, 30 Mar 2026 02:12:15 GMT</pubDate>
            <atom:updated>2026-03-30T02:12:15.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpuFhYVLRNOUFLz6RYk3Hw.png" /></figure><h3>The Tuesday Morning Wake-Up Call</h3><p>I remember the silence in the war room. We had just launched our “Security Hardening” update. 12-character minimums, mandatory special characters, and a strict email verification loop. We felt like digital architects building a fortress.</p><p>But when the analytics hit, the fortress felt more like a prison.</p><p><strong>Our drop-off rate at the registration screen spiked by 20%.</strong> One in five potential users liked our landing page, clicked “Get Started,” saw our password requirements, and simply… left. They didn’t just leave the page; they left the brand.</p><h3>The Problem: The High Cost of Friction</h3><p>As engineers, we often suffer from the “Expert Blindness.” We use password managers, we understand 2FA, and we don’t mind a bit of friction for the sake of safety.</p><p>But the average user? They are tired. They have 500 other passwords to remember. When we asked them to create a “Strong Password” and then wait 3 minutes for a verification email that might end up in Spam, we weren’t being “secure” — we were being annoying.</p><blockquote><strong><em>The Hard Truth:</em></strong><em> Every extra field in your signup form is a 5–10% decrease in conversion. We had six.</em></blockquote><h3>Why Traditional “Best Practices” Failed Us</h3><p>We tried to “fix” it the traditional way first:</p><ol><li><strong>Better Tooltips:</strong> Explaining <em>why</em> they needed a symbol. (Users didn’t read them).</li><li><strong>Social Auth (OAuth):</strong> Helpful, but some users didn’t want to link their Google/Facebook accounts for privacy reasons.</li><li><strong>Password Strength Meters:</strong> This just turned the signup process into a frustrating game of “Guess what the dev wants.”</li></ol><p>The problem wasn’t the <em>strength</em> of the password; it was the <em>existence</em> of the password itself.</p><h3>The Solution: Going Passwordless with Magic Links</h3><p>We decided to kill the password. If a user owns their email or their phone, that <em>is</em> their identity. Why make them invent a secret string of text?</p><p>We moved to a <strong>Magic Link</strong> system combined with <strong>WebAuthn (Biometrics)</strong>. Here is how we implemented the core logic using Node.js and a simple frontend strategy.</p><h3>1. The Strategy: Token-Based Authentication</h3><p>Instead of a password field, we provide a single “Email” input. We generate a short-lived, one-time-use JWT (JSON Web Token) and send it to their inbox.</p><h3>2. The Implementation (Node.js/Express)</h3><p>JavaScript</p><pre>// Server-side: Generating the Magic Link<br>const jwt = require(&#39;jsonwebtoken&#39;);<br>const mailer = require(&#39;./mailer&#39;);</pre><pre>app.post(&#39;/auth/magic-link&#39;, async (req, res) =&gt; {<br>  const { email } = req.body;<br>  <br>  // 1. Check if user exists (or create a placeholder)<br>  const user = await User.findOrCreate({ email });</pre><pre>  // 2. Generate a token that expires in 15 minutes<br>  const magicToken = jwt.sign(<br>    { userId: user.id, type: &#39;magic_link&#39; }, <br>    process.env.JWT_SECRET, <br>    { expiresIn: &#39;15m&#39; }<br>  );</pre><pre>  const loginUrl = `https://myapp.com/verify?token=${magicToken}`;</pre><pre>  // 3. Send the email<br>  await mailer.send({<br>    to: email,<br>    subject: &#39;Your Magic Login Link&#39;,<br>    html: `&lt;p&gt;Click &lt;a href=&quot;${loginUrl}&quot;&gt;here&lt;/a&gt; to log in. This link expires in 15 mins.&lt;/p&gt;`<br>  });</pre><pre>  res.status(200).json({ message: &#39;Check your email!&#39; });<br>});</pre><h3>3. The Frontend Experience</h3><p>On the frontend, the user never sees a password box. They click the link in their email, and the app handles the rest:</p><p>JavaScript</p><pre>// Verification Page Logic<br>const urlParams = new URLSearchParams(window.location.search);<br>const token = urlParams.get(&#39;token&#39;);</pre><pre>if (token) {<br>  fetch(&#39;/api/auth/verify&#39;, {<br>    method: &#39;POST&#39;,<br>    body: JSON.stringify({ token })<br>  })<br>  .then(res =&gt; res.json())<br>  .then(data =&gt; {<br>    localStorage.setItem(&#39;session_token&#39;, data.accessToken);<br>    window.location.href = &#39;/dashboard&#39;;<br>  });<br>}</pre><h3>The Result: Recovery and Growth</h3><p>Within two weeks of implementing <strong>Passwordless Login</strong>:</p><ul><li><strong>Conversion Rate:</strong> Jumped back up by 22%.</li><li><strong>Support Tickets:</strong> “I forgot my password” tickets dropped to nearly zero.</li><li><strong>User Sentiment:</strong> Our NPS (Net Promoter Score) improved significantly. Users described the app as “modern” and “seamless.”</li></ul><h3>Lessons Learned: UX &gt; Security Complexity</h3><p>I learned that security is a spectrum. By removing the password, we didn’t actually make the app less secure. In fact, we eliminated the risk of <strong>Credential Stuffing</strong> (where hackers use passwords leaked from other sites).</p><h3>What I Will Do Differently Moving Forward:</h3><ul><li><strong>Start with Biometrics:</strong> If the device supports FaceID or TouchID, use it first. It’s the gold standard of “Zero Friction.”</li><li><strong>Progressive Profiling:</strong> Don’t ask for their name, company, and job title on the login page. Let them in first. Ask for details later.</li><li><strong>Monitor the “Funnel” Daily:</strong> If you see a drop at a specific input field, that field shouldn’t exist.</li></ul><h3>Final Thoughts</h3><p>We are no longer in the era of “Password123!”. We are in the era of frictionless identity. If you are still forcing your users to remember complex strings of text, you aren’t protecting them — you are pushing them away.</p><p><strong>Stop building walls. Start building doorways.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98178b9f4974" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>