<?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 Rutuja Pandule on Medium]]></title>
        <description><![CDATA[Stories by Rutuja Pandule on Medium]]></description>
        <link>https://medium.com/@rutuja.pandule?source=rss-dc11ef5b4029------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VS06HsxKfVAvjBCxmvji4Q.jpeg</url>
            <title>Stories by Rutuja Pandule on Medium</title>
            <link>https://medium.com/@rutuja.pandule?source=rss-dc11ef5b4029------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 14:53:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rutuja.pandule/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[Learning Optimizely CMS: Getting Started with Optimizely]]></title>
            <link>https://medium.com/@rutuja.pandule/learning-optimizely-cms-getting-started-with-optimizely-1fb98304521d?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fb98304521d</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[aspnetcore]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[optimizely]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 11:12:35 GMT</pubDate>
            <atom:updated>2026-09-24T11:12:35.755Z</atom:updated>
            <content:encoded><![CDATA[<p><em>My Optimizely CMS Learning Journey — Part 1</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1sV_RTSr5X6edlsA1-74w.png" /></figure><p>When I started working with <strong>Optimizely CMS</strong>, I had already worked with C#, HTML, CSS, and frontend concepts.</p><p>But Optimizely introduced a different way of thinking about a website.</p><p>Instead of developers creating every piece of content directly in code, Optimizely provides a <strong>Content Management System (CMS)</strong> where editors can create, manage, and publish website content while developers build the underlying structure and functionality.</p><p>So I decided to document my learning journey — starting from the basics and gradually moving toward pages, blocks, Razor views, CSS, JavaScript, and reusable components.</p><p>This is Part 1 of that journey.</p><h3>What is Optimizely CMS?</h3><p>Before understanding Optimizely, it helps to understand what a CMS actually does.</p><p>A traditional website could be built using static HTML files: index.html, about.html, contact.html</p><p>If the content needs to change, someone needs to modify the HTML files and deploy them again.</p><p>A CMS changes this approach.</p><p>According to Optimizely’s documentation, a CMS allows website content to be changed without changing the website’s code or files. Editors can create and update content through the CMS interface instead of directly modifying HTML.</p><p>Optimizely CMS is built on <strong>ASP.NET Core</strong>.</p><p>A simple way to think about it is:</p><pre>Developer<br>   │<br>   │ builds the structure<br>   ▼<br>Optimizely Application<br>   │<br>   │<br>   ├── Content Types<br>   ├── Pages<br>   ├── Blocks<br>   ├── Views<br>   └── Components<br>   │<br>   ▼<br>  CMS<br>   │<br>   │ editors manage content<br>   ▼<br>Website<br>   │<br>   ▼<br>Visitor</pre><h3>Why do we need a CMS?</h3><p>Imagine a company website with hundreds of pages.</p><p>Without a CMS, changing something as simple as a heading or an image could require a developer to modify code and deploy the website.</p><p>With a CMS, an authorized editor can make content changes through the CMS interface.</p><p>This creates a separation between:</p><p><strong>How the website works</strong></p><p>and</p><p><strong>What the website says.</strong></p><p>For example:</p><pre>Developer<br>   ↓<br>Defines:<br>&quot;What fields does an About page have?&quot;<br><br>Editor<br>   ↓<br>Provides:<br>&quot;What should the About page actually say?&quot;</pre><p>This separation is one of the concepts I want to understand properly throughout this series.</p><h3>Where can Optimizely be used?</h3><p>Optimizely CMS can be used for websites where content needs to be regularly created, edited, organized, and published.</p><p>Some common examples include:</p><h3>Corporate websites</h3><p>A company may have:</p><ul><li>About pages</li><li>Product pages</li><li>Contact pages</li><li>News</li><li>Articles</li><li>Landing pages</li></ul><h3>Marketing websites</h3><p>Marketing teams can manage:</p><ul><li>Campaign pages</li><li>Promotional content</li><li>Landing pages</li><li>Reusable content</li></ul><h3>Multi-language websites</h3><p>CMS platforms can also help organizations manage content across different languages and versions. Optimizely documentation lists globalization, version management, access control, and publishing workflows among CMS capabilities.</p><h3>Multiple digital experiences</h3><p>Depending on the Optimizely setup, content can support websites and other digital experiences. Current Optimizely CMS documentation also describes headless delivery, where content can be separated from the frontend and delivered through APIs.</p><p>So Optimizely isn’t simply:</p><blockquote><em>“A place where we write website text.”</em></blockquote><p>It provides a platform for <strong>managing structured digital content and delivering it to users</strong>.</p><h3>Developer vs Content Editor</h3><p>One of the first concepts I wanted to understand was:</p><blockquote><strong><em>What does the developer do, and what does the content editor do?</em></strong></blockquote><p>A simplified view is:</p><pre>OPTIMIZELY PROJECT<br><br>Developer                         Editor<br>   │                                │<br>   │                                │<br>   ▼                                ▼<br>C# Models                       CMS Interface<br>   │                                │<br>   ├── Page Types                   ├── Creates Pages<br>   ├── Block Types                  ├── Adds Content<br>   ├── Properties                   ├── Adds Images<br>   └── Rendering                    └── Publishes<br>   │                                │<br>   └──────────────┬─────────────────┘<br>                  ▼<br>               WEBSITE</pre><p>The developer creates the <strong>structure and functionality</strong>.</p><p>The editor works with the <strong>content</strong>.</p><p>Understanding this separation will become very important later when we get into page types and blocks.</p><h3>Exploring my Optimizely project</h3><p>After understanding what Optimizely is supposed to do, I wanted to understand the project itself.</p><p>My project currently has a structure similar to:</p><pre>optimizely-docker/<br>│<br>├── src/<br>│   │<br>│   ├── App_Data/<br>│   ├── Assets/<br>│   ├── bin/<br>│   │<br>│   ├── Business/<br>│   ├── Components/<br>│   ├── Controllers/<br>│   ├── Extensions/<br>│   ├── Helpers/<br>│   │<br>│   ├── Models/<br>│   ├── Resources/<br>│   ├── Views/<br>│   ├── wwwroot/<br>│   │<br>│   ├── appsettings.json<br>│   ├── Program.cs<br>│   ├── Startup.cs<br>│   └── OptimizelyCms.csproj<br>│<br>├── docker-compose.yml<br>├── Dockerfile<br>└── docker-entrypoint.</pre><p>At first, seeing all these folders can be a little overwhelming.</p><p>So instead of trying to understand everything at once, I started grouping them based on their purpose.</p><h3>The important folders</h3><h3>Models</h3><p>This is where the content models live.</p><p>In my project, I have:</p><pre>Models/<br>│<br>├── Pages/<br>├── Blocks/<br>└── ViewModels/</pre><p>This folder became particularly important during my learning because this is where I started seeing things such as:</p><pre>AboutPage<br>ContactPage<br>LandingPage<br>JumbotronBlock</pre><p>I’ll go into these in detail in later articles.</p><h3>Views</h3><p>This is where the Razor views live.</p><p>My project contains page views as well as block views.</p><p>For example:</p><pre>Views/<br>│<br>├── AboutPage/<br>├── LandingPage/<br>├── ProductPage/<br>├── StartPage/<br>│<br>└── Shared/<br>    └── Blocks/<br>        ├── JumbotronBlock.cshtml<br>        ├── TeaserBlock.cshtml<br>        ├── ButtonBlock.cshtml<br>        └── EditorialBlock.cshtml</pre><p>This is where the backend data eventually gets turned into HTML.</p><p>For example:</p><pre>C# Model<br>   ↓<br>Razor View<br>   ↓<br>HTML</pre><h3>Controllers</h3><p>This folder contains controllers used by the application.</p><p>Controllers are involved in handling requests and coordinating application logic.</p><p>I initially thought that every CMS page would require its own controller.</p><p>That turned out to be something I needed to understand more carefully — and I’ll cover routing and rendering in a later article.</p><h3>wwwroot</h3><p>This is the frontend/static asset side of the application.</p><p>This is where we can find things such as:</p><pre>CSS<br>JavaScript<br>Images<br>Other static assets</pre><p>This folder became especially interesting once I started learning how <strong>CSS and JavaScript connect to Optimizely components</strong>.</p><h3>Business</h3><p>This is where application/business-related logic can live.</p><p>Instead of putting everything inside page models or controllers, projects can organize reusable application logic here.</p><h3>Components</h3><p>This contains application components that don’t necessarily fit directly into the page/block model structure.</p><p>We’ll explore the actual components in the project as they become relevant.</p><h3>Resources</h3><p>This is commonly used for resources such as localization/translation files.</p><p>This becomes useful when working with multilingual websites.</p><h3>Program.cs and Startup.cs</h3><p>These are part of the application’s startup/configuration side.</p><p>They help configure and start the ASP.NET Core application and its services/middleware.</p><p>I don’t need to understand every line here immediately.</p><p>For now, I’m treating them as:</p><pre>Application startup<br>       ↓<br>Configure application<br>       ↓<br>Register services<br>       ↓<br>Run Optimizely application</pre><h3>My current mental map</h3><p>After exploring the project, this is how I’m currently looking at it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLC3GybnyHwLD03OB1vIhQ.png" /></figure><p>I’m intentionally <strong>not trying to understand every folder at once</strong>.</p><p>Instead, I’m following the flow of a real component:</p><pre>C# Model<br>   ↓<br>CMS<br>   ↓<br>Razor View<br>   ↓<br>HTML<br>   ↓<br>CSS<br>   ↓<br>JavaScript<br>   ↓<br>Browser</pre><p>That flow is going to be the foundation for the rest of my learning.</p><h3>What I want to learn next</h3><p>Now that I have a basic understanding of <strong>what Optimizely CMS is</strong> and <strong>how my project is structured</strong>, the next question is:</p><blockquote><strong><em>How do we actually create content in Optimizely?</em></strong></blockquote><p>That’s where <strong>Page Types, Content Types, and the CMS editor</strong> come in.</p><p>And that’s where my first real Optimizely experiment started.</p><h3>Series roadmap</h3><p><strong>Part 1 — Getting Started with Optimizely CMS</strong> ← <em>You are here</em></p><p><strong>Part 2 — Page Types, Content Types and GUIDs</strong></p><p><strong>Part 3 — Creating My First Page in Optimizely</strong></p><p><strong>Part 4 — How Optimizely Routing Works</strong></p><p><strong>Part 5 — Understanding Razor Views</strong></p><p><strong>Part 6 — My First Optimizely Block</strong></p><p><strong>Part 7 — Understanding Content Areas</strong></p><p><strong>Part 8 — How CSS Works with Optimizely Components</strong></p><p><strong>Part 9 — Adding JavaScript to Optimizely Components</strong></p><p><strong>Part 10 — Building a Complete Reusable Component</strong></p><blockquote><strong><em>This series is based on my own learning journey while working with an Optimizely CMS project. The goal isn’t to document every Optimizely feature, but to document the concepts that helped me understand how the pieces fit together.</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fb98304521d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Frontend Code Determines the Success of QA Automation]]></title>
            <link>https://blog.nonstopio.com/why-frontend-code-determines-the-success-of-qa-automation-c9502fd099a4?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9502fd099a4</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 07:39:17 GMT</pubDate>
            <atom:updated>2026-03-18T07:54:50.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rE2EdJy83WySG5dROv3ACw.png" /></figure><p>Frontend code quality is usually discussed in terms of <strong>performance, reusability, or maintainability</strong>. But in mature engineering teams, there’s another dimension that matters just as much: <strong>testability</strong>.</p><p>Testability isn’t just a QA concern. It’s a <strong>frontend engineering responsibility,</strong> and QA automation is often the most honest indicator of how well we’re doing.</p><p>When automation becomes flaky, slow, or difficult to maintain, teams often blame the testing framework, CI environment, or QA practices. But more often than not, the real problem lies in <strong>how the frontend was designed in the first place</strong>.</p><p>This article isn’t about generic testing tips. It’s about how <strong>frontend architecture decisions directly affect automation at scale</strong>.</p><h3>Automation Is a Consumer of Your Frontend API</h3><p>We usually think of APIs as backend concepts. But every frontend exposes an API too. That API is the <strong>DOM and the state transitions visible to a user</strong>.</p><p>QA automation consumes this API constantly:</p><ul><li>It has <strong>no visual intuition</strong></li><li>It has <strong>no tolerance for ambiguity</strong></li><li>It has <strong>no patience for an inconsistent state</strong></li></ul><p>If your frontend API is:</p><ul><li>implicit</li><li>unstable</li><li>tightly coupled to presentation</li></ul><p>Automation will struggle, not occasionally, but <strong>systematically</strong>.</p><p>Flaky tests are rarely random. They are usually a <strong>signal that the frontend contract is unclear</strong>.</p><h3>Testability Is a Feature, Not a QA Concern</h3><p>High-performing teams treat testability the same way they treat:</p><ul><li>performance</li><li>accessibility</li><li>security</li></ul><p>If a UI cannot be tested <strong>deterministically</strong>, it’s incomplete.</p><p>Shipping UI without clear testability guarantees creates <strong>automation debt, </strong>a form of technical debt that grows faster than most teams expect.</p><p>Common symptoms of testability debt include:</p><ul><li>increasing reliance on time-based waits</li><li>tests that pass locally but fail in CI</li><li>fear of refactoring UI components</li><li>gradual loss of trust in automation</li></ul><p>These aren’t testing problems.<br> They are <strong>frontend design problems</strong>.</p><h3>Where Frontend Architecture Breaks Automation</h3><h3>1. Visual-Driven DOM Design</h3><p>A common anti-pattern is designing the DOM purely around <strong>layout</strong>, not meaning.</p><p>Problematic pattern:</p><pre>&lt;div class=&quot;card&quot;&gt;<br>  &lt;div class=&quot;header&quot;&gt;Save&lt;/div&gt;<br>  &lt;div class=&quot;body&quot;&gt;<br>    &lt;div class=&quot;btn primary&quot;&gt;Submit&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Automation impact:</p><ul><li>Tests depend on CSS class names</li><li>DOM order becomes implicit logic</li><li>Minor style refactors break selectors</li></ul><p>A more testable approach:</p><pre>&lt;section role=&quot;region&quot; aria-label=&quot;user-actions&quot;&gt;<br>  &lt;button type=&quot;submit&quot; data-qa=&quot;submit-button&quot;&gt;Submit&lt;/button&gt;<br>&lt;/section&gt;</pre><p>The difference is subtle but important:</p><ul><li>semantic structure</li><li>stable selectors</li><li>presentation separated from intent</li></ul><h3>2. Implicit UI State</h3><p>Another common issue is when UI state exists only <strong>visually or through timing</strong>.</p><p>Problematic pattern:</p><pre>useEffect(() =&gt; {<br>  fetchData().then(setData);<br>}, []);<br><br>return &lt;Spinner /&gt;;</pre><p>Automation problem:</p><p>The UI never communicates when it’s <strong>actually ready</strong>.</p><p>Tests often end up relying on arbitrary waits.</p><p>A more explicit approach:</p><pre>const [status, setStatus] = useState(&#39;loading&#39;);<br>useEffect(() =&gt; {<br>  fetchData()<br>    .then(() =&gt; setStatus(&#39;ready&#39;))<br>    .catch(() =&gt; setStatus(&#39;error&#39;));<br>}, []);<br><br>if (status === &#39;loading&#39;) return &lt;Spinner data-qa=&quot;loading&quot; /&gt;;<br>if (status === &#39;error&#39;) return &lt;Error /&gt;;<br>return &lt;Content data-qa=&quot;content-ready&quot; /&gt;;</pre><p>This introduces a simple <strong>state machine</strong>.</p><p>Automation can now interact with the UI <strong>deterministically</strong> instead of guessing.</p><h3>3. Component Abstraction Leakage</h3><p>Reusable components sometimes hide <strong>side effects</strong>, which makes automation unpredictable.</p><p>Problematic example:</p><pre>function SaveButton() {<br>  useEffect(() =&gt; {<br>    trackAnalytics();<br>  });<br><br> return &lt;button&gt;Save&lt;/button&gt;;<br>}</pre><p>Automation issues:</p><ul><li>hidden side effects</li><li>unexpected re-renders</li><li>unclear component responsibility</li></ul><p>A clearer design:</p><pre>function SaveButton({ onClick }) {<br>  return (<br>    &lt;button data-qa=&quot;save-button&quot; onClick={onClick}&gt;<br>      Save<br>    &lt;/button&gt;<br>  );<br>}</pre><p>Usage:</p><pre>&lt;SaveButton onClick={() =&gt; {<br>  trackAnalytics();<br>  saveData();<br>}} /&gt;</pre><p>This keeps behaviour <strong>observable and predictable</strong>.</p><h3>Selectors Are a Contract, Not an Implementation Detail</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXq3AWJcDW4nuv2x_mYr6g.png" /></figure><p>A common anti-pattern is deriving selectors from styling.</p><p>Example:</p><pre>cy.get(&#39;.btn.primary&#39;).click();</pre><p>This breaks when:</p><ul><li>CSS modules change</li><li>The design system evolves</li><li>Classes are refactored</li></ul><p>A contract-based selector is far more stable:</p><pre>cy.get(&#39;[data-qa=&quot;submit-button&quot;]&#39;).click();</pre><p>Now selectors:</p><ul><li>survive refactors</li><li>communicate intent</li><li>reduce long-term maintenance</li></ul><h3>Flaky Tests Reveal Architectural Truths</h3><p>You’ll often see tests like this:</p><pre>cy.wait(3000);<br>cy.get(&#39;button&#39;).click();</pre><p>Why does this happen?</p><p>Because the UI <strong>never clearly signals readiness</strong>.</p><p>A state-driven approach is far more reliable:</p><pre>cy.get(&#39;[data-qa=&quot;content-ready&quot;]&#39;, { timeout: 10000 })<br>  .should(&#39;be.visible&#39;);<br>cy.get(&#39;[data-qa=&quot;submit-button&quot;]&#39;).click();</pre><p>This makes tests:</p><ul><li>event-driven</li><li>deterministic</li><li>significantly more stable</li></ul><h3>Why This Matters at Scale</h3><p>As products grow:</p><ul><li>UI surface area expands</li><li>Release frequency increases</li><li>Refactoring becomes inevitable</li></ul><p>Without a testable frontend design:</p><ul><li>Automation maintenance grows rapidly</li><li>CI pipelines lose credibility</li><li>Teams slow down despite shipping more code</li></ul><p>Good frontend practices don’t just help QA. They <strong>protect the team’s ability to move fast</strong>.</p><p>QA automation isn’t fragile by nature. It becomes fragile when frontend code <strong>hides intent, state, and contracts</strong>. When frontend engineers design UIs that are explicit about state, stable in structure, and predictable in behaviour, automation becomes boring.</p><blockquote>Here to make the community stronger by sharing our knowledge. Follow <a href="https://medium.com/@rutuja.pandule">me</a> and <a href="https://medium.com/nonstopio">my team</a> to stay updated on the latest and greatest in the web &amp; mobile tech world.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9502fd099a4" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/why-frontend-code-determines-the-success-of-qa-automation-c9502fd099a4">How Frontend Code Determines the Success of QA Automation</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Work on Multiple Branches Without Switching Context]]></title>
            <link>https://blog.nonstopio.com/work-on-multiple-branches-without-switching-context-d60cdd7a1922?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/d60cdd7a1922</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 12:03:55 GMT</pubDate>
            <atom:updated>2026-03-02T12:03:55.678Z</atom:updated>
            <content:encoded><![CDATA[<h4>git worktree</h4><h3>How Do Developers Work on Multiple Branches Without Context Switching?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_KLTQ79zeBYslR_s2swvg.png" /></figure><p>When working on real-world projects, developers often need to switch between branches frequently, such as to fix a bug in production, review a feature branch, or experiment with a new idea. Traditionally, this means constantly stashing changes, switching branches, and waiting for the project to rebuild.</p><p>This workflow can interrupt focus and reduce productivity.</p><p>There is a smarter way to handle multiple branches simultaneously without losing context or disrupting your current work.</p><h3>The Problem with Traditional Branch Switching</h3><p>Normally, if you want to move from one branch to another, you would:</p><ul><li>Commit or stash your current changes</li><li>Switch to another branch</li><li>Pull updates</li><li>Rebuild the project if necessary</li></ul><p>If you need to go back, repeat the process.</p><p>This becomes frustrating when:</p><ul><li>You are debugging production issues while developing a feature</li><li>You need to compare two branches side by side</li><li>You want to test something without disturbing your current progress</li></ul><h3>A Better Approach: Parallel Working Directories</h3><p>Instead of switching branches repeatedly in the same folder, you can create separate working directories for different branches.</p><p>Each directory contains:</p><ul><li>Its own working files</li><li>Its own checked-out branch</li><li>Independent uncommitted changes</li></ul><p>This means you can keep your feature branch open in one folder and your bug-fix branch open in another at the same time.</p><p>No stashing. No context switching. No disruption.</p><h3>How It Works</h3><p>You can create an additional working directory linked to the same repository. The new directory checks out a different branch while sharing the same underlying Git history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ouR608fE4fjZU4hTIvu68A.png" /></figure><p>Example:</p><pre># Create a new working directory for another branch<br><br>cd project-root<br>git worktree add ../project-feature feature-branch</pre><p>Now you will have:</p><ul><li>project-root → original branch</li><li>project-feature → feature-branch</li></ul><p>Both folders are independent from a working perspective.</p><p>You can open them in separate IDE windows and work simultaneously.</p><h3>Practical Use Case</h3><p>Imagine this situation:</p><ul><li>You are developing a new dashboard on feature/dashboard</li><li>Suddenly, a critical bug is reported on main</li></ul><p>Instead of:</p><ol><li>Stashing changes</li><li>Switching to the main</li><li>Fixing the issue</li><li>Switching back</li><li>Rebuilding everything</li></ol><p>You simply create another working directory for main, fix the bug there, commit, push, and continue your feature work uninterrupted.</p><p>This is especially powerful for:</p><ul><li>Large frontend builds</li><li>Backend services that take time to start</li><li>Microservice environments</li><li>Teams are doing parallel feature and hotfix work</li></ul><h3>Benefits</h3><h4>1. Zero Context Switching</h4><p>You don’t lose your mental flow by constantly jumping branches.</p><h4>2. Faster Productivity</h4><p>No repeated builds or dependency installations when switching.</p><h4>3. Cleaner Workflow</h4><p>No unnecessary stashing or temporary commits.</p><h4>4. Easy Comparison</h4><p>You can visually compare two branches in separate folders.</p><h3>Things to Keep in Mind</h3><ul><li>Each working directory consumes disk space.</li><li>You cannot check out the same branch in multiple working directories.</li><li>Clean up unused directories when done.</li></ul><p>To remove a working directory:</p><pre>git worktree remove ../project-feature</pre><h3>When Should You Use It?</h3><p>You should consider this approach when:</p><ul><li>Working on multiple features in parallel</li><li>Handling production hotfixes frequently</li><li>Reviewing pull requests locally</li><li>Testing experimental ideas without touching your main workspace</li></ul><h3>Conclusion</h3><p>Modern development requires flexibility. Instead of interrupting your workflow every time you need another branch, you can work on multiple branches in parallel — smoothly and efficiently.</p><p>This approach reduces friction, preserves focus, and makes branch management far more practical in real-world projects.</p><p>If you often switch branches multiple times a day, it might be time to upgrade your workflow.</p><blockquote><em>Here to make the community stronger by sharing our knowledge. Follow </em><a href="https://medium.com/@rutuja.pandule"><em>me</em></a><em> and </em><a href="https://medium.com/nonstopio"><em>my team</em></a><em> to stay updated on the latest and greatest in the web &amp; mobile tech world.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d60cdd7a1922" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/work-on-multiple-branches-without-switching-context-d60cdd7a1922">Work on Multiple Branches Without Switching Context</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplicity is the Beauty of Code]]></title>
            <link>https://blog.nonstopio.com/simplicity-is-the-beauty-of-code-7439569c4f33?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/7439569c4f33</guid>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[miscellaneous]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 09:00:17 GMT</pubDate>
            <atom:updated>2025-12-31T09:00:17.510Z</atom:updated>
            <content:encoded><![CDATA[<h4>Writing code shouldn’t be just logical; it should be empathetic.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFDz0iJ9sXgCvYE6C-GDKw.png" /></figure><p>I used to think good code meant smart code. The kind that makes you pause and think, Wow, this is clever.<br>The kind where logic twists a little, just enough to feel advanced.</p><p>But somewhere along the way, probably while staring at a file I didn’t write, I understood something quietly uncomfortable.</p><p><strong><em>If code needs explaining, it’s already failing.</em></strong></p><p>Sometimes you open files where nothing was technically wrong, yet everything felt heavy.<br>Too many conditions.<br>Too many abstractions.<br>Too many just-in-case decisions.</p><p>It worked. But it didn’t breathe. Reading it felt like walking through a room filled with furniture you don’t need. You can move, but never freely.</p><p><strong>That’s when I began to appreciate simple code.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*x22XLhZRkkf9e-iv-e-Y4Q.png" /></figure><p>Simplicity doesn’t mean less thinking. It means clear thinking.</p><p>It’s naming a function so well that comments become unnecessary.<br>It’s choosing readability over showing how much you know.<br>It’s writing logic that feels obvious, not because it’s trivial, but because it’s honest.</p><p>Simple code doesn’t try to impress. It tries to communicate.</p><p>The hardest part<br>Simplicity is rarely the first version.</p><p>The first version is usually messy, Emotional, and rushed.</p><p>Simplicity comes after rewriting.<br>After deleting.<br>After asking, do I really need this?</p><p>It takes confidence to remove code.<br>It takes maturity to say, this is enough.</p><p>There’s a difference between clever and simple. Clever code makes the writer feel good. Simple code makes everyone else feel safe.</p><p>When I write now, I think less about patterns and more about people.<br>The teammate who’ll debug this at 2 AM.<br>The future me who won’t remember what I was thinking.</p><p><strong>I’ve learned that beautiful code is quiet.</strong></p><p>It doesn’t demand attention.<br>It doesn’t show off.<br>It just works and lets you move on.</p><p>And maybe that’s what beauty really is.</p><p>Not complexity.<br>Not intelligence.</p><p>Just simplicity that respects the reader.</p><blockquote>Here to make the community stronger by sharing our knowledge. Follow <a href="https://medium.com/@rutuja.pandule">me</a> and <a href="https://medium.com/nonstopio">my team</a> to stay updated on the latest and greatest in the web &amp; mobile tech world.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7439569c4f33" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/simplicity-is-the-beauty-of-code-7439569c4f33">Simplicity is the Beauty of Code</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[useEffect vs TanStack Query: A Better Pattern for API Fetching]]></title>
            <link>https://blog.nonstopio.com/useeffect-vs-tanstack-query-a-better-pattern-for-api-fetching-d0fa0d4bbc0a?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0fa0d4bbc0a</guid>
            <category><![CDATA[tanstack-query]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Thu, 11 Dec 2025 05:54:44 GMT</pubDate>
            <atom:updated>2025-12-11T05:54:44.897Z</atom:updated>
            <content:encoded><![CDATA[<h4>The Cleanest Way to Fetch APIs in React</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VyFrhhwHVGp--OyfJjCLwQ.png" /></figure><p>Fetching APIs in React usually starts with useEffect, but it doesn’t take long before the pattern becomes repetitive and error-prone. Manual state tracking, cancellation issues, background updates, and handling all of that yourself quickly leads to cluttered components.</p><p>This is exactly the problem <a href="https://tanstack.com/query/latest"><strong><em>TanStack Query</em></strong></a><strong><em> </em></strong>was created to solve.<br> It offers a declarative, scalable, and incredibly clean way to manage API calls, caching, and server-state in React apps.</p><p>In this article, we’ll compare useEffect vs TanStack Query and show why TanStack Query is often the better pattern for modern React development.</p><h3>Why useEffect Can Get Messy for API Calls</h3><p>Using useEffect to fetch data often leads to <strong>boilerplate code</strong>:</p><pre>const [data, setData] = useState(null);<br>const [isLoading, setIsLoading] = useState(true);<br>const [error, setError] = useState(null);<br>useEffect(() =&gt; {<br>  let isMounted = true;<br><br>async function fetchData() {<br>    try {<br>      setIsLoading(true);<br>      const res = await fetch(&#39;/api/users&#39;);<br>      const json = await res.json();<br>      if (isMounted) setData(json);<br>    } catch (err) {<br>      if (isMounted) setError(err);<br>    } finally {<br>      if (isMounted) setIsLoading(false);<br>    }<br>  }<br>  fetchData();<br>  return () =&gt; {<br>    isMounted = false;<br>  };<br>}, []);</pre><p>It works, but it’s repetitive, hard to scale, and easy to make mistakes. You have to manually handle <strong>loading</strong>, <strong>errors</strong>, <strong>cleanup</strong>, <strong>retries</strong>, and more.</p><h3>Enter TanStack Query</h3><p>TanStack Query is a library <strong>designed explicitly for server-state management</strong>. It handles fetching, caching, updating, and syncing your data automatically.</p><p>With TanStack Query, the same logic becomes much cleaner:</p><pre>import { useQuery } from &#39;@tanstack/react-query&#39;;<br><br>function Users() {<br>  const { data, isLoading, error } = useQuery({<br>    queryKey: [&#39;users&#39;],<br>    queryFn: () =&gt; fetch(&#39;/api/users&#39;).then(res =&gt; res.json()),<br>  });<br>  if (isLoading) return &lt;p&gt;Loading...&lt;/p&gt;;<br>  if (error) return &lt;p&gt;Failed to load users&lt;/p&gt;;<br>  return &lt;UserList users={data} /&gt;;<br>}</pre><p>No manual loading states, no cleanup, and no dependency arrays. TanStack Query takes care of all of that for you.</p><h3>Why I Prefer TanStack Query</h3><p>Here are the features that make it a better choice than useEffect for API calls:</p><ul><li><strong>Caching:</strong> Data stays fresh and remains instantly available as you navigate between pages.</li><li><strong>Automatic background refetching:</strong> Your UI stays synced with the server.</li><li><strong>Retries on failure:</strong> Automatically handles failed requests.</li><li><strong>Query keys:</strong> Organise your data and prevent accidental overwrites.</li><li><strong>No manual loading/error states:</strong> Built-in management simplifies your components.</li><li><strong>Mutations:</strong> Clean handling of POST/PUT/DELETE requests.</li><li><strong>Optimistic updates:</strong> Update UI immediately while the server request completes.</li></ul><h3>Getting Started</h3><h3>1. Install</h3><pre>npm install @tanstack/react-query</pre><h3>2. Set up QueryClientProvider</h3><pre>import { QueryClient, QueryClientProvider } from &#39;@tanstack/react-query&#39;;<br><br>const queryClient = new QueryClient();<br>root.render(<br>  &lt;QueryClientProvider client={queryClient}&gt;<br>    &lt;App /&gt;<br>  &lt;/QueryClientProvider&gt;<br>);</pre><h3>3. Fetch Data in a Component</h3><pre>const { data, isLoading, error } = useQuery({<br>  queryKey: [&#39;posts&#39;],<br>  queryFn: () =&gt; fetch(&#39;/api/posts&#39;).then(res =&gt; res.json()),<br>});</pre><h3>Quick Comparison: useEffect vs TanStack Query</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*vmLMYz75pIkiXrNW1eMCpg.png" /></figure><h3>When to Still Use useEffect</h3><p>useEffect is great for:</p><ul><li>DOM events or subscriptions</li><li>Browser APIs</li><li>Timers</li><li>Local side effects</li></ul><p>But for <strong>server data fetching</strong>, TanStack Query is usually the better choice.</p><p>Fetching data with useEffect works for small apps or demos, but as your app grows, it quickly becomes challenging to manage. TanStack Query simplifies data fetching, caching, and syncing while keeping your components clean and readable.</p><p>Next time you write:</p><pre>useEffect(() =&gt; fetch(...))</pre><p>Think: <em>“This is server state — TanStack Query can handle it better.”</em></p><p>Your future self (and teammates) will thank you.</p><p>Here to make the community stronger by sharing our knowledge. Follow <a href="https://medium.com/@rutuja.pandule">me</a> and <a href="https://medium.com/nonstopio">my team</a> to stay updated on the latest and greatest in the web &amp; mobile tech world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0fa0d4bbc0a" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/useeffect-vs-tanstack-query-a-better-pattern-for-api-fetching-d0fa0d4bbc0a">useEffect vs TanStack Query: A Better Pattern for API Fetching</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Event Handling and Event Delegation]]></title>
            <link>https://blog.nonstopio.com/advanced-event-handling-and-event-delegation-f734b40a7efc?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/f734b40a7efc</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[canvas]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[konvajs]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 10:06:32 GMT</pubDate>
            <atom:updated>2025-11-10T10:06:32.787Z</atom:updated>
            <content:encoded><![CDATA[<h4>Make Konva Fun</h4><h3>Advanced Konva.js 2: Advanced Event Handling</h3><h4><strong>Building sophisticated interaction systems with proper event management</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2zip1SjKXX3eMHtJlvibQQ.png" /></figure><p>Welcome back to our <em>Advanced Konva.js</em> series! In <a href="https://chatgpt.com/g/g-p-68d39b0248d08191890d4624824b9dab-writing/c/link-to-part1">Part 1</a>, we explored multi-layer architecture as the foundation for complex applications. Today, we’ll dive deep into <strong>Advanced Event Handling and Event Delegation</strong> — the techniques that make your Konva applications truly interactive.</p><p>While basic tutorials show simple click handlers, real-world applications need sophisticated event systems that can handle complex interactions, prevent conflicts, and maintain performance even with thousands of elements.</p><h3>Beyond Basic Click Handlers</h3><p>Most Konva tutorials show something like this:</p><pre>const rect = new Konva.Rect({<br>  x: 50,<br>  y: 50,<br>  width: 100,<br>  height: 50,<br>  fill: &#39;blue&#39;,<br>  draggable: true,<br>});<br><br>rect.on(&#39;click&#39;, () =&gt; {<br>  console.log(&#39;Rectangle clicked!&#39;);<br>});</pre><p>This works for demos but breaks down in complex apps due to:</p><ul><li>❌ Each element needs its own handler</li><li>❌ Performance issues with hundreds of listeners</li><li>❌ Event conflicts between UI and canvas layers</li><li>❌ No coordination between related events</li></ul><h3>Advanced Event Handling Architecture</h3><h4>The Event Bus Pattern</h4><p>A centralized event bus improves coordination and scalability:</p><pre>class EventBus {<br>  private static events: Map&lt;string, Function[]&gt; = new Map();<br>static emit(eventName: string, data?: any): void {<br>    const handlers = this.events.get(eventName);<br>    if (handlers) {<br>      handlers.forEach(handler =&gt; {<br>        try { handler(data); } catch (error) {<br>          console.error(`Error in event handler for ${eventName}:`, error);<br>        }<br>      });<br>    }<br>  }<br>  static on(eventName: string, handler: Function): void {<br>    if (!this.events.has(eventName)) this.events.set(eventName, []);<br>    this.events.get(eventName)!.push(handler);<br>  }<br>  static off(eventName: string, handler: Function): void {<br>    const handlers = this.events.get(eventName);<br>    if (handlers) {<br>      const index = handlers.indexOf(handler);<br>      if (index &gt; -1) handlers.splice(index, 1);<br>    }<br>  }<br>  static removeAllListeners(eventName: string): void {<br>    this.events.delete(eventName);<br>  }<br>}<br>export const APPLICATION_EVENTS = {<br>  SHAPE_CLICK: &#39;shapeClick&#39;,<br>  SHAPE_DRAG_START: &#39;shapeDragStart&#39;,<br>  SHAPE_DRAG_END: &#39;shapeDragEnd&#39;,<br>  SELECTION_CHANGED: &#39;selectionChanged&#39;,<br>  UPDATE_SELECTION: &#39;updateSelection&#39;,<br>  UI_INTERACTION: &#39;uiInteraction&#39;,<br>} as const;</pre><h3>Event Delegation with Layer-Level Handlers</h3><p>Instead of assigning handlers to each shape, you can delegate events at the <strong>layer</strong> level:</p><pre>export class EventManager {<br>  private layers: ApplicationLayers;<br>  private eventBus: EventBus;<br>constructor(layers: ApplicationLayers, eventBus: EventBus) {<br>    this.layers = layers;<br>    this.eventBus = eventBus;<br>    this.setupEventListeners();<br>  }<br>  setupEventListeners(): void {<br>    this.setupStageClickHandler();<br>    this.setupContentLayerHandlers();<br>    this.setupUILayerHandlers();<br>  }<br>  private setupStageClickHandler(): void {<br>    this.layers.stage.on(&#39;click&#39;, (e) =&gt; {<br>      if (e.target === this.layers.stage) this.clearAllSelections();<br>    });<br>  }<br>  private setupContentLayerHandlers(): void {<br>    this.layers.contentLayer.on(&#39;dragstart&#39;, (event) =&gt; {<br>      const shapeId = event.target.id();<br>      this.eventBus.emit(APPLICATION_EVENTS.SHAPE_DRAG_START, { shapeId });<br>    });<br>    this.layers.contentLayer.on(&#39;dragend&#39;, (event) =&gt; {<br>      const shapeId = event.target.id();<br>      this.eventBus.emit(APPLICATION_EVENTS.SHAPE_DRAG_END, { shapeId });<br>    });<br>  }<br>}</pre><h3>Advanced Shape Interactions</h3><pre>export class InteractiveShape {<br>  private shape: Konva.Shape;<br>  private eventBus: EventBus;<br>  private lastClickTime = 0;<br><br>constructor(shape: Konva.Shape, eventBus: EventBus) {<br>    this.shape = shape;<br>    this.eventBus = eventBus;<br>    this.registerEvents();<br>  }<br>  registerEvents() {<br>    this.shape.off(&#39;click&#39;);<br>    this.shape.on(&#39;click&#39;, (e) =&gt; {<br>      e.cancelBubble = true;<br>      const now = Date.now();<br>      if (now - this.lastClickTime &lt; 300) {<br>        this.eventBus.emit(&#39;shapeDoubleClick&#39;, { id: this.shape.id() });<br>      } else {<br>        this.eventBus.emit(APPLICATION_EVENTS.SHAPE_CLICK, { id: this.shape.id() });<br>      }<br>      this.lastClickTime = now;<br>    });<br>  }<br>}</pre><h3>Multi-Select and Event Coordination</h3><p>Implement <strong>multi-selection</strong> and <strong>UI synchronisation</strong> through the Event Bus:</p><pre>export class SelectionManager {<br>  private selectedShapes = new Set&lt;string&gt;();<br>  constructor(private eventBus: EventBus) {<br>    this.eventBus.on(APPLICATION_EVENTS.SHAPE_CLICK, (data) =&gt; {<br>      this.toggleShapeSelection(data.shapeId);<br>    });<br>  }<br>private toggleShapeSelection(id: string) {<br>    if (this.selectedShapes.has(id)) this.selectedShapes.delete(id);<br>    else this.selectedShapes.add(id);<br>  }<br>}</pre><h3>Keyboard Event Handling</h3><pre>export class KeyboardHandler {<br>  constructor(private stage: Konva.Stage, private eventBus: EventBus) {<br>    this.stage.on(&#39;keydown&#39;, (e) =&gt; {<br>      const key = e.evt.key;<br>      if (key === &#39;Delete&#39;) this.eventBus.emit(&#39;deleteSelectedShapes&#39;);<br>      if (key === &#39;a&#39; &amp;&amp; (e.evt.ctrlKey || e.evt.metaKey)) {<br>        this.eventBus.emit(&#39;selectAllShapes&#39;);<br>      }<br>    });<br>  }<br>}</pre><h3>Performance Optimization</h3><p>Use <strong>throttling</strong> and <strong>cleanup</strong> to prevent event overload:</p><pre>destroy(): void {<br>  this.eventBus.removeAllListeners(APPLICATION_EVENTS.SHAPE_CLICK);<br>  this.eventBus.removeAllListeners(APPLICATION_EVENTS.SELECTION_CHANGED);<br>}</pre><h3>Best Practices</h3><p><strong>Do:</strong></p><ul><li>Use event delegation for better performance</li><li>Clean up listeners to avoid leaks</li><li>Use constants for event names</li><li>Throttle or debounce heavy operations</li><li>Cancel event bubbling when needed</li></ul><p><strong>Don’t:</strong></p><ul><li>Attach listeners to every shape</li><li>Ignore event conflicts between layers</li><li>Use anonymous functions for handlers</li></ul><h3>Conclusion</h3><p>Advanced event handling transforms Konva from a basic drawing tool into a <strong>powerful interactive system</strong>. By combining:</p><ul><li><strong>Event delegation</strong> for performance</li><li><strong>Event bus architecture</strong> for coordination</li><li><strong>Multi-selection and keyboard integration</strong></li><li><strong>Performance cleanup and throttling</strong></li></ul><p>You can build truly scalable, professional-grade canvas applications.</p><h3>What’s Next</h3><p><strong>Part 3: Performance Optimisation with Throttling and Batching</strong></p><ul><li>Advanced throttling strategies</li><li>Batch drawing techniques</li><li>Memory optimisation patterns</li></ul><p><em>This series explores advanced Konva.js techniques for building production-ready applications. Stay tuned for more!</em></p><p><strong>References:</strong></p><ul><li><a href="https://konvajs.org/docs/events/Event_Delegation.html">Konva.js Event Delegation</a></li><li><a href="https://konvajs.org/api/Konva.Node.html#events">Konva.js API — Events</a></li></ul><p>Here to make the community stronger by sharing our knowledge. Follow <a href="https://medium.com/@rutuja.pandule">me</a> and <a href="https://medium.com/nonstopio">my team</a> to stay updated on the latest and greatest in the web &amp; mobile tech world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f734b40a7efc" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/advanced-event-handling-and-event-delegation-f734b40a7efc">Advanced Event Handling and Event Delegation</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Konva.js 1: Multi-Layer Architecture]]></title>
            <link>https://blog.nonstopio.com/advanced-konva-js-1-multi-layer-architecture-e21d92ec1280?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/e21d92ec1280</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[canvas]]></category>
            <category><![CDATA[konvajs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 10:05:27 GMT</pubDate>
            <atom:updated>2025-11-10T10:05:27.450Z</atom:updated>
            <content:encoded><![CDATA[<h4>Make Konva Fun</h4><h4><strong>Building scalable, performant Konva apps through smart layer design</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQ3SjDELOz7Wa7ee4AI5ZA.png" /></figure><p>Welcome to the first installment of our <strong>Advanced Konva.js</strong> series!<br> If you’ve used Konva before, you’ve probably drawn a few shapes on a single layer and called it a day. That’s great for demos — but real-world, interactive applications need much more structure.</p><p>When your canvas has <strong>thousands of elements</strong>, animations, highlights, and UI controls, the single-layer approach starts to crumble. Performance drops, events get messy, and maintainability suffers.</p><p>In this post, we’ll examine how to address these challenges using a <strong>multi-layer architecture</strong> — the foundation of scalable, production-grade Konva applications.</p><h3>The Problem with Single-Layer Setups</h3><p>Most tutorials start like this:</p><pre>const stage = new Konva.Stage({<br>  container: &#39;container&#39;,<br>  width: 800,<br>  height: 600<br>});<br>const layer = new Konva.Layer();<br>stage.add(layer);</pre><pre>// Add everything to one layer<br>layer.add(rect);<br>layer.add(circle);<br>layer.add(text);<br>layer.add(uiControls);</pre><p>It works — until your app grows.</p><p><strong>Why it breaks down:</strong></p><ul><li>🐏 <strong>Performance:</strong> Every update forces a full redraw.</li><li>🧬 <strong>Event chaos:</strong> UI events interfere with drawing interactions.</li><li>🧠 <strong>Complexity:</strong> All elements — static, dynamic, and UI — live together.</li><li>🔍 <strong>No control:</strong> You can’t selectively update or optimize specific visuals.</li></ul><h3>The Multi-Layer Solution</h3><p>As the <a href="https://konvajs.org/docs/">official Konva docs</a> note, <strong>each </strong><strong>Konva.Layer is its own </strong><strong>&lt;canvas&gt;</strong>, meaning layers can redraw independently — perfect for making selective updates and isolating elements.</p><p>Here’s the architecture we use in complex, real-world apps:</p><pre>interface StageLayers {<br>  stage: Konva.Stage;<br>  gridLayer: Konva.Layer;        // Background grid<br>  drawingLayer: Konva.Layer;     // Main content<br>  highlightLayer: Konva.Layer;   // Selection feedback<br>  lineHighlightLayer: Konva.Layer; // Line-specific highlights<br>  uiLayer: Konva.Layer;          // UI controls<br>}</pre><h3>Implementation: The StageManager Class</h3><p>To make layer setup consistent and reusable, we wrap everything inside a class.</p><pre>export class StageManager {<br>  private canvasService: CanvasService;<br>constructor() {<br>    this.canvasService = new CanvasService();<br>  }<br>  createLayers(stage: Konva.Stage): StageLayers {<br>    const gridLayer = new Konva.Layer({ name: &#39;GRID&#39;, listening: false });<br>    const drawingLayer = new Konva.Layer({ name: &#39;DRAWING&#39;, listening: true });<br>    const highlightLayer = new Konva.Layer({ name: &#39;HIGHLIGHT&#39;, listening: true });<br>    const lineHighlightLayer = new Konva.Layer({ name: &#39;LINE_HIGHLIGHT&#39;, listening: true });<br>    const uiLayer = new Konva.Layer({ name: &#39;UI&#39;, listening: true });<br>    stage.add(gridLayer, drawingLayer, highlightLayer, lineHighlightLayer, uiLayer);<br>    this.canvasService.addStage(&#39;rootStage&#39;, stage);<br>    this.canvasService.addLayer(&#39;GRID&#39;, gridLayer);<br>    this.canvasService.addLayer(&#39;DRAWING&#39;, drawingLayer);<br>    this.canvasService.addLayer(&#39;HIGHLIGHT&#39;, highlightLayer);<br>    this.canvasService.addLayer(&#39;LINE_HIGHLIGHT&#39;, lineHighlightLayer);<br>    this.canvasService.addLayer(&#39;UI&#39;, uiLayer);<br>    return { stage, gridLayer, drawingLayer, highlightLayer, lineHighlightLayer, uiLayer };<br>  }<br>}</pre><h3>Layer Responsibilities &amp; Benefits</h3><h3>1. Grid Layer (Background)</h3><p>A static, non-interactive background for performance.</p><pre>const gridLayer = new Konva.Layer({ listening: false });<br>const gridLine = new Konva.Line({<br>  points: [0, 0, 800, 0],<br>  stroke: &#39;#e0e0e0&#39;,<br>  strokeWidth: 1,<br>  listening: false<br>});</pre><p>👉 Never redraws during interaction<br> 👉 Uses listening: false for faster rendering<br> 👉 Keeps visuals separate from interactive content</p><h3>2. Drawing Layer (Main Content)</h3><p>Contains interactive shapes and nodes.</p><pre>const drawingLayer = new Konva.Layer({ listening: true });<br>const node = new Konva.Circle({<br>  x: 100, y: 100, radius: 30, fill: &#39;blue&#39;, draggable: true<br>});</pre><p>👉 Core interaction layer<br> 👉 Redraws independently<br> 👉 Keeps main visuals separate from UI overlays</p><h3>3. Highlight Layer (Selection Feedback)</h3><p>Used for temporary effects like selection boxes and hover highlights.</p><pre>const highlightLayer = new Konva.Layer({ listening: true });<br>const selectionRect = new Konva.Rect({<br>  x: 50, y: 50, width: 100, height: 100,<br>  stroke: &#39;#5C9BFF&#39;, strokeWidth: 2, dash: [5, 5]<br>});</pre><p>👉 Easy to clear/redraw<br> 👉 Doesn’t disturb main layer content<br> 👉 Great for transient visual states</p><h3>4. UI Layer (Controls &amp; Overlays)</h3><p>Top-level layer for UI interactions.</p><pre>const uiLayer = new Konva.Layer({ listening: true });<br>const zoomButton = new Konva.Group({ x: 10, y: 10 });</pre><p>👉 Always on top<br> 👉 Isolated event handling<br> 👉 Keeps UI separate from visual data</p><h3>Canvas Service: Centralized Layer Management</h3><p>To manage layers across your app, we use a small service class:</p><pre>class CanvasService {<br>  private stages = new Map&lt;string, Konva.Stage&gt;();<br>  private layers = new Map&lt;string, Konva.Layer&gt;();<br><br>addStage(name: string, stage: Konva.Stage) { this.stages.set(name, stage); }<br>  getStage(name: string) { return this.stages.get(name); }<br>  addLayer(name: string, layer: Konva.Layer) { this.layers.set(name, layer); }<br>  getLayer(name: string) { return this.layers.get(name); }<br>}</pre><p>This makes it easy to retrieve and control layers from anywhere in your app.</p><h3>Performance in Action</h3><h4>Selective Redrawing</h4><pre>function updateNodePosition(node: Konva.Node) {<br>  node.position({ x: newX, y: newY });<br>  canvasService.getLayer(&#39;DRAWING&#39;)?.batchDraw(); // Only redraw what changed<br>}</pre><h4>Event Isolation</h4><pre>uiLayer.on(&#39;click&#39;, e =&gt; {<br>  if (e.target.name() === &#39;zoom-button&#39;) handleZoom();<br>});<br><br>drawingLayer.on(&#39;click&#39;, e =&gt; {<br>  if (e.target.name() === &#39;node&#39;) selectNode(e.target);<br>});</pre><p>UI events and drawing events now stay perfectly isolated.</p><h3>Real-World Example: The Grid Class</h3><p>A performant grid that only redraws visible lines:</p><pre>export class Grid {<br>  constructor(private layer: Konva.Layer, private stage: Konva.Stage) {<br>    this.layer.listening(false);<br>    this.layer.zIndex(0);<br>    this.drawGrid();<br>  }<br><br>drawGrid() {<br>    this.layer.destroyChildren();<br>    const box = this.stage.getClientRect();<br>for (let x = 0; x &lt; box.width; x += 20) {<br>      this.layer.add(new Konva.Line({ points: [x, 0, x, box.height], stroke: &#39;#e0e0e0&#39; }));<br>    }<br>    for (let y = 0; y &lt; box.height; y += 20) {<br>      this.layer.add(new Konva.Line({ points: [0, y, box.width, y], stroke: &#39;#e0e0e0&#39; }));<br>    }<br>    this.layer.batchDraw();<br>  }<br>}</pre><h3>Best Practices &amp; Common Pitfalls</h3><p>✅ <strong>Do:</strong></p><ul><li>Keep 3–5 layers max</li><li>Set listening: false for static visuals</li><li>Use batchDraw() for grouped updates</li><li>Name layers for easy debugging</li></ul><p>❌ <strong>Don’t:</strong></p><ul><li>Dump everything into one layer</li><li>Forgot to disable event listening on static items</li><li>Overuse layers (too many = overhead)</li><li>Mix UI and data visuals</li></ul><h3>Conclusion</h3><p>A <strong>multi-layer architecture</strong> turns Konva from a drawing toy into a scalable, production-grade rendering engine.</p><p>You get:</p><ul><li>⚡ <strong>Better performance</strong> with selective redrawing</li><li>🧠 <strong>Cleaner maintenance</strong> with clear separation</li><li>🧩 <strong>Easier scalability</strong> as your app grows</li><li>🎩 <strong>More flexibility</strong> for features and UI</li></ul><h3>Next in This Series</h3><p><strong>Part 2: Advanced Event Handling and Delegation</strong></p><ul><li>Complex interaction patterns</li><li>Smart event delegation strategies</li><li>Event performance optimization</li></ul><p>📚 <strong>References</strong></p><ul><li><a href="https://konvajs.org/docs/">Konva.js Layer Management (Docs)</a></li><li><a href="https://konvajs.org/api/Konva.Layer.html">Konva.js API Reference</a></li></ul><p><em>This series is inspired by real-world patterns from a production-grade visualisation library. </em>Here to make the community stronger by sharing our knowledge. Follow <a href="https://medium.com/@rutuja.pandule">me</a> and <a href="https://medium.com/nonstopio">my team</a> to stay updated on the latest and greatest in the web &amp; mobile tech world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e21d92ec1280" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/advanced-konva-js-1-multi-layer-architecture-e21d92ec1280">Advanced Konva.js 1: Multi-Layer Architecture</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner’s Guide to Frontend Debugging (Things I Wish I Had Known When I Started)]]></title>
            <link>https://blog.nonstopio.com/beginners-guide-to-frontend-debugging-things-i-wish-i-had-known-when-i-started-efb87f84c01c?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/efb87f84c01c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Thu, 17 Jul 2025 09:43:33 GMT</pubDate>
            <atom:updated>2025-07-17T09:43:33.977Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rw2DO7z6mkCXSmUVZItUgw.jpeg" /></figure><p><em>Staring at your code and yelling at the browser won’t help, not until you learn to figure out the root cause of the problem. It turns out that debugging wasn’t just about fixing bugs; it was about learning how to think like the browser.</em></p><p>Let’s face it, when you’re new to frontend development, debugging can feel like standing in front of a wall of code, hoping it speaks first.<br>There was a time I wasted <em>hours</em> chasing the wrong issue, only to realise it was a prop typo.</p><p>This guide isn’t just about fixing bugs. It’s about learning the <strong>mindset and the tools</strong> to stop staring at your code blankly and start attacking problems with confidence.<br> If that sounds familiar, this blog is for you.</p><h3>1. Read the Error — Don’t Just Stare at Your Code</h3><p><strong>Mistake I made:</strong> Panicking when red lines showed up.<br><strong>What I do now:</strong> Actually <em>read</em> the full stack trace — especially the <em>first and last lines</em>.</p><ul><li>Look for the file and line number.</li><li>Check if it’s a runtime error, a compile-time error, or a third-party library issue.</li><li>Trust me, 90% of the answer is already there.</li></ul><blockquote><em>🔁 Tip: Use </em><em>console.trace() for unexpected function calls.</em></blockquote><h3>2. Reproduce the Bug Consistently</h3><p><strong>Then fix it. Not before.</strong><br> I’ve wasted days on bugs that couldn’t be reliably reproduced.</p><ul><li>Refresh your page</li><li>Clear storage</li><li>Switch user roles</li><li>Test on different environments</li></ul><p>If you can’t reproduce it, log it, record it, and move on for now.</p><h3>3. Isolate the Problem</h3><p>Comment out chunks. Create minimal examples. Switch to local mock data. This step saves hours.</p><p>If it’s a CSS issue, strip down the layout. If it’s a complex hook, call it in a separate dummy component.</p><h3>4. Always Keep DevTools Open</h3><p>Your browser DevTools is your best friend; don’t wait for things to break before you open it.</p><ul><li>Keep an eye on the <strong>Console tab</strong> for real-time errors and logs.</li><li>Use the <strong>Elements tab</strong> for layout/CSS inspection.</li><li>The <strong>Sources tab</strong> lets you drop a quick debugger Or set breakpoints visually.</li><li>Even performance issues can be spotted early in the <strong>Performance</strong> or <strong>Network</strong> tab.</li></ul><blockquote><em>Tip: Make “Inspect Element” second nature. It often reveals what your code doesn’t</em></blockquote><h3>5. Log Smart, Not Blindly</h3><p>There’s a difference between:</p><pre>console.log(&quot;clicked&quot;);</pre><p>and:</p><pre>console.log(&quot;clicked&quot;, { itemId, state, isLoading });</pre><blockquote><em>Use meaningful logs with context , and don’t forget to remove them later.<br> Bonus: Learn to use breakpoints in Chrome DevTools.</em></blockquote><h3>6. Check the Network Tab Before Blaming Your Code</h3><p>Many issues aren’t in your code — they’re in the API.</p><ul><li>Wrong payload?</li><li>500 Internal Server Error?</li><li>Missing headers?</li></ul><p>Spend time learning how to use the <strong>Network tab</strong> — it’s gold.</p><h3>7. Think in Terms of Data Flow</h3><p>Especially with React:</p><ul><li>Props &gt; State &gt; API &gt; Effects &gt; Rerenders<br> Once I started visualising <em>how</em> and <em>when</em> data flows, most bugs started making sense.</li></ul><h3>8. Don’t Be Afraid to Read Library Source Code and Documentation</h3><p>I’ve debugged issues in various UI libraries and state management tools simply by diving into their source code, documentation, and GitHub repositories.<br>You don’t have to understand everything, just follow the trail.</p><h3>9. If It Looks Obvious, It’s Probably Not That</h3><p>Beware of assumptions like:</p><ul><li>“This can’t be null.”</li><li>“This API is always fast.”</li><li>“This component always mounts before that one.”</li></ul><p>99% of the time, bugs are where you <em>thought</em> they wouldn’t be.</p><h3>10. Take Breaks and Context Switch (Smartly)</h3><p>Sometimes the best fix comes when I’m away from the screen.<br> Suppose it’s not urgent, pause. You’ll see it differently when you return.</p><h3>11. Don’t Debug Alone</h3><p>A 2-minute rubber duck session or a teammate’s fresh pair of eyes can save your day.</p><p>Debugging isn’t just a skill — it’s a mindset.<br> The sooner you stop fearing it and start embracing its patterns, the better your dev life gets. And no, you’re not a bad developer if something takes too long to fix. You’re just… learning deeply.</p><p>Here to make the community stronger by sharing our knowledge. Follow <a href="https://medium.com/@rutuja.pandule">me</a> and <a href="https://medium.com/nonstopio">my team</a> to stay updated on the latest and greatest in the web &amp; mobile tech world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efb87f84c01c" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/beginners-guide-to-frontend-debugging-things-i-wish-i-had-known-when-i-started-efb87f84c01c">Beginner’s Guide to Frontend Debugging (Things I Wish I Had Known When I Started)</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“Maybe I’m Not Good Enough”, Lost in Legacy Code]]></title>
            <link>https://blog.nonstopio.com/maybe-im-not-good-enough-lost-in-legacy-code-5534329d7d39?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/5534329d7d39</guid>
            <category><![CDATA[legacy]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[management]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 03:14:30 GMT</pubDate>
            <atom:updated>2025-06-10T03:14:30.820Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>It’s not just code. It’s a battle with self-doubt, silence, and survival.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wLg4N-VAOHIhVTR2nDQsFA.jpeg" /></figure><p>There was a moment I won’t forget. I opened a file — a single JavaScript file, 2700+ lines. No comments. No imports. No structure. Just… chaos.</p><p>The kind of chaos where your brain doesn’t even panic. It just… freezes. Staring. Scrolling. Hoping for meaning.And finding none. There were conditionals inside conditionals. Functions declared in if blocks are like forgotten secrets.Variables that shape-shifted mid-execution like a bad magic trick.A loop that… did something. I still don’t know what.</p><p>And then, the real bug appeared. Not in the code — in my head.That whisper.</p><p><strong><em>“Is it just me? Am I this slow? This confused? This bad?”</em></strong></p><p>That’s how it started.</p><p>At some point in every developer’s journey, we hit that phase. It’s rarely loud. It’s never dramatic. Just quiet doubts that creep in between the lines. <strong>“Maybe I just need 10 more minutes.”An hour passes</strong>. Then two. You think about asking for help on Slack… but you don’t. You don’t want to sound dumb. Everyone else seems to be shipping. You’re just… stuck.</p><p>So you stay quiet. And the silence turns into noise, inside your head. “Other devs probably don’t struggle like this.” “This shouldn’t be taking me this long.” “What if I’m just not good enough?”</p><p>Nobody prepares you for legacy code.</p><p>It’s not just “old code.”It’s a code written in a different time, under pressure, without today’s practices. No docs. No tests. No version control etiquette. You’re not decoding. You’re deciphering. You’re time-traveling.</p><p>It’s not “just adding a button.”It’s reverse-engineering a chain of decisions made by a dev who probably left the company when you were still in college. And of course, all of this under a deadline. We had three weeks. No buffer. No cleanup sprint. Just “make it work.”</p><p>But here’s what I’ve learned — and wish someone had told me sooner:</p><h3><strong>It’s not just you.</strong></h3><p>Behind every senior engineer’s confident PR, there’s a history of blank stares, late nights, and whispered “what the hell is this?” moments.</p><p>Working with legacy code is like fixing an airplane mid-flight. You can’t rebuild it from scratch. You can only patch, refactor, and hold your breath.</p><p>And then… something shifts.<br>You start leaving comments. You start naming things better. You begin writing for the next dev — and for yourself, six months from now.</p><p>One day, you look at that 2700-line monster and refactor it into neat, logical modules. And for a brief moment, it all makes sense.<br>There’s no “Top 5 Tricks to Survive Legacy Code.”No productivity hacks. No AI tool can fully save you here.</p><p>But I’ll leave you with this:</p><p>That voice in your head? The one whispering you’re not good enough? It’s lying. <strong>You’re not broken. The code is.</strong></p><p>You’re untangling a product of desperation, built under time pressure, and never meant to last this long. Every line you understand, every bug you squash — that’s growth. So, if you’re feeling lost, drained, or quietly breaking down inside a maze of legacy code…</p><p><strong><em>Pause. Breathe. Then keep going.</em></strong></p><p>Leave a comment. Add a log. Refactor a tiny piece. Light the path a little for the next weary dev who comes after you. Because one day, you’ll open a file, maybe one you once dreaded, and say:</p><blockquote><strong>“Damn. That actually makes sense now.”</strong></blockquote><p><strong>Legacy code doesn’t define your worth. But how you navigate it might just reveal your strength.</strong></p><p><em>Here to make the community stronger by sharing our knowledge. Follow </em><a href="https://medium.com/@rutuja.pandule"><em>me</em></a><em> and </em><a href="https://medium.com/nonstopio"><em>my team</em></a><em> to stay updated on the latest and greatest in the web &amp; mobile tech world.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5534329d7d39" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/maybe-im-not-good-enough-lost-in-legacy-code-5534329d7d39">“Maybe I’m Not Good Enough”, Lost in Legacy Code</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Single-Threaded JavaScript Handles Multiple Tasks Simultaneously]]></title>
            <link>https://blog.nonstopio.com/how-single-threaded-javascript-handles-multiple-tasks-simultaneously-9d15b3622c4a?source=rss-dc11ef5b4029------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d15b3622c4a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[web-apps]]></category>
            <category><![CDATA[process]]></category>
            <dc:creator><![CDATA[Rutuja Pandule]]></dc:creator>
            <pubDate>Thu, 29 May 2025 04:55:19 GMT</pubDate>
            <atom:updated>2025-05-29T04:55:19.258Z</atom:updated>
            <content:encoded><![CDATA[<h4>Single-threaded JS is a limitation?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZPCHPHK-oVV2lowLuiiKQ.jpeg" /></figure><p>If you’ve ever wondered how JavaScript, a single-threaded language, can seem to multitask — handling animations, API calls, file uploads, and user interactions all at once — you’re not alone. This post breaks it down in simple terms and with a relatable analogy.</p><h3>Understanding Single-Threaded JavaScript</h3><p>JavaScript is known as a <strong>single-threaded</strong> language. This means it has <strong>one main thread</strong> that executes your code line by line. There’s no true multithreading in the traditional sense (like in Java or C++), at least not directly in the language.</p><p>So the big question is: <strong>How does JavaScript handle multiple processes at the same time?</strong></p><h3>The hero is: Event Loop + Asynchronous APIs</h3><p>The answer lies in JavaScript’s <strong>event loop</strong>, paired with <strong>asynchronous APIs</strong> provided by the browser (or Node.js). These tools allow JavaScript to <strong>delegate tasks</strong> that take time, like fetching data from the network — so it can keep doing other work while it waits.</p><h3>Let’s understand by analogy: The Chef in the Kitchen</h3><p>Imagine you’re a <strong>chef</strong> working alone in a kitchen. You have only <strong>one stove</strong> (like JavaScript’s single thread).</p><p>You receive multiple orders:</p><ol><li>Boil pasta (10 minutes)</li><li>Toast bread (2 minutes)</li><li>Pour coffee (instant)</li><li>Take a new order</li></ol><p>If you stood at the stove for 10 minutes waiting for pasta to boil before doing anything else, your restaurant would crash. Instead, you:</p><ul><li>Set the pasta on the stove and start a timer</li><li>While it boils, you toast bread</li><li>Then you pour coffee</li><li>Then you take a new order</li><li>When the timer rings, you return to finish the pasta</li></ul><p>You’re still one chef, but by using <strong>timers</strong> and <strong>kitchen tools</strong> that work in the background, you’re <strong>efficiently multitasking</strong>.</p><h3>How It Works in JavaScript</h3><p>Here’s what happens under the hood:</p><ol><li>JS code runs on the main thread.</li><li>Time-consuming tasks (HTTP requests, timers, I/O) are handed to background APIs (like Web APIs in the browser).</li><li>When those tasks are done, they place a <strong>callback</strong> in the <strong>message queue</strong>.</li><li>The <strong>event loop</strong> checks if the main thread is free. If it is, it executes the callback.</li></ol><p>This system creates the <strong>illusion of multitasking</strong>.</p><h3>A Simple Example</h3><pre>console.log(&quot;Start&quot;);<br>setTimeout(() =&gt; {<br>  console.log(&quot;Timeout done&quot;);<br>}, 2000);<br>console.log(&quot;End&quot;);</pre><p><strong>Output:</strong></p><pre>Start<br>End<br>Timeout done</pre><p>Even though setTimeout was set for 2 seconds, it didn’t block the main thread. JavaScript kept running and came back to it when the timer was done.</p><h3>Conclusion</h3><ul><li>JavaScript is single-threaded.</li><li>It handles multiple tasks via asynchronous programming, the event loop, and background APIs.</li><li>With this design, JavaScript can efficiently manage many things seemingly at once.</li></ul><p>So next time you hear someone say JavaScript is single-threaded, you’ll know it’s not a limitation — it’s a clever architectural choice that allows for powerful asynchronous behaviour.</p><blockquote>Here to make the community stronger by sharing our knowledge. Follow <a href="https://medium.com/@rutuja.pandule">me</a> and <a href="https://medium.com/nonstopio">my team</a> to stay updated on the latest and greatest in the web &amp; mobile tech world.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d15b3622c4a" width="1" height="1" alt=""><hr><p><a href="https://blog.nonstopio.com/how-single-threaded-javascript-handles-multiple-tasks-simultaneously-9d15b3622c4a">How Single-Threaded JavaScript Handles Multiple Tasks Simultaneously</a> was originally published in <a href="https://blog.nonstopio.com/">nonstopio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>