<?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 Harshit Agrawal on Medium]]></title>
        <description><![CDATA[Stories by Harshit Agrawal on Medium]]></description>
        <link>https://medium.com/@harshitmadhav?source=rss-6545005e0bc6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JyEmK5ZBk5xCZZNSzfMMtw.jpeg</url>
            <title>Stories by Harshit Agrawal on Medium</title>
            <link>https://medium.com/@harshitmadhav?source=rss-6545005e0bc6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 04:51:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@harshitmadhav/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[tsgo vs tsc on React Native: 4 to 7x Faster, Same Errors]]></title>
            <link>https://javascript.plainenglish.io/tsgo-vs-tsc-on-react-native-4-to-7x-faster-same-errors-91bfd3157e00?source=rss-6545005e0bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/91bfd3157e00</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tsgo]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Harshit Agrawal]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 21:04:06 GMT</pubDate>
            <atom:updated>2026-10-09T09:22:44.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ec6FsAG_T56aAJ2m1DIww.png" /><figcaption>tsgo in react native</figcaption></figure><h3>What is tsgo?</h3><p>tsgo is the native version of the TypeScript compiler. Microsoft rewrote the compiler in Go, so instead of running as JavaScript on Node.js, it runs as a compiled binary that can use several CPU cores at once. It does the same job as tsc: it reads your tsconfig.json, checks your types and reports errors.</p><p>You get it from the npm package @typescript/native-preview, and the command is tsgo. It&#39;s the same work that became TypeScript 7, which reached general availability on July 8, 2026. Microsoft&#39;s claim is a speedup of 8x to 12x on full builds.</p><p>Those are big numbers, and big numbers in release notes usually come from big, ideal codebases. So I tested it on a React Native app.</p><p>Short version: tsgo type-checked my React Native project <strong>4 to 7 times faster</strong> than tsc and reported exactly the same errors. It did not use less memory, and it needs one workaround for ESLint. Details below.</p><h3>Why React Native is a good fit</h3><p>React Native never uses the TypeScript compiler to build your app. Metro uses Babel to strip the types and produce JavaScript. TypeScript only does two jobs in your project: checking types and powering your editor.</p><p>So a faster type checker speeds up your CI and your editor without touching how your app is built. That makes this a low-risk change.</p><h3>The test setup</h3><ul><li><strong>React Native:</strong> 0.87.1 (React 19.2.3), created with @react-native-community/cli init</li><li><strong>tsc baseline:</strong> typescript 6.0.3, the template default</li><li><strong>tsgo:</strong> @typescript/native-preview 7.0.0-dev.20260707.2</li><li><strong>tsconfig:</strong> @react-native/typescript-config (strict, noEmit, skipLibCheck)</li><li><strong>Machine:</strong> Apple M5, 10 cores, 16 GB RAM</li><li><strong>Node:</strong> 20.19.6</li></ul><p>The React Native template asks for Node 22.11 or higher. Type-checking works fine on 20.19.6, but upgrade Node before you run the app itself.</p><p>Both tools ran against the same tsconfig.json. To test bigger codebases, I generated synthetic apps with 100 to 1,000 screens. Each screen has typed props and route params, hooks, a FlatList, a StyleSheet and a recursive Paths&lt;T&gt; type. One shared reducer switches over a union with 2 actions per screen. Medians are from 3 to 7 runs, except the 1,000-screen test, which ran once.</p><h3>Benchmark results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSgtRDcM-gZTTJdVaCxYiw.png" /><figcaption>Benchmark results graph</figcaption></figure><p><em>Wall time for one full type-check on an Apple M5, log scale, lower is better. Median of 3 to 7 runs; the 1,000-screen result is a single run.</em></p><ul><li><strong>Stock template:</strong> tsc 0.29 s, tsgo 0.05 s (5.8x faster)</li><li><strong>100 screens:</strong> tsc 1.08 s, tsgo 0.15 s (7.2x faster)</li><li><strong>250 screens:</strong> tsc 3.05 s, tsgo 0.46 s (6.6x faster)</li><li><strong>500 screens:</strong> tsc 9.76 s, tsgo 1.59 s (6.1x faster)</li><li><strong>1,000 screens:</strong> tsc 46.95 s with a 12 GB heap, tsgo 12.0 s (3.9x faster)</li></ul><p>At every size I tested, tsgo was at least 3.9x faster, and at best 7.2x faster.</p><p>The 1,000-screen run needs a note. With Node’s default heap, tsc ran out of memory entirely, so I had to give it 12 GB to finish. On a 16 GB machine, both tools were swapping by then, so that run measured my machine as much as the compilers.</p><p>Incremental checks also got faster, at 500 screens:</p><ul><li><strong>--incremental, nothing changed:</strong> tsc 0.54 s, tsgo 0.07 s</li><li><strong>--incremental, one file edited:</strong> tsc 0.60 s, tsgo 0.11 s</li></ul><h3>Correctness</h3><p>A fast type checker is worthless if it disagrees with the real one, so I tested that too:</p><ul><li><strong>Stock template:</strong> 0 errors from both.</li><li><strong>9 planted mistakes:</strong> a bad setState argument, wrong prop types, a possibly-undefined value, a typo&#39;d property, bad StyleSheet values and an unknown component. Both tools reported the same 9 errors, with the same codes, lines and messages.</li><li><strong>With </strong><strong>skipLibCheck turned off:</strong> this makes the checker read node_modules declarations too. Both printed the same 14 lines of errors from react-native and react-native-safe-area-context.</li><li><strong>Synthetic apps from 100 to 1,000 screens:</strong> 0 errors from both.</li></ul><p>There was one difference. tsc exits with code 2 when it finds errors, and tsgo exits with 1. Both are non-zero, so CI fails either way. But if a script checks for exactly 2, you&#39;ll need to update it.</p><h3>The catches</h3><p><strong>Memory didn’t improve.</strong> On the stock template tsgo used less (65 MB vs 162 MB), but on a large app it was about the same or worse. At 500 screens, peak memory was 1.9 GB for tsgo and 1.7 GB for tsc. At 1,000 screens the compilers reported 5.1 GB and 6.1 GB, but both pushed a 16 GB machine into swap. Don’t expect tsgo to rescue a memory-starved CI box.</p><p><strong>A lot of the speed is parallelism.</strong> With --singleThreaded, tsgo took 4.2 s at 500 screens instead of 1.6 s. That&#39;s still 2.3x faster than tsc&#39;s 9.8 s, but if your CI runners have only 2 vCPUs, expect results closer to the single-threaded number.</p><p><strong>ESLint still needs the old compiler.</strong> TypeScript 7 ships without a stable programmatic API, and that’s expected in 7.1. Tools that call TypeScript from code, like the type-aware rules in @typescript-eslint, need the JavaScript typescript package. That&#39;s why I kept typescript 6.0.3 installed next to tsgo.</p><p><strong>Huge unions are slow in both.</strong> A switch over 2,000 actions made both checkers slow down faster than linearly. tsc went from 1.1 s to 47 s between 100 and 1,000 screens. tsgo handles it better, but if your type check is slow because of one gigantic union, splitting the union is the real fix.</p><h3>How to set it up</h3><p>I tested the @typescript/native-preview package, so these are the steps I can vouch for.</p><p><strong>1. Install it next to your existing TypeScript:</strong></p><p>bash</p><pre>npm install --save-dev @typescript/native-preview</pre><p>Don’t remove typescript. ESLint and similar tools still need it.</p><p><strong>2. Add scripts to package.json:</strong></p><p>json</p><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;typecheck&quot;: &quot;tsgo --noEmit&quot;,<br>    &quot;typecheck:tsc&quot;: &quot;tsc --noEmit&quot;<br>  }<br>}</pre><p>I kept the old tsc script as a fallback, and I’d suggest you do the same for a few weeks.</p><p><strong>3. Run it:</strong></p><p>bash</p><pre>npm run typecheck</pre><p>Your tsconfig.json doesn&#39;t need to change. tsgo reads the same file.</p><p><strong>4. Turn it on in VS Code.</strong> Install the “TypeScript (Native Preview)” extension, then add this to .vscode/settings.json:</p><p>json</p><pre>{<br>  &quot;js/ts.experimental.useTsgo&quot;: true<br>}</pre><p>Older versions of the extension used typescript.experimental.useTsgo, so try that name if the first one does nothing. If refactors or auto-imports ever act up, set it back to false.</p><p><strong>5. Use it in CI.</strong> Replace your type-check step with npm run typecheck. If any script checks the exit code, accept 1 as well as 2.</p><h3>What about the stable TypeScript 7?</h3><p>TypeScript 7.0 reached general availability on July 8, 2026, and the typescript package on npm now ships the native compiler as a regular tsc. When I tested, the newest @typescript/native-preview build was from July 7, while typescript 7.0.2 came out on October 8.</p><p>I only benchmarked the preview package, so I can’t give you numbers for typescript@7. But if you&#39;re starting today, try typescript@7 first. Its tsc is the same native compiler and gets regular releases, while the preview package hasn&#39;t been updated since July.</p><p>If you go that route, Microsoft’s compatibility package @typescript/typescript6 is meant to let tools like typescript-eslint keep using the 6.0 API through an npm alias:</p><p>bash</p><pre>npm install -D typescript@npm:@typescript/typescript6</pre><p>Check the official TypeScript 7 announcement before you migrate. TypeScript 7 also turns the deprecations from 6.0 into hard errors, so moving to 6.0 first makes the jump smoother.</p><h3>My recommendation</h3><p>Use tsgo for type-checking in your React Native project. The risk is low because Metro builds your app, not tsc. Make it the CI and pre-commit check, keep typescript installed for ESLint, and keep the tsc script around for a few weeks.</p><p>Just don’t expect lower memory use, and don’t expect the same speedup on a small CI runner as on a 10-core laptop. These numbers come from one machine and a synthetic app, so run the comparison on your own codebase before you trust mine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91bfd3157e00" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/tsgo-vs-tsc-on-react-native-4-to-7x-faster-same-errors-91bfd3157e00">tsgo vs tsc on React Native: 4 to 7x Faster, Same Errors</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Best Mechanic in Gaming Has Been Locked Away for 8 Years. Netflix Just Got the Key.]]></title>
            <link>https://medium.com/@harshitmadhav/the-best-mechanic-in-gaming-has-been-locked-away-for-8-years-netflix-just-got-the-key-5162245d69b8?source=rss-6545005e0bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5162245d69b8</guid>
            <category><![CDATA[patents]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[warner-bros]]></category>
            <category><![CDATA[netflix]]></category>
            <category><![CDATA[gaming]]></category>
            <dc:creator><![CDATA[Harshit Agrawal]]></dc:creator>
            <pubDate>Tue, 26 May 2026 20:34:43 GMT</pubDate>
            <atom:updated>2026-05-26T20:58:13.359Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UFQvMB5nuU-qd7qUEdmpA.png" /></figure><p><em>One of the greatest ideas in gaming history just got a new landlord — and nobody knows if that’s a good thing yet.</em></p><p>I still remember the first time a captain I’d killed came back.</p><p>I was about four hours into <em>Shadow of Mordor</em>, somewhere in the middle of a mission I’d already failed twice, when an Orc with a burned face showed up and started talking trash at me. Turns out I’d set him on fire in a previous fight and left him for dead. He wasn’t dead. He was angry. And now he was noticeably harder to kill than the last time we met.</p><p>I died again. But I didn’t really mind, because what just happened felt unlike anything I’d experienced in a game before. That orc wasn’t in a cutscene. Nobody wrote that moment for me. It just happened — because the game remembered, and built on it.</p><p>That’s what the Nemesis System is. And for nearly a decade, no one other than one studio has been allowed to use it.</p><p>That studio is gone now. And the patent — that precious, untouched, absolutely wasted patent — has landed in the hands of Netflix.</p><h3>In Case You Forgot What Made This Thing Special</h3><p>Most games have a simple relationship with their enemies: they exist, you fight them, they die, you move on. The Nemesis System broke that loop in a way that felt almost disrespectful to how boring everything else was by comparison.</p><p>Enemies in <em>Shadow of Mordor</em> and its sequel <em>Shadow of War</em> had ranks, names, personalities, and — critically — memory. If you killed a low-level grunt and he somehow survived, he’d come back tougher and with a serious grudge. If a captain beat you in combat, he’d get promoted, get stronger, and occasionally show up later just to remind you of your failure. The whole Orc hierarchy would shift around your actions. The game didn’t just react to you — it kept score.</p><p>Monolith Productions built this, and Warner Bros. made sure nobody else could by <a href="https://patents.google.com/patent/US20160279522A1/en">filing a patent in 2016</a>. That patent locks up the core mechanic until 2036. Twenty years of protection for an idea that, after two games, was just… put in a box.</p><h3>Here’s Where It Gets Depressing</h3><p><em>Shadow of War</em> came out in 2017. After that, Monolith started working on a <em>Wonder Woman</em> game that was reportedly going to use the Nemesis System in a new context. That game got cancelled. Then, earlier this year, Warner Bros. shut down Monolith Productions entirely.</p><p>So the studio that invented it: gone. The next game that would’ve used it: cancelled. The patent itself: still very much active, still very much blocking everyone else from trying.</p><p>There’s a particular kind of corporate absurdity where a company patents something brilliant, fails to do anything meaningful with it, and yet the patent continues to function as a wall between that idea and the rest of the world. That’s exactly what happened here. Warner Bros. essentially said “this is ours” and then proceeded to do nothing with it while simultaneously preventing anyone else from picking up the torch.</p><p>Developers have been quietly furious about this for years. And honestly? They have every right to be.</p><h3>And Then Netflix Showed Up With $80 Billion</h3><p>Late 2025, Netflix announced a deal to acquire Warner Bros. Discovery. Eighty billion dollars. The portfolio that came with it was staggering — HBO, DC, Harry Potter, Lord of the Rings, Game of Thrones, Mortal Kombat, NetherRealm, Rocksteady, the whole WB Games machine.</p><p>And buried somewhere in all of that: one patent for a dynamic enemy memory system filed in 2016.</p><p>The gaming side of the internet noticed pretty much immediately. A thread on r/gamedev broke down exactly what this transfer meant and, more importantly, what Netflix could choose to do with it. The tone wasn’t panicked — it was more like cautious curiosity mixed with years of accumulated frustration finally having somewhere new to point.</p><p>Netflix isn’t Warner Bros. They’ve been building their gaming division seriously for a few years now, with over 140 games on the platform and real money going into new titles. The thinking, I suppose, is that a company that actually wants to make games might treat this patent differently than a company that spent the last several years shutting down studios.</p><p>Maybe. We’ll see.</p><h3>The Petition, and What It Actually Represents</h3><p>Someone started a Change.org petition asking Netflix to either release the Nemesis System patent entirely or at least open it up for licensing. Around 200 signatures when it first started circulating — not a massive number, but the petition itself isn’t really the point.</p><p>The point is that developers have been wanting access to this mechanic for a long time. Not to rip it off wholesale, but to build on it, to experiment with what dynamic NPC memory could look like in different genres and different contexts. A horror game where the monster learns from how you’ve tried to escape it before. An RPG where your rivals in a guild remember every time you undercut or embarrassed them. A strategy game where enemy commanders develop countermeasures based on your patterns.</p><p>None of that can happen cleanly right now, because the patent creates legal risk that most studios — especially smaller ones without legal departments — aren’t willing to absorb. You can dance around it. You can build systems that are “inspired by” the Nemesis System without directly copying the specific patented implementation. But the shadow it casts is wide, and the chilling effect on experimentation is real.</p><h3>What Netflix Actually Does With This</h3><p>I’m not going to pretend I know what Netflix will do. But the options are pretty clear.</p><p>They could release it. Just open it up, let developers use it, collect the goodwill from the entire gaming community in one fell swoop. This is the dream scenario. It’s also probably unlikely — companies rarely give away IP without getting something in return, and Netflix is still a business.</p><p>They could license it broadly, either cheaply or for free, which accomplishes basically the same thing in practical terms while letting Netflix maintain formal ownership. This feels like the most realistic good outcome.</p><p>They could just use it themselves — build something that finally puts the mechanic back to work. Given that Netflix has the WB Games studios under their umbrella now, this isn’t far-fetched. A new game using the Nemesis System, made by one of the studios that came with the acquisition, is genuinely possible.</p><p>Or they could do nothing. Hold the patent, let it age out in 2036, and carry on. The gaming community would be disappointed but not surprised. This is sort of the default corporate move.</p><h3>Why I Think This Is Actually a Bigger Deal Than It Looks</h3><p>The Nemesis System patent isn’t just about one mechanic in two games from the mid-2010s. It’s a pretty clean example of a problem that’s gotten worse across creative industries: ideas being owned not because the owner plans to use them, but just because ownership itself has value as a defensive asset.</p><p>Warner Bros. didn’t patent the Nemesis System because they had grand plans to license it and build an ecosystem around it. They did it to protect their game. That’s reasonable — you spend years developing something and you want protection. But the system wasn’t designed for what actually happened, which is the creator getting shut down, the successor projects dying, and the patent just… continuing to run, blocking everyone, serving no one.</p><p>The idea that an innovation can be legally frozen for two decades while the company that owns it actively does nothing with it — that should bother people more than it does. This particular case has a somewhat happy potential ending because Netflix has actual gaming ambitions. But there are plenty of patents sitting in portfolios for things that will just never see the light of day, and nobody’s writing Reddit posts about those.</p><h3>So, Netflix — What’s It Going to Be?</h3><p>The deal still has to clear regulators in a bunch of jurisdictions. Nothing is final yet. But when it is, Netflix will wake up one morning as the owner of a patent that the developer community has been frustrated about for the better part of a decade.</p><p>They could do something genuinely good here. Not a PR move, not a calculated goodwill grab — just a straightforward decision that the Nemesis System is more valuable to the world as an open idea than as a locked asset. The mechanic already proved itself in two games. Let it prove itself in two hundred more.</p><p>Eight years is a long time for an idea to sit in a drawer. Here’s hoping someone finally opens it.</p><p><em>The Netflix–Warner Bros. Discovery acquisition was announced in late 2025 and is pending regulatory approval. The Nemesis System patent was filed by Warner Bros. in 2016 and remains active until 2036. You can read the full patent </em><a href="https://patents.google.com/patent/US20160279522A1/en"><em>here</em></a><em>.</em></p><p>Thank you for reading!<br>Leave a clap and follow if you like the article!</p><p>See you in next article until then <strong>Bye</strong>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5162245d69b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Noon Might Fix the Most Frustrating Part of Building Products]]></title>
            <link>https://medium.com/@harshitmadhav/why-noon-might-fix-the-most-frustrating-part-of-building-products-d779219f2069?source=rss-6545005e0bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d779219f2069</guid>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Harshit Agrawal]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 09:06:02 GMT</pubDate>
            <atom:updated>2026-04-10T09:14:40.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ea9UI2rKJxvSjCa3F3PIwQ.png" /></figure><p>If you’ve worked on any product, you already know this pain.</p><p>A designer shares a Figma file. It looks clean, polished, perfectly spaced. You open it, feel good about it, and think — okay, let’s build this.</p><p>Then you actually start building it.</p><p>Some spacing doesn’t make sense in practice. Interactions aren’t defined anywhere. Edge cases are missing. And a few things are just… not practical to implement the way they’re drawn.</p><p>By the time the feature ships, it’s close to the design. But not exactly the same. Never exactly the same.</p><p>Most teams just accept this. It’s part of the process.</p><p>But after looking at <a href="https://noon.design/">Noon</a>, it feels like someone is finally trying to fix this properly — not patch it, actually fix it.</p><p><strong>The real problem (that nobody talks about clearly)</strong></p><p>This isn’t about designers doing something wrong. It’s not about developers cutting corners either.</p><p>The tools are just disconnected from each other.</p><p>Design tools show static screens. Code deals with real behavior. So there’s always a translation step sitting in the middle:</p><p>Design → Interpretation → Code</p><p>And that “interpretation” part? That’s where things go sideways. Nobody officially owns it. It lives in Slack messages, in assumptions, in developers making judgment calls at midnight before a deadline.</p><p><strong>What Noon is actually trying to do</strong></p><p><a href="https://noon.design/">Noon</a> is trying to remove that translation layer.</p><p>Instead of designing static screens and handing them off, it’s built around components that behave more like real UI from the start. So instead of:</p><p><em>“Here’s what it should look like, go build it”</em></p><p>The idea becomes:</p><p><em>“This is already close to how it should work”</em></p><p>That’s a genuinely different way of thinking about the process. Not a small workflow change — a different starting point entirely.</p><p><strong>What stood out to me</strong></p><p><strong>It thinks in components, not screens.</strong></p><p>Most tools are still screen-based. You design Page A, Page B, Page C — and the developer figures out the rest. Noon feels more like it’s built around systems and reusable parts, which is actually how apps get built. You’re not designing one-off mockups. You’re designing pieces that fit together.</p><p><strong>Less guesswork for developers.</strong></p><p>Right now, a lot of frontend work is filling in gaps that the design never covered. What does the loading state look like? What happens when the list is empty? How does this animate? With Noon’s approach, more of these decisions get made earlier — before a developer has to invent an answer on the spot.</p><p>Fewer Slack messages like: <em>“Hey, what should happen here?”</em></p><p><strong>Design decisions made with real constraints in mind.</strong></p><p>Not in a “designers must learn to code” way. More like — when you design something in Noon, it’s already closer to how it will actually be built. The components reflect real implementation. Handoff becomes smoother because there’s less to hand off.</p><p><strong>Why this matters specifically for developers</strong></p><p>If you’ve worked in React or React Native, you know the pattern.</p><p>You rarely build screens from scratch. You build buttons, cards, lists, states — and combine them. That’s how the work actually happens.</p><p>But design files don’t always reflect that. They show screens. You have to look at a screen and mentally reverse-engineer the component structure behind it.</p><p>Noon seems to start from that component-first thinking. Which means the design file and the developer’s mental model are a lot closer together from day one.</p><p><strong>My honest take</strong></p><p>I don’t think Noon replaces existing tools overnight. There are still real questions on the table:</p><p>Will designers actually change how they work? Will teams trust this approach on large, complex products? Can it handle the messy reality of production apps?</p><p>Genuinely don’t know yet.</p><p>But the direction makes sense. Because the current workflow — design here, code there, translation somewhere in between — has been broken for a long time. We’ve just normalized it.</p><p><strong>What I like about where this is heading</strong></p><p>Less back-and-forth between design and dev. More clarity before development even starts. Better alignment on how things should actually behave — not just how they should look.</p><p>Even a 20–30% improvement in this handoff would save real time across every team building software.</p><p><strong>One last thought</strong></p><p>We’ve spent years improving frameworks, performance, developer tooling. The build side of products has never been better.</p><p>But the design-to-development gap has mostly stayed the same the whole time.</p><p><a href="https://noon.design/">Noon</a> is one of the few tools actually trying to close that gap — not make design prettier, not add another plugin to the handoff process, but fix the actual disconnect between how something is designed and how it gets built.</p><p>If it works, building products gets meaningfully less frustrating for everyone involved.</p><p>That’s worth watching.</p><p>Leave a clap if you like the article!</p><p>See you in next article until then Bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d779219f2069" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Unlock Website Speed Secrets: Partytown’s Web Worker Magic for Third-Party Scripts]]></title>
            <link>https://medium.com/@harshitmadhav/unlock-website-speed-secrets-partytowns-web-worker-magic-for-third-party-scripts-3c493779ad56?source=rss-6545005e0bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c493779ad56</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[webworker]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[partytown]]></category>
            <dc:creator><![CDATA[Harshit Agrawal]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 17:21:43 GMT</pubDate>
            <atom:updated>2025-10-07T17:48:35.952Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_VHVMB98lqfSfmgobO173A.png" /><figcaption>Partytown</figcaption></figure><h3>Keep your site fast, smooth, and SEO-friendly — even with analytics, ads, and embeds.</h3><p>Tired of slow pages caused by third-party scripts like Google Analytics or chat widgets? <br>Learn how <strong>Partytown</strong> moves them to Web Workers, boosting <strong>Core Web Vitals and overall page performance — without any code rewrites.</strong></p><p>Today, we will be talking about <strong>Partytown</strong> library.</p><h3>🧠 Imagine Your Website as a Party</h3><p>Your site’s main code is the <strong>host</strong>, making sure everything runs smoothly.<br> Then in come the <strong>third-party guests</strong> — analytics trackers, ad pixels, chat widgets — hogging the dance floor, blocking the view, and killing the vibe.</p><p><strong>Partytown</strong> acts as the smart bouncer — moving those guests into a side room <strong>(a Web Worker)</strong> so your party keeps grooving.</p><p>Let’s unpack how this works — in plain English.</p><h3>💣 The Speed Killer: How Third-Party Scripts Wreck Performance</h3><p>You’ve optimized every byte — compressed images, deferred scripts, efficient caching.<br> Then you add Google Analytics or a Facebook pixel… and your Lighthouse scores nosedive.</p><p><strong>Why?</strong></p><ul><li>These scripts run on the <strong>main thread</strong>, competing with your own code for CPU time.</li><li>Rendering gets blocked.</li><li>Interactions lag.</li><li>Core Web Vitals (LCP, FID, CLS) drop.</li></ul><p>📉 Over <strong>70% of websites</strong> experience slowdowns caused by heavy third-party scripts.</p><h3>⚡ What Partytown Does — and Why You Need It</h3><p><strong>Partytown</strong> (from the creators of <strong>Qwik</strong>) is an open-source library that runs third-party scripts <strong>in a Web Worker</strong> — the browser’s background thread.</p><p>It <strong>mimics the DOM and window environment</strong> inside the worker, so scripts “think” they’re on the main page but actually run in isolation.</p><h3>🧩 Key Benefits</h3><ul><li>⚡ <strong>Faster load times:</strong> Reduces main-thread blocking by 20–50%.</li><li>🖱️ <strong>Instant interactivity:</strong> Keeps clicks and scrolls buttery smooth.</li><li>📈 <strong>Improved Core Web Vitals:</strong> Better LCP, CLS, and FID — indirectly boosting SEO.</li><li>🪶 <strong>Zero rewrites:</strong> Just tag existing scripts; no refactor needed.</li><li>🔒 <strong>Safe &amp; small:</strong> ~5 KB and MIT-licensed, works in 98% of browsers.</li></ul><h3>🧠 How It Works — The Simple Version</h3><p>Think of it as a <strong>tunnel</strong> between your page and a worker thread.</p><ol><li><strong>Install Partytown (via yarn or npm)</strong></li></ol><pre>npm install @qwik.dev/partytown</pre><p>or use the CDN snippet.</p><p>2. <strong>Mark third-party scripts</strong></p><pre>&lt;script type=&quot;text/partytown&quot; async src=&quot;https://www.googletagmanager.com/gtag/js?id=GA_ID&quot;&gt;&lt;/script&gt;</pre><p>Any script tagged this way runs in the worker instead of the main thread.</p><p>3. <strong>Proxy Communication</strong></p><ul><li>Partytown proxies DOM access and network calls using postMessage.</li><li>Scripts <em>believe</em> they’re manipulating the main page — but can’t block rendering.</li></ul><p>4. <strong>Performance Tweaks</strong></p><ul><li>Batches DOM reads/writes.</li><li>Throttles heavy calls.</li><li>Handles legacy quirks like document.write() safely.</li></ul><p><strong>Result:</strong> your third-party scripts keep running, but your UI stays silky smooth.</p><h3>🧪 Real Example — Moving Google Analytics Off the Main Thread</h3><p><strong>Before (Main-Thread Blocking):</strong></p><pre>&lt;script async src=&quot;https://www.googletagmanager.com/gtag/js?id=GA_ID&quot;&gt;&lt;/script&gt;<br>&lt;script&gt;<br>  window.dataLayer = window.dataLayer || [];<br>  function gtag(){dataLayer.push(arguments);}<br>  gtag(&#39;js&#39;, new Date());<br>  gtag(&#39;config&#39;, &#39;GA_ID&#39;);<br>&lt;/script&gt;</pre><p><strong>After (Worker-Powered Bliss):</strong></p><pre>&lt;script type=&quot;text/partytown&quot; async src=&quot;https://www.googletagmanager.com/gtag/js?id=GA_ID&quot;&gt;&lt;/script&gt;<br>&lt;script&gt;<br>  window.dataLayer = window.dataLayer || [];<br>  function gtag(){dataLayer.push(arguments);}<br>  gtag(&#39;js&#39;, new Date());<br>  gtag(&#39;config&#39;, &#39;GA_ID&#39;);<br>&lt;/script&gt;</pre><p>✅ Now, Reload your page, run a Lighthouse audit, and watch your <strong>LCP</strong> and <strong>FID</strong> scores climb.</p><p><strong>Framework support? </strong>It’s plug-and-play<br>or <strong>Next.js</strong>, <strong>Gatsby</strong>, <strong>Vite</strong>, and more.</p><p>🏆 Real-World Wins and Honest Limits</p><h3>📈 Success Stories</h3><ul><li>Blogs dropping <strong>LCP below 1 second</strong>.</li><li>E-commerce sites cutting interactivity time by <strong>~30%</strong>.</li><li>Developers freeing CPU for critical app logic, improving retention.</li></ul><h3>⚠️ Know the Limits</h3><ul><li>Not all scripts are worker-friendly (especially those touching DOM directly).</li><li>Avoid using Partytown for <strong>core app logic</strong> — stick to analytics, ads, widgets, and embeds.</li><li>Legacy browsers (like IE11) aren’t supported.</li></ul><h3>🎉 The Takeaway: Keep the Party Going</h3><p>Third-party scripts don’t have to ruin your website’s vibe.</p><p>With <strong>Partytown</strong>, they still run — just <strong>somewhere smarter</strong> — freeing your main thread for what really matters: your app and your users.</p><p>👉 <strong>Try it now: </strong><a href="https://partytown.qwik.dev/">https://partytown.qwik.dev/</a></p><p>Github: <a href="https://github.com/QwikDev/partytown">https://github.com/QwikDev/partytown</a></p><p>💬 Got a slow script that’s killing performance? Drop it in the comments — let’s debug it together.</p><p><strong>Result:</strong> your third-party scripts keep running, but your UI stays silky smooth.</p><p><em>Drop a Clap if this article helped you. More tips incoming. 🚀</em></p><p>See you again in the next story!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c493779ad56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The End of pod install in React Native: A Simpler Path Forward]]></title>
            <link>https://javascript.plainenglish.io/the-end-of-pod-install-in-react-native-a-simpler-path-forward-27cd1e130be9?source=rss-6545005e0bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/27cd1e130be9</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[cocoapods]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Harshit Agrawal]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 20:02:03 GMT</pubDate>
            <atom:updated>2026-05-27T12:26:05.585Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_A4KqbBWUaIABrzxBbddlw.png" /><figcaption>End of cocoapods in react native</figcaption></figure><p>If you’ve been building iOS apps with React Native for a while, the command <strong><em>cd ios &amp;&amp; pod install</em></strong> is probably second nature. It’s been the backbone of managing native dependencies for iOS projects, a ritual we’ve all performed countless times. But in 2025, React Native is hitting a stop on this workflow, and you might have already seen this warning in your terminal:</p><blockquote><em>“Calling pod install directly is deprecated in React Native”</em></blockquote><p>This isn’t just a minor update — it’s a signal that React Native is evolving toward a smoother, more unified development experience. Don’t worry, though; this change is designed to make your life easier. Let’s dive into why pod install is being phased out, what you should use instead, and how this fits into the bigger picture of React Native in 2025.</p><h3>Why Is React Native Moving Away from pod install?</h3><p>The decision to deprecate pod install comes from React Native’s push to modernize and streamline its build process. Here’s the breakdown of why this shift is happening:</p><h3>1. Cross-Platform Unity</h3><p>CocoaPods, the dependency manager behind pod install, is specific to iOS. While it’s powerful, it creates a fragmented workflow when you’re building for both iOS and Android (or even web platforms). React Native’s goal is a seamless cross-platform experience, and relying on iOS-only tools doesn’t fit that vision. The team is leaning toward solutions that work across all platforms, reducing the need for platform-specific commands.</p><h3>2. The New Architecture Demands Efficiency</h3><p>React Native’s New Architecture — featuring TurboModules, Fabric, and the JavaScript Interface (JSI) — is all about performance and simplicity. These advancements make native modules faster and rendering smoother, but they don’t mesh well with manual processes like pod install. By automating dependency management, React Native eliminates extra steps, letting you focus on coding rather than build tinkering.</p><h3>3. Fewer Pain Points</h3><p>Let’s be real: CocoaPods can be a headache. From Podfile version conflicts to sluggish installations and cryptic Xcode errors, it’s caused plenty of frustration. Moving away from manual pod install calls reduces these issues, streamlining your setup and speeding up builds. With React Native 0.80 and later, precompiled binaries further cut down compile times, making your workflow feel like a breeze.</p><h3>What Should You Do Instead?</h3><p>The good news is that replacing pod install is straightforward, and the new commands are designed to be intuitive. Your approach depends on whether you’re using Expo or the React Native CLI.</p><h3>For Expo Users</h3><p>If you’re building with Expo, you’re already in the fast lane. Expo abstracts away native complexities, so you don’t need to touch CocoaPods. Just run:</p><pre>npx expo run:ios</pre><p>This command handles dependency installation, builds your app, and launches it — all in one go. With Expo SDK 54 (released August 2025), precompiled React Native binaries make builds even faster, especially for iOS. If you’re on an older SDK, upgrading will unlock these benefits.</p><h3>For React Native CLI Users</h3><p>If you’re working with a bare React Native project, you can swap out pod install for these commands:</p><pre>yarn ios<br># or<br>npx react-native run-ios</pre><p>These commands automatically manage iOS dependencies and kick off your build. Starting with React Native 0.80 (June 2025), they integrate precompiled dependency support, slashing build times. If you’re tweaking your Podfile for legacy reasons, you can enable prebuilt dependencies by adding <strong>ENV[‘RCT_USE_RN_DEP’] = ‘1’</strong> before your target block, as noted in the RN 0.80 docs.</p><h3>When Might You Still Need pod install?</h3><p>CocoaPods isn’t disappearing entirely yet. You might still need to run pod install manually in a few cases:</p><ul><li><strong>Debugging Native Issues</strong>: If you’re troubleshooting Xcode or CocoaPods-specific problems, you may need to run cd ios &amp;&amp; pod install.</li><li><strong>Legacy or Custom Modules</strong>: Some third-party libraries or custom native modules still rely on CocoaPods, especially if they haven’t been updated for the New Architecture.</li><li><strong>Older Projects</strong>: Maintaining a project on React Native versions before 0.70 may require sticking with pod install until you migrate.</li></ul><p>For legacy setups, the React Native 0.80 blog recommends using <strong>RCT_USE_RN_DEP=1 bundle exec pod install</strong> as a temporary bridge. Note that CocoaPods support is winding down, with new podspecs no longer accepted after December 2, 2026. Start planning your migration to Swift Package Manager (SPM) or other modern solutions.</p><h3>The Bigger Picture: React Native in 2025</h3><p>The pod install deprecation is part of a broader transformation in React Native, driven by performance, simplicity, and cross-platform consistency. Here’s what’s shaping the landscape:</p><h3>1. TurboModules and Fabric Are Here to Stay</h3><p>The New Architecture is no longer a beta feature — it’s the standard. TurboModules enable faster native module interactions, while Fabric delivers more efficient rendering. Both reduce the need for platform-specific tools like CocoaPods. React Native 0.80 (June 2025) marked the freeze of the legacy architecture, so upgrading is critical if you want to stay current.</p><h3>2. Expo’s Rise to Dominance</h3><p>Expo has become the go-to for many React Native developers, and for good reason. It simplifies native builds, hides platform-specific details, and integrates precompiled binaries for blazing-fast setups. Even bare React Native CLI projects are adopting Expo-like abstractions, blurring the lines between the two approaches.</p><h3>3. Swift Package Manager and Beyond</h3><p>CocoaPods is on its way out, with Swift Package Manager (SPM) emerging as a cross-platform-friendly alternative. SPM aligns with Apple’s ecosystem and works better with React Native’s cross-platform goals. Expect future React Native releases to lean heavily on SPM or new universal dependency managers, as hinted in the Expo blog (July 2025).</p><h3>4. Performance Boosts Across the Board</h3><p>React Native 0.81 (August 2025) brought Android 16 support, React 19.1 integration, and even faster iOS builds. Precompiled binaries, now standard in both Expo and CLI workflows, can cut build times by up to 10x in some cases. Tools like npx react-native doctor also make it easier to spot and fix setup issues.</p><h3>Your Next Steps: Embrace the Change</h3><p>Here’s how to adapt your workflow today:</p><ul><li><strong>Expo Users</strong>: Stick with npx expo run:ios. Upgrade to SDK 54 for the latest performance boosts.</li><li><strong>React Native CLI Users</strong>: Use yarn ios or npx react-native run-ios for all your builds. Add ENV[‘RCT_USE_RN_DEP’] = ‘1’ to your Podfile for precompiled dependencies if needed.</li><li><strong>Legacy Maintainers</strong>: Audit your dependencies for New Architecture compatibility. Use npx react-native doctor to identify migration blockers.</li></ul><h3>The Future Is Streamlined and Exciting</h3><p>Saying goodbye to pod install isn’t about losing an old friend — it’s about embracing a faster, more cohesive React Native ecosystem. Fewer Podfile conflicts, quicker builds, and a workflow that treats iOS and Android as equals are just around the corner. The React Native team, alongside Expo and the community, is paving the way for a development experience that’s less about fighting build tools and more about building great apps.</p><p>So, the next time you’re tempted to type cd ios &amp;&amp; pod install, take a deep breath and try the new commands. You’ll wonder why you didn’t switch sooner. Got questions or migration tips to share? Drop them in the comments — let’s navigate this new era together!</p><p>If you liked the article, please follow and drop a clap to stay updated with the latest updates!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27cd1e130be9" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/the-end-of-pod-install-in-react-native-a-simpler-path-forward-27cd1e130be9">The End of pod install in React Native: A Simpler Path Forward</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Fuzzy Search in React Native Apps Using Fuse.js]]></title>
            <link>https://medium.com/@harshitmadhav/implementing-fuzzy-search-in-react-native-apps-using-fuse-js-d33ed8710eba?source=rss-6545005e0bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d33ed8710eba</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[react-native-tutorial]]></category>
            <dc:creator><![CDATA[Harshit Agrawal]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 19:46:08 GMT</pubDate>
            <atom:updated>2025-09-02T19:46:08.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*LiHfERxvtFpv9f_fMnWGvw.png" /></figure><p>Building a search feature in a React Native app can make or break the user experience, especially when users expect fast, forgiving results despite typos or partial queries. Fuse.js is my go-to library for client-side fuzzy search — it’s lightweight, flexible, and perfect for mobile apps. In my own projects, like a recipe app with a searchable ingredient list, Fuse.js has been a lifesaver for handling messy user input.</p><p>In this guide, we’ll build an optimized, searchable list of fruits in React Native using Fuse.js. I’ve refined the code from my earlier experiments to be more performant by reducing re-renders, debouncing input, and keeping things modular. The result is smooth, even on low-end devices, and the code is ready to copy-paste into your Expo or bare React Native project. Let’s get to it!</p><h3>Prerequisites</h3><p>You’ll need:</p><ul><li>A React Native project (I’m using Expo for simplicity, but this works with bare React Native too).</li><li>Node.js and npm/yarn installed.</li><li>Familiarity with React Native components (TextInput, FlatList) and hooks (useState, useMemo, useCallback).</li></ul><p>To start fresh, run npx create-expo-app FuseSearchDemo, then cd FuseSearchDemo and start with npx expo start.</p><h3>Step 1: Install Dependencies</h3><p>We need Fuse.js for fuzzy search and lodash.debounce for debouncing the input. Run:</p><pre>npm install fuse.js lodash.debounce</pre><p>Or with yarn:</p><pre>yarn add fuse.js lodash.debounce</pre><p>Fuse.js handles the fuzzy matching, and lodash.debounce prevents excessive searches during rapid typing.</p><h3>Step 2: Set Up the Data</h3><p>We’ll search through a list of fruit objects, each with an ID, name, and description. Here’s the dataset:</p><pre>const fruits = [<br>  { id: &#39;1&#39;, name: &#39;Apple&#39;, description: &#39;Red and juicy fruit&#39; },<br>  { id: &#39;2&#39;, name: &#39;Banana&#39;, description: &#39;Yellow curved fruit&#39; },<br>  { id: &#39;3&#39;, name: &#39;Cherry&#39;, description: &#39;Small red stone fruit&#39; },<br>  { id: &#39;4&#39;, name: &#39;Date&#39;, description: &#39;Sweet dried fruit&#39; },<br>  { id: &#39;5&#39;, name: &#39;Elderberry&#39;, description: &#39;Tiny dark berries&#39; },<br>  { id: &#39;6&#39;, name: &#39;Fig&#39;, description: &#39;Soft fruit with seeds&#39; },<br>  { id: &#39;7&#39;, name: &#39;Grape&#39;, description: &#39;Small juicy clusters&#39; },<br>];</pre><p>This is a small dataset for demo purposes, but Fuse.js can handle thousands of items efficiently.</p><h3>Step 3: Initialize Fuse.js with useMemo</h3><p>To avoid re-creating the Fuse instance on every render (which is costly for larger datasets), we’ll use useMemo. We also configure Fuse to search the name and description fields with a reasonable threshold for fuzzy matching.</p><p>Here’s how it fits into the component:</p><pre>import React, { useState, useMemo, useCallback } from &#39;react&#39;;<br>import { View, TextInput, FlatList, Text, StyleSheet } from &#39;react-native&#39;;<br>import Fuse from &#39;fuse.js&#39;;<br>import debounce from &#39;lodash.debounce&#39;;<br><br>const options = {<br>  keys: [&#39;name&#39;, &#39;description&#39;],<br>  threshold: 0.3, // 0.0 = exact match, 1.0 = very loose<br>};<br>export default function App() {<br>  const [query, setQuery] = useState(&#39;&#39;);<br>  const [results, setResults] = useState(fruits);<br>  // Memoize Fuse instance to prevent re-creation<br>  const fuse = useMemo(() =&gt; new Fuse(fruits, options), []);</pre><ul><li>options.keys: Searches the name and description fields.</li><li>threshold: 0.3: Balances accuracy and flexibility — tweak this if you need stricter or looser matches.</li><li>useMemo: Ensures the Fuse instance is created only once, unless fruits changes.</li></ul><h3>Step 4: Implement Debounced Search</h3><p>To optimize performance, we debounce the search so it runs only after the user stops typing for 300ms. We also use useCallback to memoize the search handler, preventing unnecessary re-renders of the TextInput.</p><p>Add this to your component:</p><pre>// Debounced search handler<br>  const handleSearch = useCallback(<br>    debounce((text) =&gt; {<br>      setQuery(text);<br>      if (text) {<br>        const searchResults = fuse.search(text);<br>        setResults(searchResults.map((result) =&gt; result.item));<br>      } else {<br>        setResults(fruits);<br>      }<br>    }, 300),<br>    [fuse]<br>  );</pre><ul><li>debounce: Waits 300ms before running the search, reducing the number of searches during rapid typing.</li><li>useCallback: Ensures handleSearch isn’t re-created unless fuse changes, keeping TextInput performant.</li></ul><h3>Step 5: Build the UI</h3><p>We’ll use a TextInput for the search bar and a FlatList to display results. If no results are found, we show a friendly message. Here’s the JSX:</p><pre>return (<br>    &lt;View style={styles.container}&gt;<br>      &lt;TextInput<br>        style={styles.input}<br>        placeholder=&quot;Search fruits...&quot;<br>        value={query}<br>        onChangeText={handleSearch}<br>      /&gt;<br>      {results.length === 0 &amp;&amp; query ? (<br>        &lt;Text style={styles.noResults}&gt;No fruits found!&lt;/Text&gt;<br>      ) : (<br>        &lt;FlatList<br>          data={results}<br>          keyExtractor={(item) =&gt; item.id}<br>          renderItem={({ item }) =&gt; (<br>            &lt;View style={styles.item}&gt;<br>              &lt;Text style={styles.name}&gt;{item.name}&lt;/Text&gt;<br>              &lt;Text&gt;{item.description}&lt;/Text&gt;<br>            &lt;/View&gt;<br>          )}<br>        /&gt;<br>      )}<br>    &lt;/View&gt;<br>  );<br>}</pre><ul><li>The results.length === 0 &amp;&amp; query check ensures we only show “No fruits found!” when there’s a query but no matches.</li><li>keyExtractor uses id for efficient list rendering.</li></ul><h3>Step 6: Add Styles</h3><p>These styles keep the UI clean and responsive:</p><pre>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    padding: 20,<br>    backgroundColor: &#39;#fff&#39;,<br>  },<br>  input: {<br>    height: 40,<br>    borderColor: &#39;gray&#39;,<br>    borderWidth: 1,<br>    marginBottom: 10,<br>    paddingHorizontal: 10,<br>    borderRadius: 5,<br>  },<br>  item: {<br>    padding: 10,<br>    borderBottomWidth: 1,<br>    borderBottomColor: &#39;#eee&#39;,<br>  },<br>  name: {<br>    fontWeight: &#39;bold&#39;,<br>    fontSize: 16,<br>  },<br>  noResults: {<br>    textAlign: &#39;center&#39;,<br>    marginTop: 20,<br>    color: &#39;gray&#39;,<br>  },<br>});</pre><h3>Full Optimized Code</h3><p>Here’s the complete App.js, ready to run:</p><pre>import React, { useState, useMemo, useCallback } from &#39;react&#39;;<br>import { View, TextInput, FlatList, Text, StyleSheet } from &#39;react-native&#39;;<br>import Fuse from &#39;fuse.js&#39;;<br>import debounce from &#39;lodash.debounce&#39;;<br><br>const fruits = [<br>  { id: &#39;1&#39;, name: &#39;Apple&#39;, description: &#39;Red and juicy fruit&#39; },<br>  { id: &#39;2&#39;, name: &#39;Banana&#39;, description: &#39;Yellow curved fruit&#39; },<br>  { id: &#39;3&#39;, name: &#39;Cherry&#39;, description: &#39;Small red stone fruit&#39; },<br>  { id: &#39;4&#39;, name: &#39;Date&#39;, description: &#39;Sweet dried fruit&#39; },<br>  { id: &#39;5&#39;, name: &#39;Elderberry&#39;, description: &#39;Tiny dark berries&#39; },<br>  { id: &#39;6&#39;, name: &#39;Fig&#39;, description: &#39;Soft fruit with seeds&#39; },<br>  { id: &#39;7&#39;, name: &#39;Grape&#39;, description: &#39;Small juicy clusters&#39; },<br>];<br>const options = {<br>  keys: [&#39;name&#39;, &#39;description&#39;],<br>  threshold: 0.3,<br>};<br>export default function App() {<br>  const [query, setQuery] = useState(&#39;&#39;);<br>  const [results, setResults] = useState(fruits);<br>  // Memoize Fuse instance<br>  const fuse = useMemo(() =&gt; new Fuse(fruits, options), []);<br>  // Debounced search handler<br>  const handleSearch = useCallback(<br>    debounce((text) =&gt; {<br>      setQuery(text);<br>      if (text) {<br>        const searchResults = fuse.search(text);<br>        setResults(searchResults.map((result) =&gt; result.item));<br>      } else {<br>        setResults(fruits);<br>      }<br>    }, 300),<br>    [fuse]<br>  );<br>  return (<br>    &lt;View style={styles.container}&gt;<br>      &lt;TextInput<br>        style={styles.input}<br>        placeholder=&quot;Search fruits...&quot;<br>        value={query}<br>        onChangeText={handleSearch}<br>      /&gt;<br>      {results.length === 0 &amp;&amp; query ? (<br>        &lt;Text style={styles.noResults}&gt;No fruits found!&lt;/Text&gt;<br>      ) : (<br>        &lt;FlatList<br>          data={results}<br>          keyExtractor={(item) =&gt; item.id}<br>          renderItem={({ item }) =&gt; (<br>            &lt;View style={styles.item}&gt;<br>              &lt;Text style={styles.name}&gt;{item.name}&lt;/Text&gt;<br>              &lt;Text&gt;{item.description}&lt;/Text&gt;<br>            &lt;/View&gt;<br>          )}<br>        /&gt;<br>      )}<br>    &lt;/View&gt;<br>  );<br>}<br>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    padding: 20,<br>    backgroundColor: &#39;#fff&#39;,<br>  },<br>  input: {<br>    height: 40,<br>    borderColor: &#39;gray&#39;,<br>    borderWidth: 1,<br>    marginBottom: 10,<br>    paddingHorizontal: 10,<br>    borderRadius: 5,<br>  },<br>  item: {<br>    padding: 10,<br>    borderBottomWidth: 1,<br>    borderBottomColor: &#39;#eee&#39;,<br>  },<br>  name: {<br>    fontWeight: &#39;bold&#39;,<br>    fontSize: 16,<br>  },<br>  noResults: {<br>    textAlign: &#39;center&#39;,<br>    marginTop: 20,<br>    color: &#39;gray&#39;,<br>  },<br>});</pre><h3>Why This Is Optimized</h3><ul><li><strong>Performance</strong>: useMemo prevents re-indexing the dataset, and debouncing reduces search calls, saving CPU cycles on mobile devices.</li><li><strong>Re-render efficiency</strong>: useCallback ensures the TextInput doesn’t re-render unnecessarily.</li><li><strong>UX</strong>: The empty state message improves clarity for users.</li><li><strong>Maintainability</strong>: The code is concise, with clear separation of concerns (data, logic, UI).</li></ul><h3>Testing It Out</h3><p>Run npx expo start and test the app. Type “appl” to see “Apple”, or “juci” to match “Apple” and “Grape”. The debounce makes the UI feel snappy, even on slower devices. I’ve tested this on both iOS and Android emulators, and it’s rock-solid.</p><h3>Edge Cases and Tips</h3><ul><li><strong>Dynamic data</strong>: If fruits changes, update the useMemo dependency to [fruits] to re-index.</li><li><strong>Customizing results</strong>: Use fuse.search(text, { limit: 10 }) to cap results for large datasets.</li><li><strong>Highlighting matches</strong>: Add includeMatches: true in options to get match details for highlighting in the UI.</li><li><strong>Accessibility</strong>: Add accessibilityLabel to TextInput for screen readers, e.g., accessibilityLabel=”Search for fruits”.</li></ul><p>In my recipe example app, I used similar optimizations to handle 500+ ingredients without lag, even on older phones. Fuse.js scales well, but for millions of items, consider a backend like Elasticsearch.</p><h3>Wrapping Up</h3><p>This optimized Fuse.js search is fast, user-friendly, and easy to integrate into any React Native app. It’s been battle-tested in my projects and should drop right into yours. Try tweaking the threshold or adding more fields to search — Fuse.js is super flexible.</p><p>If you found this helpful, share it with your team or let me know your tweaks in the comments. Happy coding! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d33ed8710eba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ From Basics to Pro: Mastering Zustand in React Native]]></title>
            <link>https://medium.com/@harshitmadhav/from-basics-to-pro-mastering-zustand-in-react-native-7f372464d984?source=rss-6545005e0bc6------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f372464d984</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[zustand]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[state-management]]></category>
            <dc:creator><![CDATA[Harshit Agrawal]]></dc:creator>
            <pubDate>Sun, 24 Aug 2025 18:40:50 GMT</pubDate>
            <atom:updated>2026-04-21T19:02:33.384Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tIbp_XPx6tUpT9zn8Dyadg.png" /><figcaption>Master Zustand to Pro</figcaption></figure><p>State management is often the most challenging part of building React Native applications. While libraries like Redux or MobX have been industry standards, they often come with a steep learning curve or unnecessary boilerplate.</p><p>That’s where <strong>Zustand</strong> comes in.<br> It’s small, simple, and yet powerful enough to scale with your app. In this article, we’ll walk from <strong>basic usage to professional-level patterns</strong> of Zustand in React Native.</p><h3>🌱 Why Zustand?</h3><ul><li>✅ <strong>Minimal API</strong> — No reducers or actions</li><li>✅ <strong>Lightweight</strong> — Just a few KB in size</li><li>✅ <strong>Fast</strong> — Built on hooks, optimized for React</li><li>✅ <strong>Async actions support</strong> — No extra middleware required</li><li>✅ <strong>Persistence support</strong> — Works with AsyncStorage in RN</li><li>✅ <strong>Scalable</strong> — Modular stores for large apps</li></ul><h3>🟢 Step 1: Basic Store Setup</h3><p>Install Zustand:</p><pre>npm install zustand</pre><p>Using yarn<br>yarn add zustand</p><p>Create your first store useCounterStore.ts:</p><pre>import { create } from &#39;zustand&#39;;</pre><pre>type CounterState = {<br>  count: number;<br>  increase: () =&gt; void;<br>  decrease: () =&gt; void;<br>  reset: () =&gt; void;<br>};</pre><pre>export const useCounterStore = create&lt;CounterState&gt;((set) =&gt; ({<br>  count: 0,</pre><pre>  // actions are defined using set<br>  increase: () =&gt; set((state) =&gt; ({ count: state.count + 1 })),<br>  decrease: () =&gt; set((state) =&gt; ({ count: state.count - 1 })),<br>  reset: () =&gt; set({ count: 0 }),<br>}));</pre><p>Use it in a React Native component:</p><pre><br>const { count, increase } = useCounterStore();<br><br>return (<br>  &lt;View&gt;<br>    &lt;Text&gt;{count}&lt;/Text&gt;<br>    &lt;Button title=&quot;+&quot; onPress={increase} /&gt;<br>  &lt;/View&gt;<br>);</pre><p>✔️ Simple, readable, no boilerplate.</p><h3>🟡 Step 2: Optimize with Selectors</h3><p>Avoid subscribing to the entire store — instead, use <strong>selectors</strong> to prevent unnecessary re-renders.</p><pre>const count = useCounterStore((state) =&gt; state.count);<br>const increase = useCounterStore((state) =&gt; state.increase);</pre><p>👉 The component re-renders only when the selected state changes.</p><h3>🔵 Step 3: Async Actions (API Fetching)</h3><p>Zustand supports async actions naturally:</p><pre>type UserState = {<br>  users: any[];<br>  loading: boolean;<br>  fetchUsers: () =&gt; Promise&lt;void&gt;;<br>};</pre><pre>export const useUserStore = create&lt;UserState&gt;((set) =&gt; ({<br>  users: [],<br>  loading: false,<br>  fetchUsers: async () =&gt; {<br>    set({ loading: true });<br>    try {<br>      const res = await fetch(&#39;https://jsonplaceholder.typicode.com/users&#39;);<br>      const data = await res.json();<br>      set({ users: data });<br>    } finally {<br>      set({ loading: false });<br>    }<br>  },<br>}));</pre><p>Now you can simply call:</p><pre>const { users, fetchUsers } = useUserStore();<br>useEffect(() =&gt; { fetchUsers(); }, []);</pre><h3>🟣 Step 4: Persist State with AsyncStorage</h3><p>For authentication tokens or user preferences, use Zustand’s <strong>persist middleware</strong>:</p><pre>import { persist } from &#39;zustand/middleware&#39;;<br>import AsyncStorage from &#39;@react-native-async-storage/async-storage&#39;;</pre><pre>type AuthState = {<br>  token: string | null;<br>  setToken: (token: string) =&gt; void;<br>  clearToken: () =&gt; void;<br>};</pre><pre>export const useAuthStore = create&lt;AuthState&gt;()(<br>  persist(<br>    (set) =&gt; ({<br>      token: null,<br>      setToken: (token) =&gt; set({ token }),<br>      clearToken: () =&gt; set({ token: null }),<br>    }),<br>    { name: &#39;auth-storage&#39;, getStorage: () =&gt; AsyncStorage }<br>  )<br>);</pre><p>✔️ The token will survive app restarts automatically.</p><h3>🟠 Step 5: Modular Stores for Large Apps</h3><p>For scalability, split your stores by domain instead of one big global store:</p><pre>stores/<br> ┣ useAuthStore.ts<br> ┣ useUserStore.ts<br> ┣ useThemeStore.ts<br> ┗ useCartStore.ts</pre><p>This keeps your project organized and maintainable.</p><h3>🔴 Step 6: Advanced Features (Immer + DevTools)</h3><p>Zustand works with <strong>Immer</strong> for immutability and <strong>Redux DevTools</strong> for debugging.</p><pre>import { devtools, immer } from &#39;zustand/middleware&#39;;</pre><pre>type TodoState = {<br>  todos: string[];<br>  addTodo: (todo: string) =&gt; void;<br>};</pre><pre>export const useTodoStore = create&lt;TodoState&gt;()(<br>  devtools(<br>    immer((set) =&gt; ({<br>      todos: [],<br>      addTodo: (todo) =&gt;<br>        set((state) =&gt; {<br>          state.todos.push(todo);<br>        }),<br>    }))<br>  )<br>);</pre><p>✅ Now you can debug state transitions in <strong>Redux DevTools</strong> and enjoy clean immutable updates.</p><h3>💡 Pro Tips for Zustand in React Native</h3><ul><li>🎯 <strong>Always use selectors</strong> for performance</li><li>🗂 <strong>Split stores by domain</strong> for scalability</li><li>🔐 <strong>Encrypt sensitive data</strong> when persisting</li><li>⚡ <strong>Combine with React Query</strong> for server state, keep Zustand for app state</li><li>🧪 <strong>Test stores directly</strong> (they’re just functions)</li></ul><h3>✅ Conclusion</h3><p>Zustand strikes the perfect balance between <strong>simplicity and scalability</strong>.</p><ul><li>Beginners benefit from its minimal API.</li><li>Professionals appreciate persistence, modularity, and advanced middleware support.</li></ul><p>If Redux feels too heavy and Context API feels too limited, <strong>Zustand is the sweet spot for React Native state management</strong>.</p><p>Try it in your next project — you’ll likely never look back.</p><p><strong>Meta Description:</strong><br>Learn Zustand in React Native — from basic store setup to advanced patterns like async actions, persistence, modular stores, and DevTools integration.</p><p><strong>Tags:</strong><br> React Native, Zustand, State Management, Frontend Development, Mobile Apps, React</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f372464d984" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>