<?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 RanveerSequeira on Medium]]></title>
        <description><![CDATA[Stories by RanveerSequeira on Medium]]></description>
        <link>https://medium.com/@ranveersequeira?source=rss-851dc5d70bd7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DUNEC_YcMLRlZnYzTXGvlw.jpeg</url>
            <title>Stories by RanveerSequeira on Medium</title>
            <link>https://medium.com/@ranveersequeira?source=rss-851dc5d70bd7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 05:52:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ranveersequeira/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[ AI Agent Workflow]]></title>
            <link>https://ranveersequeira.medium.com/ai-agent-workflow-90f838eb036a?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/90f838eb036a</guid>
            <category><![CDATA[ai-workflow]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[gemini-cli]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Wed, 07 Jan 2026 18:26:15 GMT</pubDate>
            <atom:updated>2026-01-07T18:26:15.634Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Standardize your AI Development Workflow.</strong> ai-agent-workflow transforms your AI tools (Cursor, Claude, Gemini CLI, etc.) from generic chatbots into a <strong>structured Team of Specialists</strong> that live inside your repository.</p><h3>🎯 The Goal</h3><p>The package forces your AI agents to stop “guessing” and start following an engineered process. We inject specific <strong>Rules</strong> and <strong>System Prompts</strong> into your codebase to enforce a high-quality development loop:</p><ul><li><strong>Plan:</strong> Force the agent to understand requirements and edge cases before a single line of code is written.</li><li><strong>Architect:</strong> Explicitly define file structures and data flows.</li><li><strong>Execute:</strong> Ensure strict adherence to your project’s specific style guides and stack.</li><li><strong>Review:</strong> Mandatory verification steps to catch errors before you ever see the code.</li></ul><h3>🤖 The Team</h3><p>Once installed, your repository is “hired” a virtual team of specialized personas:</p><ul><li><strong>System Orchestrator:</strong> “The Boss.” Coordinates between agents and ensures the loop never breaks.</li><li><strong>Feature Planner:</strong> “The Architect.” Responsible for producing a detailed implementation_plan.md before coding begins.</li><li><strong>Specialists:</strong> Dedicated personas for <strong>Frontend</strong>, <strong>Backend</strong>, <strong>QA</strong>, and <strong>Reviewer</strong> to ensure domain-specific excellence.</li></ul><h3>🚀 Getting Started</h3><h4>1. Installation</h4><p>Navigate to your target repository and run the setup command:</p><p>Bash</p><pre>npx ai-agent-workflow</pre><p><strong>What this does:</strong></p><ul><li><strong>Detects your Tech Stack:</strong> Tailors instructions for your specific frameworks.</li><li><strong>Generates </strong><strong>GEMINI_GUIDE.md:</strong> A comprehensive manual for AI agents to follow.</li><li><strong>Installs Cursor Rules:</strong> Populates .cursor/rules/*.md to give Cursor-specific context.</li><li><strong>Configures System Prompts:</strong> Sets up .gemini/system.md for CLI-based agents.</li><li><strong>Installs </strong><strong>cleanup.sh:</strong> A one-click script to remove all agent configurations.</li></ul><h4>2. Usage</h4><ul><li><strong>With Gemini CLI:</strong> Run gemini &quot;Your task&quot;. The system prompt automatically triggers the <strong>Orchestrator</strong> persona.</li><li><strong>With Cursor:</strong> Simply start a chat or use Cmd+K. The .cursorrules files ensure the agents remain within the defined &quot;specialist&quot; roles.</li></ul><h3>🎥 Demo</h3><p>See how this workflow enforces discipline in real-time, using a YouTube analysis example:</p><p>👉 <a href="https://youtu.be/edfrS1skdcU?si=fXe5wBTqBercEtQx"><strong>Watch the Demo Video</strong></a></p><h3>🧹 Uninstallation</h3><p>If you want to remove all traces of the AI Agent Workflow from your repo, simply run:</p><p>Bash</p><pre>./cleanup.sh</pre><p><strong>Built for the Agentic Future.</strong> | <a href="https://www.npmjs.com/package/ai-agent-workflow">View on NPM</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90f838eb036a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Full-Stack Applications with Gemini CLI + tmux: A Repo-First Multi-Agent Workflow]]></title>
            <link>https://ranveersequeira.medium.com/building-full-stack-applications-with-gemini-cli-tmux-a-repo-first-multi-agent-workflow-27c082ea5d83?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/27c082ea5d83</guid>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[tmux]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[gemini-cli]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Wed, 07 Jan 2026 11:12:30 GMT</pubDate>
            <atom:updated>2026-01-07T11:19:19.329Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FFPjAs8YO6NY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFPjAs8YO6NY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFPjAs8YO6NY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/26634c3a8c654746baad4ad3c2385cb4/href">https://medium.com/media/26634c3a8c654746baad4ad3c2385cb4/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUNB4EYiQWMI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUNB4EYiQWMI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUNB4EYiQWMI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e917ee2eedd2b05f0e8c81f03e46a20f/href">https://medium.com/media/e917ee2eedd2b05f0e8c81f03e46a20f/href</a></iframe><p>Modern full-stack development rarely fails because of lack of tools.</p><p>It fails because <strong>*context is fragile*</strong>.</p><p>Frontend logic, backend constraints, database design, QA concerns, documentation, and reviews all compete for attention — and switching between them drains momentum.</p><p>I wanted a workflow where:</p><p>- Every repository defines <em>*how*</em> work gets done</p><p>- AI doesn’t guess — it follows structure</p><p>- Multiple concerns can progress in parallel</p><p>- The terminal becomes the command center</p><p>This post explains how I use <strong>Gemini CLI</strong>, <strong>tmux</strong>, and <strong>repo-scoped AI agents</strong> to build full-stack applications in a predictable, scalable way.</p><p>— -</p><p><strong>The Core Principle</strong></p><p>&gt; <strong>Each repository owns its AI behavior.</strong></p><p>Instead of relying on a global AI prompt or ad-hoc instructions, every repo contains a `gemini.md` file that defines:</p><p>- System rules and constraints</p><p>- Available agents and their responsibilities</p><p>- Task handoff rules</p><p>- Quality and review standards</p><p>The repository becomes a <strong>self-contained engineering system</strong>.</p><p>— -</p><p><strong>The Tooling Stack</strong></p><p>- Gemini CLI for agent execution</p><p>- tmux for persistent, parallel workflows</p><p>- Git as the versioned memory of decisions</p><p>- Markdown-defined agents, committed with the code</p><p>No dashboards.</p><p>No browser tabs.</p><p>Everything lives in the terminal and the repo.</p><p>— -</p><p><strong>Repository Structure</strong></p><p>```</p><p>.</p><p>├── gemini.md</p><p>├── README.md</p><p>└── gemini/</p><p>└── agents/</p><p>├── system-orchestrator.md</p><p>├── feature-planner.md</p><p>├── frontend-react-agent.md</p><p>├── backend-node-agent.md</p><p>├── database-mongodb-agent.md</p><p>├── qa-agent.md</p><p>├── review-agent.md</p><p>└── documentation-agent.md</p><p>```</p><p>Each file represents a <strong>single responsibility</strong>, mirroring how a real engineering team is organized.</p><p>— -</p><p><strong>Agent Responsibilities</strong></p><p>- <strong>System Orchestrator</strong>— routes work and enforces order</p><p>- <strong>Feature Planner</strong> — breaks requirements into executable tasks</p><p>- <strong>Frontend Agent</strong>— UI, components, and client-side logic</p><p>- <strong>Backend Agent</strong> — APIs, auth, and business rules</p><p>- <strong>Database Agent</strong> — schema design and data integrity</p><p>- <strong>QA Agent</strong>— edge cases and regression coverage</p><p>- <strong>Review Agent</strong> — quality and architecture checks</p><p>- <strong>Documentation Agent</strong>— keeps the repo understandable</p><p>— -</p><p><strong>Why This Works</strong></p><p>- AI behavior is <strong>version-controlled</strong></p><p>- Context never leaks across projects</p><p>- Parallel execution without chaos</p><p>- Architecture stays intentional</p><p>— -</p><p><strong>Final Thoughts</strong></p><p>AI works best when it is structured, bounded, and specialized.</p><p>By combining Gemini CLI, tmux, and a repo-first multi-agent design, the terminal becomes a scalable engineering system — not just a chat interface.</p><p>NOTE: Github REPO — <a href="https://github.com/ranveersequeira/gemini-cli-workflow/tree/main">https://github.com/ranveersequeira/gemini-cli-workflow/tree/main</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27c082ea5d83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zsh to Nushell: Like Upgrading from VS Code to Neovim, but for Shell Nerds.]]></title>
            <link>https://ranveersequeira.medium.com/from-zsh-to-nushell-like-upgrading-from-vs-code-to-neovim-but-for-shell-nerds-3b0149ac15b0?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b0149ac15b0</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[nushell]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Mon, 14 Apr 2025 18:14:27 GMT</pubDate>
            <atom:updated>2025-04-14T18:14:27.956Z</atom:updated>
            <content:encoded><![CDATA[<p>Like many developers, I’ve spent years in the terminal using <strong>Zsh</strong> with custom aliases, plugins, and tools like oh-my-zsh to make the experience feel modern and powerful.</p><p>But over time, I started to feel the friction: slow startup, plugin overhead, inconsistent output, and having to constantly rely on text manipulation tools like grep, awk, or sed to get anything useful.</p><p>That’s when I discovered <a href="https://www.nushell.sh/"><strong>Nushell</strong></a> — and I haven’t looked back since.</p><h3>💡 What Is Nushell?</h3><p><strong>Nushell (Nu)</strong> is a <strong>modern shell</strong> built from the ground up for today’s workflows. It reimagines the traditional shell environment with a focus on:</p><ul><li><strong>Structured data</strong>: Output is not just text — it’s tables, records, and lists.</li><li><strong>Query language-like syntax</strong>: Filtering and sorting are readable and powerful.</li><li><strong>Cross-platform support</strong>: It works across Linux, macOS, and Windows.</li><li><strong>Built-in plugins</strong>: For JSON, YAML, XML, SQLite, and more.</li></ul><p>It’s like having SQL + Bash + scripting + fast UX all wrapped into one terminal.</p><h3>🚩 Why I Switched from Zsh</h3><p>Zsh is fantastic — don’t get me wrong. But after using it for years, I wanted more:</p><h3>1. I wanted structure, not just strings</h3><p>Traditional shells treat everything as text. So if I want to filter files by size or creation date, I’m stuck writing awkward ls | grep | awk | sort pipelines.</p><p>In Nushell, I just do:</p><pre>ls | where size &gt; 1mb | sort-by size | reverse</pre><p>It’s readable. It’s powerful. It’s clean.</p><h3>2. I was tired of plugin bloat and slow startup</h3><p>Every time I opened a terminal, it felt like Zsh was dragging itself out of bed — especially with plugins like autosuggestions and syntax highlighting enabled.</p><p>Nushell? It’s fast. It opens instantly and just works.</p><h3>3. I wanted a better scripting and config experience</h3><p>Zsh scripting always felt like tiptoeing around edge cases. Nushell gives you Rust-style function definitions, proper error handling, and powerful pipes. It encourages good habits.</p><h3>🧰 How I Set Up Nushell on My Linux System</h3><h3>✅ 1. Install Nushell</h3><p>If you have Rust:</p><pre>cargo install nu</pre><p>Or use your system package manager:</p><pre>sudo snap install nushell     # On Ubuntu or Snap-supported distros</pre><p>Or:</p><pre>brew install nushell          # If using Homebrew on Linux</pre><h3>✅ 2. Set Nushell as Your Default Shell</h3><p>Add Nushell to your allowed shells list:</p><pre>which nu | sudo tee -a /etc/shells</pre><p>Then change your shell:</p><pre>chsh -s $(which nu)</pre><p>Log out and log back in. You’re now in Nu.</p><h3>🧪 My Current config.nu Setup</h3><p>My Nushell config is evolving every day as I replace old shell habits. Here’s what it looks like so far:</p><pre># Aliases<br>alias std = sudo shutdown now<br>alias rb = sudo reboot now<br>alias gg = lazygit<br>alias gcb = git checkout<br>alias re = do { npm run android; npm run start }<br>alias rmb = npm run android:build-apk<br>alias nr = npm run<br>alias rnt = detox test -c android.emu.debug</pre><pre># Hide the banner<br>$env.config.show_banner = false</pre><p>I also set up important paths:</p><pre># PNPM<br>$env.PNPM_HOME = ($nu.home-path | path join &quot;.local/share/pnpm&quot;)<br>$env.PATH = ($env.PATH | prepend [$env.PNPM_HOME])</pre><pre># Android SDK<br>$env.ANDROID_HOME = ($nu.home-path | path join &quot;Android/Sdk&quot;)<br>$env.PATH = ($env.PATH | prepend [<br>  ($env.ANDROID_HOME | path join &quot;platform-tools&quot;)<br>  ($env.ANDROID_HOME | path join &quot;emulator&quot;)<br>  ...<br>])</pre><pre># Volta<br>$env.VOLTA_HOME = ($nu.home-path | path join &quot;.volta&quot;)<br>$env.PATH = ($env.PATH | prepend [($env.VOLTA_HOME | path join &quot;bin&quot;)])</pre><h3>🤔 What About NVM?</h3><p>One hurdle I faced: <strong>NVM doesn’t work out-of-the-box</strong> in Nushell. It’s a Bash-based script that uses source, which isn’t supported in the same way in Nu.</p><p>I tried wrapping it like this:</p><pre>let NVM_DIR = ($nu.home-path | path join &quot;.nvm&quot;)<br># bash -c $&quot;source ($NVM_DIR)/nvm.sh &amp;&amp; nvm use&quot;</pre><p>It works to some extent, but it’s not ideal.</p><h3>✅ My workaround: Volta</h3><p>I moved to <a href="https://volta.sh/">Volta</a> for Node version management. It’s fast, shell-agnostic, and works beautifully in Nu:</p><pre>volta install node<br>volta install npm</pre><h3>🚀 The Nushell Experience (So Far)</h3><ul><li>✅ Cleaner syntax</li><li>✅ Faster response time</li><li>✅ Simpler environment setup</li><li>✅ Replaces 80% of grep, awk, sed usage</li><li>✅ Makes my terminal feel like a coding playground</li></ul><h3>🏁 Final Thoughts</h3><p>I didn’t just switch shells — I upgraded my terminal mindset.</p><p><strong>Nushell brings a new way to work with the command line.</strong> If you’re a developer, DevOps engineer, or power user who’s tired of juggling messy Bash hacks, Nushell gives you a smoother, smarter, and more structured way to do the same things — and a lot more.</p><p>Sure, it’s still evolving. But it’s <strong>fast</strong>, <strong>modern</strong>, and feels like the future.</p><h3>📌 Resources to Get Started:</h3><ul><li><a href="https://www.nushell.sh/book/">Nushell Docs</a></li><li><a href="https://www.nushell.sh/book/configuration.html">Config Reference</a></li><li><a href="https://github.com/nushell/nushell">Nushell GitHub</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b0149ac15b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resolving Bot Crawlers Redirect Issue in Next.js Middleware]]></title>
            <link>https://ranveersequeira.medium.com/resolving-bot-crawlers-redirect-issue-in-next-js-middleware-38bffa0291cf?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/38bffa0291cf</guid>
            <category><![CDATA[bột]]></category>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[middleware]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Thu, 16 Jan 2025 06:45:14 GMT</pubDate>
            <atom:updated>2025-01-16T06:45:14.896Z</atom:updated>
            <content:encoded><![CDATA[<h3>Issue</h3><p>In our Next.js application, we implemented a middleware logic to check for user authentication and language preference using cookies. If a user did not have a valid token or language set in their cookies, the middleware would redirect them to the root path (/) using:</p><pre>NextResponse.redirect(&quot;/&quot;);</pre><p>However, this implementation caused a critical issue: bot crawlers, including Googlebot, encountered the redirect, preventing them from indexing our site. Consequently, the website was not detected on Google Search Console.</p><h3>Solution</h3><p>To resolve this issue efficiently without refactoring the existing logic extensively, we enhanced the middleware by:</p><ol><li><strong>Extracting the User-Agent from Request Headers</strong>: Using request.headers, we identified if the incoming request was from a bot.</li><li><strong>Bypassing Redirects for Bots</strong>: If the User-Agent indicated that the request came from a bot, the middleware skipped the redirect logic entirely.</li></ol><h3>Updated Middleware Code</h3><p>Here is the updated middleware implementation:</p><pre>import { NextResponse } from &quot;next/server&quot;;</pre><pre>export function middleware(request) {<br>  const { cookies, headers } = request;<br>  const userAgent = headers.get(&quot;user-agent&quot;) || &quot;&quot;;</pre><pre>  // Check for bot user agents<br>  const isBot = /bot|crawler|spider|google|bing|yahoo/i.test(userAgent);</pre><pre>  // Skip redirect logic for bots<br>  if (isBot) {<br>    return NextResponse.next();<br>  }</pre><pre>  // Check for token and language cookies<br>  const token = cookies.get(&quot;token&quot;);<br>  const language = cookies.get(&quot;language&quot;);</pre><pre>  if (!token || !language) {<br>    // Redirect to root if cookies are missing<br>    return NextResponse.redirect(&quot;/&quot;);<br>  }</pre><pre>  return NextResponse.next();<br>}</pre><h3>Key Benefits</h3><ul><li><strong>Preserved Existing Logic</strong>: By conditionally bypassing the redirect for bots, we avoided extensive refactoring of the middleware.</li><li><strong>Improved SEO</strong>: Bot crawlers now access the site seamlessly, allowing proper indexing by search engines.</li><li><strong>Quick and Efficient Resolution</strong>: The solution was implemented with minimal overhead.</li></ul><h3>Additional Notes</h3><h3>How Next.js Middleware Works</h3><p>Middleware in Next.js enables you to execute logic before completing a request. It allows for:</p><ul><li>Modifying responses</li><li>Redirecting requests</li><li>Adding headers or cookies</li></ul><p>Middleware is defined in the middleware.js file in the root of your project. It runs on the Edge Runtime, ensuring low latency and high performance.</p><h3>Debugging Middleware Issues</h3><p>When debugging middleware logic, consider the following:</p><ol><li><strong>Log Requests and Headers</strong>: Use console.log(request.headers) to inspect incoming request details.</li><li><strong>Test in Development and Production</strong>: Middleware behavior can differ between local and deployed environments.</li><li><strong>Utilize Next.js Documentation</strong>: Refer to the official <a href="https://nextjs.org/docs/advanced-features/middleware">Next.js Middleware Documentation</a>.</li></ol><h3>User-Agent Parsing</h3><p>To handle User-Agent strings effectively:</p><ul><li>Use regular expressions to detect bot identifiers.</li><li>Leverage libraries like <a href="https://www.npmjs.com/package/user-agent-parser">user-agent-parser</a> for more robust parsing.</li></ul><h3>Sources</h3><ul><li><a href="https://nextjs.org/docs/advanced-features/middleware">Next.js Middleware Documentation</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent">User-Agent Parsing Best Practices</a></li><li><a href="https://developers.google.com/search/docs/crawling-indexing/overview">SEO and Bot Crawlers</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38bffa0291cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two way Data Binding vs One way Data Binding.]]></title>
            <link>https://ranveersequeira.medium.com/two-way-data-binding-vs-one-way-data-binding-67f3f97a5a05?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/67f3f97a5a05</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Sat, 16 Dec 2023 12:41:08 GMT</pubDate>
            <atom:updated>2023-12-16T12:46:48.619Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="htmx is better." src="https://cdn-images-1.medium.com/max/622/1*vL4Q9LXkrwHLuqgCvMLEOw.jpeg" /></figure><p>To understand this first we’ll need to learn about Model-View-Controller pattern(MVC). Let’s learn it while making pizza from ChatGPT.</p><p>The pizza-making process can be split into three parts:</p><ol><li><strong>The Chef (Model)</strong>: This is the person who decides what ingredients to use and how to put them together. They handle the dough, the sauce, the cheese, and all the toppings.</li><li><strong>The Table (View)</strong>: Think of this as the plate where the pizza ends up. It’s what you see and use to enjoy your pizza. The table doesn’t make the pizza; it just presents it to you in a nice way.</li><li><strong>The Server (Controller)</strong>: This person takes your order, tells the chef what you want, and brings the pizza to your table when it’s ready. They communicate between you (the person who wants the pizza) and the chef (who makes the pizza).</li></ol><p>So, in computer talk:</p><ul><li>The Chef is like the part of the computer program that works with data and does all the “cooking.” It’s where things happen and get prepared (like how the model manages data and business logic in the program).</li><li>The Table is what you see and interact with, just like how a web page or an app shows you information. It’s the part you can touch and use (like the view, which displays the data to the user).</li><li>The Server is the one who takes your requests and makes sure things get done. It’s the middle person that connects what you see and what’s happening behind the scenes (like the controller, which manages user requests and interacts with both the model and the view).</li></ul><h3>Two-Way Data Binding:</h3><p>Imagine you’re at a pizza place where the <strong>chef</strong> and the <strong>server</strong> are connected by a magic phone. You (the customer) can call the <strong>server</strong> and tell them what kind of pizza you want, and the <strong>server</strong> relays this directly to the <strong>chef</strong>. But here’s the special part: if the <strong>chef</strong> changes the toppings or something about the pizza, the <strong>server</strong> immediately tells you about it, almost like the pizza talks back to you! So, if you wanted pepperoni and the <strong>chef</strong> decided to add mushrooms instead, the <strong>server</strong> would tell you about this change right away.</p><p>In computer terms, this is like a system where if the data (pizza order) changes in one place (chef), it automatically updates in another place (you, the customer), and vice versa. It’s a two-way communication where changes in the model (chef) immediately reflect in the view (you) and changes in the view also update the model.</p><h3>One-Way Data Binding:</h3><p>Now, let’s say you order a pizza through a <strong>waiter</strong>, and the <strong>waiter</strong> notes down your order but doesn’t tell you anything else until your pizza arrives. You’ve given your order, and you have to wait until it’s ready. Even if the chef changes something, you won’t know until the <strong>waiter</strong> brings your pizza to the table. There’s only one direction of communication — from you to the waiter and then from the waiter to the chef. You’re not constantly updated on the pizza’s progress.</p><p>In computing terms, this is like a system where data flows in one direction: from the <strong>model</strong> (chef) to the <strong>view</strong> (you) or from the view to the <strong>model</strong>, but not both simultaneously. Changes in the model update the <strong>view</strong>, but changes in the <strong>view</strong> don’t directly update the <strong>model</strong> in real-time; they usually go through a process or an action to make changes in the <strong>model</strong>.</p><p>So, in short:</p><ul><li><strong>Two-Way Binding </strong>is like a live conversation where changes in one place immediately affect the other.</li><li><strong>One-Way Binding </strong>is like giving an order and waiting for it to be fulfilled without constant updates on its progress.</li></ul><p><strong>Lets get into boring stuff.( i don’t know angular)</strong></p><h4>Angular (Two-Way Data Binding):</h4><pre>import { Component } from &#39;@angular/core&#39;;<br><br>@Component({<br>  selector: &#39;pizza-form&#39;,<br>  template: `<br>    &lt;input [(ngModel)]=&quot;pizzaTopping&quot; placeholder=&quot;Enter Topping&quot;&gt;<br>    &lt;p&gt;You ordered: {{ pizzaTopping }}&lt;/p&gt;<br>  `<br>})<br>export class PizzaFormComponent {<br>  pizzaTopping: string = &#39;&#39;;<br>}</pre><p>In this Angular example, [(ngModel)] is used for two-way binding. When you type in the input field, the value automatically updates in the pizzaTopping variable. Similarly, if pizzaTopping changes elsewhere in the code, the input field is updated too. It&#39;s like a live connection where changes in the input field immediately update the variable and vice versa.</p><h4>React (One-Way Data Binding):</h4><pre>import React, { useState } from &#39;react&#39;;<br><br>function PizzaForm() {<br>  const [pizzaTopping, setPizzaTopping] = useState(&#39;&#39;);<br><br>  const handleInputChange = (e) =&gt; {<br>    setPizzaTopping(e.target.value);<br>  };<br><br>  return (<br>    &lt;div&gt;<br>      &lt;input<br>        value={pizzaTopping}<br>        onChange={handleInputChange}<br>        placeholder=&quot;Enter Topping&quot;<br>      /&gt;<br>      &lt;p&gt;You ordered: {pizzaTopping}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>In React, the input field value is controlled by value={pizzaTopping} and updates are managed by the onChange event. Changes in the input field trigger the handleInputChange function, updating the pizzaTopping state. However, this change doesn&#39;t directly reflect back to the input field. Instead, it follows a one-way flow: from the input to the state and then to the UI.</p><p>Angular’s two-way binding allows direct synchronization between the model (data) and the view (UI), while React opts for a more controlled one-way data flow, where data changes trigger updates but don’t automatically propagate back to the source.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67f3f97a5a05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning Rust: Understanding Zero-Cost Abstraction with Filter and Map]]></title>
            <link>https://ranveersequeira.medium.com/learning-rust-understanding-zero-cost-abstraction-with-filter-and-map-e967d09fff79?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/e967d09fff79</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[abstraction]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Tue, 23 May 2023 09:14:52 GMT</pubDate>
            <atom:updated>2023-07-02T09:38:07.000Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong>: As a programming language enthusiast, I’ve recently embarked on a journey to learn Rust — a powerful systems programming language known for its focus on safety, concurrency, and performance. One of the key features that sets Rust apart is its zero-cost abstraction, which allows developers to write high-level code without sacrificing performance. In this blog post, we will explore how Rust’s iterators, particularly the filter and map methods, exemplify zero-cost abstraction and compare them to their counterparts in JavaScript.</p><ol><li>Understanding Zero-Cost Abstraction: Zero-cost abstraction is a principle in Rust that encourages developers to write code that is both high-level and efficient. It means that abstractions should not impose any additional runtime costs, enabling developers to express complex ideas without sacrificing performance. Rust achieves this through a combination of compile-time guarantees and careful design choices.</li></ol><p>2. JavaScript’s Array Methods: Filter and Map: In JavaScript, the filter and map methods are commonly used to transform and filter arrays. Let&#39;s take a look at how these methods work in JavaScript:</p><pre>//filter: The filter method creates a new array containing only the elements<br>// that satisfy a given condition. For example:<br><br>const numbers = [1, 2, 3, 4, 5];<br>const evenNumbers = numbers.filter((num) =&gt; num % 2 === 0);<br>console.log(evenNumbers); // Output: [2, 4]<br><br></pre><pre>//map: The map method creates a new array by applying a transformation <br>//function to each element of the original array. For example:<br><br>const numbers = [1, 2, 3, 4, 5];<br>const squaredNumbers = numbers.map((num) =&gt; num * num);<br>console.log(squaredNumbers); // Output: [1, 4, 9, 16, 25]</pre><p>3. Rust’s Iterator Trait and Zero-Cost Abstraction: In Rust, the equivalent functionality is provided by the Iterator trait and its associated methods. Rust&#39;s iterators allow for zero-cost abstractions by leveraging a combination of lazy evaluation and compile-time optimizations.</p><pre>//filter: In Rust, the filter method is used to create a new iterator that <br>//only yields elements satisfying a given predicate. Here&#39;s an example:<br><br>let numbers = vec![1, 2, 3, 4, 5];<br>let even_numbers: Vec&lt;_&gt; = numbers.into_iter().filter(|&amp;num| num % 2 == 0).collect();<br>println!(&quot;{:?}&quot;, even_numbers); // Output: [2, 4]</pre><pre>//map: The map method in Rust transforms each element of an iterator into <br>//a new value based on a provided closure. Here&#39;s an example:<br><br>let numbers = vec![1, 2, 3, 4, 5];<br>let squared_numbers: Vec&lt;_&gt; = numbers.into_iter().map(|num| num * num).collect();<br>println!(&quot;{:?}&quot;, squared_numbers); // Output: [1, 4, 9, 16, 25]</pre><p>4. Zero-Cost Abstraction in Action: To illustrate the zero-cost abstraction in Rust, let’s consider a scenario where we have a large collection of numbers and want to filter out the even numbers and square the remaining ones. Here’s how we can achieve this using Rust’s iterators:</p><pre>fn main() {<br>    let numbers = 1..=1000000;<br>    let result: Vec&lt;_&gt; = numbers.into_iter()<br>        .filter(|&amp;num| num % 2 == 0)<br>        .map(|num| num * num)<br>        .collect();<br><br>    // Print the first 10 squared even numbers<br>    println!(&quot;{:?}&quot;, &amp;result[..10]);<br>}</pre><p>In the above example, Rust’s zero-cost abstraction allows us to express complex operations on a large dataset without incurring any significant runtime performance penalties.</p><p>One important aspect to highlight when comparing the filter function in JavaScript and Rust is their approach to evaluation. JavaScript&#39;s filter function eagerly evaluates the callback function for each element of the array, regardless of whether the element satisfies the condition or not. This means that even if the array is large and only a few elements pass the filter, the callback function will still be called for every element.</p><p>In contrast, Rust’s iterators use lazy evaluation. When using the filter method in Rust, the callback function is only called for elements that satisfy the condition. This lazy evaluation mechanism allows Rust to optimize performance by avoiding unnecessary computations for elements that don&#39;t meet the filtering criteria.</p><p>This distinction in evaluation strategies showcases Rust’s zero-cost abstraction principle by eliminating unnecessary computations, especially when dealing with large collections. It ensures that the performance remains efficient without compromising on the expressive power of the code.</p><p>By employing lazy evaluation, Rust allows developers to write code that is both concise and performant, making it an excellent choice for applications that require high efficiency and scalability.</p><p>Conclusion: When comparing the filter function in JavaScript and Rust, it is crucial to consider the evaluation strategy employed by each language. JavaScript&#39;s eager evaluation may result in unnecessary computations for elements that don&#39;t pass the filter, whereas Rust&#39;s lazy evaluation optimizes performance by selectively invoking the callback function. Rust&#39;s approach aligns with its zero-cost abstraction principle, allowing developers to write high-level code without sacrificing performance, especially when dealing with large collections of data.</p><p>Understanding the evaluation strategies and their impact on performance empowers Rust developers to write efficient code, making the most of the language’s zero-cost abstractions and achieving optimal performance in their applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e967d09fff79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Data Binding.]]></title>
            <link>https://ranveersequeira.medium.com/understanding-data-binding-896fcd2e4d64?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/896fcd2e4d64</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[data-binding]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Wed, 26 Apr 2023 14:31:46 GMT</pubDate>
            <atom:updated>2023-04-26T14:31:46.448Z</atom:updated>
            <content:encoded><![CDATA[<p>Angular and React are two of the most popular front-end web development frameworks in use today. Both frameworks are designed to make it easier for developers to build complex and interactive user interfaces. However, they have different approaches to handling data binding, which is an essential aspect of building user interfaces.</p><p>Data binding refers to the way in which data is shared between the different components of a user interface. There are two types of data binding: one-way data binding and two-way data binding. In this blog, we will compare Angular and React’s approaches to both types of data binding.</p><p>One-way Data Binding</p><p>One-way data binding is when data flows in one direction, from the component to the view. Changes made to the data in the component will reflect in the view. However, changes made in the view will not reflect in the component. One-way data binding is useful when you want to display data that does not change frequently or when you want to keep your data layer separate from the view layer.</p><p>Angular</p><p>Angular has built-in support for one-way data binding. In Angular, data binding is achieved using the interpolation syntax, which uses double curly braces ({{ }}). Let’s take an example:</p><pre>import { Component } from &#39;@angular/core&#39;;<br>@Component({<br>  selector: &#39;app-root&#39;,<br>  template: `<br>    &lt;h1&gt;{{ message }}&lt;/h1&gt;<br>  `<br>})<br>export class AppComponent {<br>  message = &#39;Hello World&#39;;<br>}</pre><p>In the example above, we have an Angular component that uses interpolation to display a message in the view. The message variable is declared in the component and is bound to the view using the {{ }} syntax.</p><p>React</p><p>In React, one-way data binding is achieved by passing data from the parent component to the child component as props. The child component can read the data but cannot change it. Let’s take an example:</p><pre>import React from &#39;react&#39;;<br>function Message(props) {<br>  return &lt;h1&gt;{props.message}&lt;/h1&gt;;<br>}<br>function App() {<br>  return &lt;Message message=&quot;Hello World&quot; /&gt;;<br>}<br>export default App;</pre><p>In the example above, we have a React component that displays a message using a child component called Message. The message is passed to the child component as a prop, which is then used to display the message in the view.</p><p>Two-way Data Binding</p><p>Two-way data binding is when data flows in both directions, from the component to the view and from the view to the component. Changes made in the component will reflect in the view, and changes made in the view will reflect in the component. Two-way data binding is useful when you want to create interactive user interfaces that respond to user input.</p><p>Angular</p><p>Angular has built-in support for two-way data binding using the ngModel directive. The ngModel directive is used to bind a component property to an input field and update the property when the input field changes. Let&#39;s take an example:</p><pre>import { Component } from &#39;@angular/core&#39;;<br>@Component(<br>  selector: &#39;app-root&#39;,<br>  template: `<br>    &lt;input [(ngModel)]=&quot;message&quot; type=&quot;text&quot;&gt;<br>    &lt;h1&gt;{{ message }}&lt;/h1&gt;<br>  `<br>})<br>export class AppComponent {<br>  message = &#39;Hello World&#39;;<br>}</pre><p>In the example above, we have an Angular component that uses the ngModel directive to create a two-way data binding between an input field and a property called message. When the user types something into the input field, the message property is updated, and the view is automatically updated to reflect the new value.</p><p>React</p><p>In React, two-way data binding is achieved using controlled components. A controlled component is a component that takes its current value as a prop and notifies changes through callbacks. The parent component owns.</p><pre>import React, { useState } from &#39;react&#39;;<br><br>function App() {<br>  const [message, setMessage] = useState(&#39;Hello World&#39;);<br><br>  const handleChange = (event) =&gt; {<br>    setMessage(event.target.value);<br>  };<br><br>  return (<br>    &lt;div&gt;<br>      &lt;input type=&quot;text&quot; value={message} onChange={handleChange} /&gt;<br>      &lt;h1&gt;{message}&lt;/h1&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=896fcd2e4d64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing React Application Performance: From 30 Seconds to Under 5 Seconds]]></title>
            <link>https://ranveersequeira.medium.com/optimizing-react-application-performance-from-30-seconds-to-under-5-seconds-a6293e0e7530?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6293e0e7530</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-virtualized]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Tue, 25 Apr 2023 08:02:25 GMT</pubDate>
            <atom:updated>2023-04-25T08:27:34.380Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GR2qAPZsyWEbHndiG9YG2g.png" /><figcaption><strong>BEFORE</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uCrtY844OOJfqJ-UKPhxxQ.png" /><figcaption><strong>AFTER</strong></figcaption></figure><p>As a developer, optimizing application performance is one of the most important aspects of building high-quality applications. Recently, I worked on a React application that was taking 30 seconds to load, which was unacceptable for a modern web application. In this blog post, I will share my experience optimizing the application, which is now loading in under 5 seconds. I used React-virtualized to optimize the rendering of 3000 rows of data on a single page, which was a significant bottleneck.</p><p>Identifying the Problem</p><p>The application I was working on was a dashboard that displayed various user’s account. The dashboard retrieved data from an API, which then populated various tables on the screen.</p><h3>Using React-virtualized to Optimize Rendering</h3><p>The application also had a table that displayed 3000 rows of data, which was causing a significant slowdown in rendering. To solve this problem, I used React-virtualized, a library that optimizes the rendering of large lists by rendering only the rows that are visible on the screen.</p><p>React-virtualized uses a technique called “windowing,” which only renders the items that are visible in the viewport and dynamically renders additional items as the user scrolls. This technique dramatically improves the performance of the application, as it reduces the amount of data that needs to be rendered at once.</p><p>Implementing Code Splitting and Component Rendering Optimization</p><p>To further optimize the application, I implemented code splitting using React.lazy and React.Suspense, which allows the application to load only the necessary code for the current view and load additional code as needed. Additionally, I optimized the rendering of components by using React.memo and PureComponent to avoid unnecessary re-renders.</p><p>Results</p><p>After implementing these optimizations, the application now loads in under 5 seconds, which is a significant improvement over the initial 30 seconds. Using React-virtualized to optimize the rendering of 3000 rows of data on a single page was a critical step in achieving this result.</p><p>Conclusion</p><p>Optimizing React application performance is a continuous process, but it is also rewarding to see the improvements in performance. In this blog post, I shared my experience optimizing a React application that was taking 30 seconds to load, but now loads in under 5 seconds. By identifying the bottlenecks, using React-virtualized to optimize rendering, implementing code splitting and component rendering optimization, I was able to achieve a significant improvement in performance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6293e0e7530" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Error Boundries]]></title>
            <link>https://ranveersequeira.medium.com/react-error-boundries-93b0252005fa?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/93b0252005fa</guid>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[component-testing]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Wed, 21 Dec 2022 07:46:14 GMT</pubDate>
            <atom:updated>2022-12-21T07:46:14.688Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever started crying when your application failed in production due to some API data error or some unknown magic?</p><p>No?<br>Stop lying, I know you do.</p><p>Today we’re going to learn how we can fix it in our codebase or at least avoid it if you haven’t faced it yet.</p><p>You can wrap your component using this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9YlO5WRq8oi-qV9JT7kDg.png" /></figure><p>You might be thinking I can handle the same with React Suspense right?<br>React Suspense would allow you to pass fallback UI (component).<br>Check this video out for more clarification — <strong>Youtube Link</strong></p><p>If you have a more complex situation to handle you can checkout this repo—</p><p><a href="https://github.com/bvaughn/react-error-boundary">GitHub - bvaughn/react-error-boundary: Simple reusable React error boundary component</a></p><pre>//COPY THE CODE FROM HERE<br>class ErrorBoundary extends React.Component {<br>  constructor(props) {<br>    super(props);<br>    this.state = { hasError: false };<br>  }<br><br>  static getDerivedStateFromError(error) {<br>    return { hasError: true };<br>  }<br><br>  componentDidCatch(error, errorInfo) {<br>    console.log(&#39;something went horribly wrong&#39;, error, errorInfo);<br>  }<br><br>  render() {<br>    if (this.state.hasError) {<br>      return &lt;h1&gt;Fallback UI&lt;/h1&gt;;<br>    }<br><br>    return this.props.children;<br>  }<br>}<br><br>// Example Usage<br><br>function Main() {<br>  return (<br>    &lt;Dashboard&gt;<br>      &lt;ErrorBoundary&gt;<br>        &lt;Orders /&gt;<br>      &lt;/ErrorBoundary&gt;<br>    &lt;/Dashboard&gt;<br>  );<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93b0252005fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics of Advanced React Patterns.]]></title>
            <link>https://ranveersequeira.medium.com/basics-of-advanced-react-patterns-b64af91ff2dd?source=rss-851dc5d70bd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b64af91ff2dd</guid>
            <category><![CDATA[patterns]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[hooks]]></category>
            <dc:creator><![CDATA[RanveerSequeira]]></dc:creator>
            <pubDate>Wed, 23 Feb 2022 06:18:31 GMT</pubDate>
            <atom:updated>2022-02-23T06:18:31.407Z</atom:updated>
            <content:encoded><![CDATA[<p>I know title is kinda confusing.<br>Lemme explain!.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6C4nSvy2Woe0m7bWEn4BA.png" /></figure><blockquote>We can build components with our React skills. However, building highly reusable components creates nuanced problems.There are many different ways components can be consumed, and you want to be sure to give the consumers as much flexibility as possible.They must be able to extend the functionality and styles of the component as they deem fit. This is where advanced patterns come into the picture.</blockquote><ol><li><strong>Compound Components Pattern</strong></li><li><strong>Control Props</strong></li></ol><p>3. Learning More</p><h3>Compound Components Pattern.</h3><ul><li>The word <em>compound</em> refers to something that is composed of two or more separate elements.</li><li>With respect to React components, this could mean a component that is composed of two or more separate components.With compound components, there’s more. The separate components within which the main component is composed cannot be used without the parent.The main component is usually called the <strong>parent</strong>, and the separate composed components, <strong>children</strong>.</li></ul><p>Example — HTML &lt;select&gt; element analogous to a React compound component as it makes no sense to use the &lt;option&gt; ‘child’ element outside of &lt;select&gt;. The &lt;select&gt; element can contain one or more &lt;option&gt; child elements and the state of the entire component is managed by the parent, &lt;select&gt;.</p><p><a href="https://smalldev.tools/share-bin/8bqwTtee">SmallDev.tools - SmallDev.tools</a></p><h3><strong>Control Props</strong></h3><p>In React, we have controlled vs uncontrolled Elements.</p><p>Ex- &lt;input /&gt;is uncontrolled element and &lt;input value={someValue} onChange={someHandler} /&gt; is controlled element. In Simple words — A controlled input component has its value and onChange handler managed <strong>externally.</strong></p><p>In this control props pattern. We want the internally-managed state to be manageable from the outside via props!.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b64af91ff2dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>