<?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 Sonia Goplani on Medium]]></title>
        <description><![CDATA[Stories by Sonia Goplani on Medium]]></description>
        <link>https://medium.com/@soniagoplani?source=rss-ec340cc870d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pgfrCdHYRShHwauurVQ7HQ@2x.jpeg</url>
            <title>Stories by Sonia Goplani on Medium</title>
            <link>https://medium.com/@soniagoplani?source=rss-ec340cc870d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:48:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@soniagoplani/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[Code Is Cheap, Confidence Is Not: My Journey to Claude Certified Architect]]></title>
            <link>https://medium.com/@soniagoplani/code-is-cheap-confidence-is-not-my-journey-to-claude-certified-architect-5b5d131d0f5a?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b5d131d0f5a</guid>
            <category><![CDATA[claude-certified]]></category>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 05:01:01 GMT</pubDate>
            <atom:updated>2026-10-08T05:01:01.318Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Jzy0W48ecAWNdgdcMFPZrQ.gif" /></figure><p>If you feel overwhelmed by AI right now, this post is for you.</p><p>New models every week. New terms every day. Everyone around you seems to know something you don’t. And the biggest question sits quietly in your head: <em>where do I even start?</em></p><p>Not very long ago, I was exactly there. This is the story of how I went from typing half-broken prompts to becoming a Claude Certified Architect. Not because I’m special, but because one day I got curious, and I didn’t ignore it.</p><h3>I thought I was already using AI well</h3><p>I was doing my regular job, working on projects, and using AI the way most of us do. I would type a prompt, often in broken language. A half sentence here, a vague instruction there. In my mind, AI already knew everything, so why explain much?</p><p>And honestly, the results felt good.</p><p>But here’s the catch. My comparison point was very low. I was comparing writing code manually against getting code from AI with a not-so-good prompt. Against that baseline, almost anything feels like a win.</p><p>I even told one of the partners in my company that AI was really helping us and our productivity had gone up. I believed it completely.</p><p>I just didn’t know what I didn’t know.</p><h3>Three days that changed the question</h3><p>Then I got freed up from a project. During that transition, my company organized a three-day AI Practitioner training for technical leads.</p><p>I still remember sitting in that room. Words were flying around: tokens, context, modes, skills, MCP. People were nodding. I was sitting there completely blank.</p><p>That was the moment a question landed in my head and refused to leave:</p><p><strong>Are we really using AI to its full potential?</strong></p><p>By the end of those three days, I knew the honest answer was no. AI had so many capabilities I had never touched. A well-written prompt could completely change the output. Skills, defined workflows, and connections to existing MCP servers could make our work much easier.</p><p>I had been using a tiny fraction of what was sitting right in front of me.</p><h3>Curiosity is a signal. Act on it.</h3><p>If you take only one thing from this post, take this.</p><p>When curiosity shows up, act on it in that moment. Not next quarter. Not “once things settle down.” Curiosity has a short shelf life. If you don’t feed it, it fades, and the routine takes over again.</p><p>I had some time on my hands, so I acted. I started exploring everything that was taught in those sessions. I began with skills and started using them in my actual projects.</p><p>Slowly, very slowly, I realized this was a whole different world. And most of us around me weren’t even aware of it.</p><h3>Saying yes before I felt ready</h3><p>Because I showed interest, I got connected with one of the Gen AI trainers in my organization. One fine day, he asked me something I did not expect: <em>would you take these same sessions for others?</em></p><p>My mind was full of doubts. I had been the one sitting blank in that room not so long ago. Still, I said yes.</p><p>That yes taught me more than anything else. Preparing to teach forced me to go deeper into every feature, every concept, every “but why does it work like that?”</p><p>In my first batch, on day three, we gave everyone a challenge: build a working website, anything quirky, from one single prompt. The website was never the real point. The point was to fix the very first step, the prompt itself. To be clearer, more structured, more intentional. That was the takeaway I wanted everyone to walk out with.</p><p>I went on to take sessions for three to four batches. Every batch brought new questions. How do we apply AI in DevOps? How can QA engineers use it? We discussed the real problems people faced in their daily work, which kept everything practical.</p><p>And in every batch, we started with the same thing: the foundation. Because to learn anything properly, you need a base first. For AI, that base is:</p><ul><li>What tokens and context are, and how to manage context effectively</li><li>How LLMs are built and trained</li><li>What a knowledge cutoff date means</li><li>Why models hallucinate</li><li>How to get reliable, consistent outputs</li><li>How and when to use different modes</li></ul><p>Skip this, and everything advanced feels like magic. Learn this, and everything advanced starts to make sense.</p><h3>When the dots finally connected</h3><p>The next push came from one of the partners in our company. We were given a task: go through all the free courses Anthropic offers and learn these things in depth.</p><p>So we did. AI Fluency. Claude Code. What skills are and how to create them. MCP servers and MCP clients. Building with the Claude API, including building your own agents.</p><p>We didn’t just watch. We built small agents along the way. And concepts that had felt scattered started clicking one by one: system prompts, tool calling, multi-agent orchestration.</p><p>It felt like someone had connected the dots in my mind, and suddenly the full picture was visible.</p><p>The biggest shift wasn’t that I knew more tools. It was that I now knew <strong>when to use what</strong>. That is the difference between knowing AI and being able to work with it.</p><p>That month gave us seven to eight course certifications. More importantly, it gave us a practical way of thinking about how to bring all of this into our real projects.</p><h3>Then the mock exams humbled us</h3><p>Around this time, Anthropic launched its first certification: <strong>Claude Certified Architect — Foundations</strong>.</p><p>It tests how well you can deliver production-ready applications as an architect. How LLMs actually work behind the scenes. And, most importantly, how you would apply all that knowledge in practice.</p><p>Our formal preparation started late, but the foundation was already set from the months before. Or so we thought.</p><p>After the first few mock exams, we were honestly terrified. The questions went into so much depth. They weren’t asking <em>what this feature is</em>. They were asking things like:</p><ul><li>Something in your application isn’t working. How do you debug it, and what is your first priority?</li><li>You’ve built a customer-facing agent. The customer is angry and wants to talk to an executive. How should the LLM handle it?</li><li>What kind of context does an LLM hold, and where?</li><li>Why do we need multiple agents at all, and how do they work in parallel?</li></ul><p>That’s when it hit me. Knowing about features is one thing. Knowing which one to use, when, and why, while building something real, is a completely different thing.</p><p>Preparing for these questions slowly rewired how I think. My mind automatically started approaching problems like an architect, not just a user.</p><h3>A tip nobody talks about: train your focus</h3><p>We took mock exams on alternate days. The questions are long and layered, and you have to read every word with full attention.</p><p>Let’s be honest, our attention spans have shrunk. Reels, notifications, and constant switching have done that to all of us. So before the real exam, practise sitting with complete focus for the full duration. Treat focus as a skill you train, not something that will magically show up on exam day.</p><h3>Exam day, and a big thank you</h3><p>The last few weeks went into focused preparation. I read Medium blogs from people who had already taken the exam. I listened to colleagues who had cleared it. And I went back to Anthropic’s official documentation to understand concepts properly, not just memorise them.</p><p>Then, one fine day, I sat for the exam. The result came instantly.</p><p><strong>Cleared.</strong></p><p>I was more than happy. Everyone around me applauded and appreciated it, and that moment made every late evening worth it.</p><p>But this journey was never a solo one.</p><p>A big shout-out to <strong>Coditas</strong>, my company, for creating an environment where learning is pushed, supported, and celebrated. The practitioner sessions, the course challenge, the chance to teach others: none of this happens without a culture that believes in its people.</p><p>And a special thank you to <strong>Varun</strong> and <strong>Saurabh</strong>. You inspired me to take this path, trusted me when I was still full of doubts, and kept pushing me to go deeper. This certification carries your fingerprints too.</p><h3>If you’re where I was</h3><p>This certification is not the finish line. It’s just the beginning.</p><p>Whether you take a certification or not, start by building your foundation. Understand tokens and context. Understand how LLMs work, why they hallucinate, and how to guide them. Then build on top of it: generative AI engineering, architecture, production-grade products, real solutions to real problems.</p><p>If you’re using AI today and think it’s limited to prompting, I hope this post creates a small stir inside you. There is so much more to it. Used the right way, it can give you back enormous time, productivity, and better solutions.</p><p>And if curiosity is knocking at your door right now, open it. Today. Not someday.</p><p>Because one thing I’ve learned on this journey is this:</p><p><strong>Code is cheap. Confidence is not.</strong></p><p>Anyone can get code out of AI today. But to build solutions you can stand behind with confidence, you need to understand how these models actually work. That understanding is worth every hour you put in.</p><p><em>If you’re starting your own AI journey and feel stuck, drop a comment or message me. I’d be happy to help you find your first step.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b5d131d0f5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Know JavaScript. Your Brain Just Forgets. (Part 2: How JavaScript Waits and Reacts)]]></title>
            <link>https://javascript.plainenglish.io/you-know-javascript-your-brain-just-forgets-part-2-how-javascript-waits-and-reacts-fea788f3650f?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/fea788f3650f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 14:26:02 GMT</pubDate>
            <atom:updated>2026-10-02T01:58:00.363Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sHO83Ui3erZ3A_MXo_WYPw.png" /></figure><h3>Welcome Back</h3><p>In Part 1, we saw how JavaScript thinks: execution contexts, scope, closures, this and prototypes. One thread, one line at a time.</p><p>Which raises the obvious question: if JavaScript can only do one thing at a time, how does it wait for a timer, a click or an API response without freezing the page?</p><p>That’s Part 2: <strong>how JavaScript waits and reacts</strong>. Seven fundamentals, same recipe: a one-line answer, a tiny example and a picture.</p><p><strong>Five minutes before the interview?</strong> Read the one-liners and the <strong>Remember it</strong> lines. Then breathe.</p><p><em>Missed Part 1? </em><a href="https://medium.com/javascript-in-plain-english/you-know-javascript-your-brain-just-forgets-part-1-how-javascript-thinks-73bd7055cfe4?sharedUserId=soniagoplani">https://medium.com/javascript-in-plain-english/you-know-javascript-your-brain-just-forgets-part-1-how-javascript-thinks-73bd7055cfe4?sharedUserId=soniagoplani</a></p><h3>1. Callbacks and Inversion of Control: “Call Me Later”</h3><blockquote><strong><em>In one line:</em></strong><em> a callback is a function passed to another function, to be called later.</em></blockquote><p>It’s like leaving your number at a busy restaurant: “Call me when the table’s ready.” This works because, in JavaScript, functions are values you can pass around.</p><pre>setTimeout(() =&gt; console.log(&quot;2 seconds later&quot;), 2000);</pre><pre>button.addEventListener(&quot;click&quot;, () =&gt; console.log(&quot;Clicked!&quot;));</pre><h3>Callback hell: the pyramid of doom</h3><p>One callback is fine. Callbacks inside callbacks inside callbacks? Your code starts drifting right like it’s trying to leave the screen.</p><pre>createOrder(cart, order =&gt; {<br>  payment(order, receipt =&gt; {<br>    showSummary(receipt, () =&gt; {<br>      updateWallet();<br>    });<br>  });<br>});</pre><h3>Inversion of control: trust issues</h3><p>We just handed our function to createOrder and hoped for the best. What if it calls our callback twice? Or never? Or with the wrong data?</p><p>We’ve given away control of our own code. That’s <strong>inversion of control</strong>.</p><p><strong>Remember it:</strong> Callback hell = deeply nested callbacks. Inversion of control = handing your callback to other code and losing control over when, and how often, it runs.</p><p>Promises fix both. But first, one more kind of callback that interviewers love: events.</p><h3>2. Event Bubbling: The Click That Travels Upstairs</h3><blockquote><strong><em>In one line:</em></strong><em> when you click an element, the event fires on it first, then bubbles up through every parent, all the way to the top.</em></blockquote><p>Drop a pebble in a pond, and the ripples spread outward. Click a button, and the event “ripples” up through its parents.</p><pre>&lt;div id=&quot;grandparent&quot;&gt;<br>  &lt;div id=&quot;parent&quot;&gt;<br>    &lt;button id=&quot;child&quot;&gt;Click me&lt;/button&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Click the button, and listeners fire in this order: <strong>child, then parent, then grandparent.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ByG3tE6QsXQYjfuPgo0sQ.png" /></figure><h3>Capturing: the trip down</h3><p>An event actually makes a round trip:</p><ol><li><strong>Capturing phase:</strong> it travels <strong>down</strong> from the top to the clicked element.</li><li><strong>Target phase:</strong> it reaches the element you clicked.</li><li><strong>Bubbling phase:</strong> it travels back <strong>up</strong> to the top.</li></ol><p>By default, listeners run during bubbling. Pass true (or { capture: true }) as the third argument to listen during capturing instead.</p><pre>parent.addEventListener(&quot;click&quot;, handler);       // bubbling (default)<br>parent.addEventListener(&quot;click&quot;, handler, true); // capturing</pre><p><strong>Memory hook:</strong> capturing <strong>trickles down</strong>, bubbling <strong>bubbles up</strong>.</p><h3>Stopping the bubble</h3><pre>child.addEventListener(&quot;click&quot;, event =&gt; {<br>  event.stopPropagation(); // parents won&#39;t hear about it<br>});</pre><h3>Event delegation: one listener to rule them all</h3><p>Got 100 list items? Don’t add 100 listeners. Add <strong>one</strong> to the parent and let bubbling bring every click to it.</p><pre>list.addEventListener(&quot;click&quot;, event =&gt; {<br>  if (event.target.tagName === &quot;LI&quot;) {<br>    console.log(&quot;You clicked&quot;, event.target.textContent);<br>  }<br>});</pre><p>It saves memory, and it even works for items you add later.</p><p><strong>Interview trap:</strong> event.target is the element you actually clicked. event.currentTarget is the element whose listener is running.</p><p><strong>Remember it:</strong> Events capture down, then bubble up. stopPropagation() stops the trip, and delegation uses bubbling to handle many children with one listener.</p><h3>3. Promises and Error Handling: A Receipt for the Future</h3><blockquote><strong><em>In one line:</em></strong><em> a promise is an object representing the eventual completion or failure of an async operation.</em></blockquote><p>You order food and get a receipt. The food isn’t ready, but the receipt says “it’s coming”, and you decide what to do when it arrives.</p><p><strong>Three states, one direction:</strong></p><ul><li><strong>Pending:</strong> the kitchen is cooking.</li><li><strong>Fulfilled:</strong> your food arrived (a value).</li><li><strong>Rejected:</strong> they ran out of paneer (a reason).</li></ul><p>Once fulfilled or rejected, a promise is <strong>settled</strong>, and it never changes again.</p><h3>How promises fix the trust issues</h3><ul><li><strong>No more inversion of control:</strong> we don’t hand over our function. We attach .then ourselves, and it runs at most once.</li><li><strong>No more pyramid:</strong> every .then returns a new promise, so steps chain in a flat line.</li></ul><pre>createOrder(cart)<br>  .then(order =&gt; payment(order))<br>  .then(receipt =&gt; showSummary(receipt))<br>  .then(() =&gt; updateWallet());</pre><h3>When things go wrong</h3><pre>fetch(&quot;https://api.github.com/users&quot;)<br>  .then(res =&gt; {<br>    if (!res.ok) throw new Error(&quot;Request failed&quot;);<br>    return res.json();<br>  })<br>  .then(data =&gt; console.log(data))<br>  .catch(err =&gt; console.log(err.message))<br>  .finally(() =&gt; console.log(&quot;Done&quot;));</pre><ul><li>One <strong>.catch()</strong> at the end catches an error from <strong>any</strong> step above it.</li><li>A failed step <strong>skips</strong> every .then until the nearest .catch().</li><li><strong>.finally()</strong> runs either way. Perfect for hiding a loader.</li></ul><p><strong>Interview trap:</strong> fetch only rejects on network failure. A 404 or 500 is still &quot;fulfilled&quot;, so always check res.ok.</p><p><strong>Remember it:</strong> Pending, then fulfilled or rejected, and once settled it never changes. One .catch() at the end handles the whole chain.</p><h3>4. Promise APIs: Four Ways to Wait</h3><blockquote><strong><em>In one line:</em></strong><em> </em><em>all needs everyone to succeed, </em><em>allSettled waits for everyone, </em><em>race takes the first to finish, </em><em>any takes the first to succeed.</em></blockquote><p>These four blur together under pressure. So let’s make them a race with three runners.</p><ul><li><strong>Promise.all: everyone or nobody.</strong> Waits for all to succeed and gives you all the values. One failure, and it rejects immediately.</li><li><strong>Promise.allSettled: no one left behind.</strong> Waits for everyone to finish and reports each result with its status. It never rejects.</li><li><strong>Promise.race: first across the line, even if they trip.</strong> Returns the first promise to finish, success or failure.</li><li><strong>Promise.any: first success wins.</strong> Returns the first promise to succeed. If all fail, it rejects with an AggregateError.</li></ul><p><strong>Picture it:</strong> three runners finish in 3, 1 and 2 seconds. The 1-second runner trips.</p><ul><li>all: fails at 1 second.</li><li>allSettled: reports all three at 3 seconds.</li><li>race: fails at 1 second, because the fastest one tripped.</li><li>any: succeeds at 2 seconds with the fastest winner.</li></ul><pre>Promise.all([fetchUsers(), fetchPosts(), fetchComments()])<br>  .then(([users, posts, comments]) =&gt; render(users, posts, comments))<br>  .catch(err =&gt; console.log(err));</pre><p><strong>Interview traps:</strong></p><ul><li>all returns results in <strong>input order</strong>, not finishing order.</li><li>all <strong>fails fast</strong>, the moment one promise rejects.</li><li>any only rejects if <strong>everyone</strong> fails.</li></ul><p><strong>Remember it:</strong> all = everyone or nobody. allSettled = no one left behind. race = first to finish. any = first to succeed.</p><h3>5. The Event Loop: How One Thread Juggles Everything</h3><blockquote><strong><em>In one line:</em></strong><em> when the call stack is empty, the event loop runs all microtasks first, then one callback from the callback queue, and repeats.</em></blockquote><p>JavaScript has one thread. So how does it wait 5 seconds without freezing the page?</p><p>It cheats, beautifully. It borrows superpowers from the <strong>browser</strong>.</p><h3>Web APIs: the browser’s superpowers</h3><p>setTimeout, DOM APIs, fetch, console, localStorage and location are not JavaScript. They&#39;re gifts from the browser, reached through the global window object. (In Node.js it&#39;s global, and globalThis works everywhere.)</p><h3>The journey of a callback</h3><ol><li>JavaScript meets setTimeout, hands the callback to the browser&#39;s timer, and moves on.</li><li>The timer ends, and the callback joins the <strong>callback queue</strong>.</li><li>The <strong>event loop</strong> waits until the <strong>call stack is empty</strong>, then moves the callback onto it.</li></ol><pre>console.log(&quot;Start&quot;);<br>setTimeout(() =&gt; console.log(&quot;Callback&quot;), 0);<br>console.log(&quot;End&quot;);</pre><pre>// Start, End, Callback</pre><p>Even 0 ms has to wait its turn. The delay is a <strong>minimum</strong>, not a promise.</p><h3>The microtask queue: the VIP line</h3><p>Promise callbacks (.then, .catch, and the code after await) skip the regular line. They go to the <strong>microtask queue</strong>, and the event loop empties it <strong>completely</strong> before the callback queue gets a turn.</p><pre>console.log(&quot;Start&quot;);<br>setTimeout(() =&gt; console.log(&quot;Timeout&quot;), 0);<br>Promise.resolve().then(() =&gt; console.log(&quot;Promise&quot;));<br>console.log(&quot;End&quot;);</pre><pre>// Start, End, Promise, Timeout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RITXwxf4zMycgVoWS8c6nw.png" /></figure><p>(In the diagram, Fetched wins because the fetch responds within the 5-second timer.)</p><p><strong>Also known as:</strong> the callback queue is also called the task queue or macrotask queue.</p><h3>Starvation: when the VIPs never leave</h3><p>If a microtask keeps creating new microtasks, the VIP line never empties. The callback queue waits forever. That’s <strong>starvation</strong>.</p><pre>// Don&#39;t run this, it freezes the tab<br>function loop() {<br>  Promise.resolve().then(loop);<br>}<br>loop();<br>setTimeout(() =&gt; console.log(&quot;I never run&quot;), 0);</pre><p><strong>Remember it:</strong> Call stack empty, then all microtasks, then one callback. Repeat. Microtasks that never stop cause starvation.</p><h3>6. Async and Await: It Looks Like Waiting. It Isn’t.</h3><blockquote><strong><em>In one line:</em></strong><em> an </em><em>async function always returns a promise, and </em><em>await pauses only that function until the promise settles.</em></blockquote><ul><li><strong>async</strong> in front of a function means it always returns a promise, even if you return a plain value.</li><li><strong>await</strong> works only inside an async function. It pauses the function and hands you the promise&#39;s value.</li><li>For errors, use a plain <strong>try/</strong><strong>catch</strong>.</li></ul><pre>async function getUsers() {<br>  try {<br>    const res = await fetch(&quot;https://api.github.com/users&quot;);<br>    const data = await res.json();<br>    console.log(data);<br>  } catch (err) {<br>    console.log(err.message);<br>  }<br>}</pre><h3>So does JavaScript wait? Nope.</h3><p>JavaScript waits for none. Watch:</p><pre>async function handlePromise() {<br>  console.log(&quot;Before await&quot;);<br>  const value = await promise; // resolves after 5 seconds<br>  console.log(&quot;After await&quot;, value);<br>}</pre><pre>handlePromise();<br>console.log(&quot;Outside&quot;);</pre><pre>// Before await, Outside, (5 s later) After await</pre><p>Behind the curtain:</p><ol><li>At await, handlePromise <strong>steps off the call stack</strong>.</li><li>The rest of the program carries on.</li><li>The promise resolves, and the function’s remaining code joins the <strong>microtask queue</strong>.</li><li>The event loop puts it <strong>back on the call stack</strong>, right where it left off.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Imc7eY_A63bHte0ZBk1TQ.png" /></figure><p><strong>Speed tip:</strong> two awaits in a row run one after the other. If they don&#39;t depend on each other, run them together:</p><pre>const [users, posts] = await Promise.all([getUsers(), getPosts()]);</pre><p><strong>Remember it:</strong> async/await is promises in nicer clothes. await pauses only its own function, which leaves the call stack and returns through the microtask queue.</p><h3>7. The Runtime and the Engine: Under the Hood</h3><blockquote><strong><em>In one line:</em></strong><em> JavaScript runtime environment = JS engine + Web APIs + callback queue + microtask queue + event loop.</em></blockquote><p>You’ve now met every piece. Put them all in one box, and that box is the <strong>runtime</strong>. The browser is one runtime. <strong>Node.js</strong> is another.</p><p><strong>Interview trap:</strong> Node.js is not an engine. It’s a runtime that uses the V8 engine inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zTUOUVtlYu0M9abdBx9hLQ.png" /></figure><h3>The engines</h3><p>A JS engine is <strong>not a machine. It’s a program</strong>. V8 is written in C++.</p><ul><li><strong>V8:</strong> Chrome, Node.js and modern Edge.</li><li><strong>SpiderMonkey:</strong> Firefox. It was the very first JS engine.</li><li><strong>JavaScriptCore:</strong> Safari.</li><li><strong>Chakra:</strong> old Microsoft Edge.</li></ul><p>V8 and JavaScriptCore are among the fastest.</p><h3>Your code’s journey through the engine</h3><ol><li><strong>Parsing:</strong> code is split into tokens and turned into an <strong>AST</strong> (Abstract Syntax Tree).</li><li><strong>Interpreting:</strong> the interpreter turns the AST into <strong>bytecode</strong> and starts running it.</li><li><strong>JIT compiling:</strong> the just-in-time compiler spots hot code and turns it into fast machine code.</li><li><strong>Executing:</strong> using the <strong>call stack</strong> and the <strong>memory heap</strong>.</li></ol><p>Backstage, the <strong>garbage collector</strong> cleans up unused memory with <strong>mark and sweep</strong>: mark everything still reachable, sweep away the rest.</p><p><strong>Interpreted or compiled?</strong> Both. <strong>JIT</strong> = interpreter + compiler working as a team. <strong>AOT</strong> (ahead-of-time) compiles everything before running.</p><p><strong>Remember it:</strong> Code, then AST, then bytecode, then JIT-optimized machine code. Memory lives in the heap, and garbage collection uses mark and sweep.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LeU79QKSkSZynecPH02oQQ.png" /></figure><h3>Two-Minute Revision: Read This in the Elevator</h3><p>All of Part 2 in 13 lines. Screenshot it, save it, read it on the way in.</p><ul><li><strong>Callback:</strong> a function passed to another function, to be called later.</li><li><strong>Callback hell:</strong> deeply nested callbacks, the pyramid of doom.</li><li><strong>Inversion of control:</strong> handing your callback to other code and losing control over it.</li><li><strong>Event bubbling:</strong> events capture down, then bubble up through every parent.</li><li><strong>Event delegation:</strong> one listener on the parent handles clicks from all its children.</li><li><strong>Promise:</strong> pending, then fulfilled or rejected. Once settled, it never changes.</li><li><strong>Error handling:</strong> one .catch() at the end handles the whole chain. fetch doesn&#39;t reject on a 404.</li><li><strong>Promise APIs:</strong> all everyone or nobody, allSettled no one left behind, race first to finish, any first to succeed.</li><li><strong>Event loop:</strong> when the call stack is empty, run all microtasks, then one callback. Repeat.</li><li><strong>Microtask queue:</strong> the VIP line for promise callbacks, served before the callback queue.</li><li><strong>Starvation:</strong> microtasks keep creating microtasks, so the callback queue never runs.</li><li><strong>Async/await:</strong> await pauses only its own function, which comes back through the microtask queue.</li><li><strong>Runtime:</strong> engine + Web APIs + queues + event loop. Node.js is a runtime, not an engine.</li></ul><h3>One Last Thing</h3><p>That’s the full series: how JavaScript thinks, and how it waits and reacts.</p><p>If a word slips away mid-interview, don’t panic. It’s just sitting in the microtask queue. Give it a second, and it’ll be back on the call stack.</p><p>Save both parts. Share them with someone who has an interview this week. And come back whenever your memory returns undefined.</p><p>You’ve got this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fea788f3650f" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/you-know-javascript-your-brain-just-forgets-part-2-how-javascript-waits-and-reacts-fea788f3650f">You Know JavaScript. Your Brain Just Forgets. (Part 2: How JavaScript Waits and Reacts)</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Know JavaScript. Your Brain Just Forgets. (Part 1: How JavaScript Thinks)]]></title>
            <link>https://javascript.plainenglish.io/you-know-javascript-your-brain-just-forgets-part-1-how-javascript-thinks-73bd7055cfe4?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/73bd7055cfe4</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript-interview]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Wed, 30 Sep 2026 15:06:01 GMT</pubDate>
            <atom:updated>2026-09-30T15:06:01.782Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aLdh21F_r_uCM95TESPZyw.png" /></figure><h3>Before We Begin</h3><p>You’ve shipped features. Fixed bugs at 2 a.m. Reviewed a mountain of pull requests.</p><p>Then the interviewer smiles and asks, “So, what’s the temporal dead zone?”</p><p>And your brain returns… undefined.</p><p>Or it’s closures. Or Promise.race. Or starvation. Or inversion of control.</p><p><em>Quick check: if you just answered all of those in your head, congratulations. Close this tab and go get a coffee, you’ve earned it. Still here? Welcome. You’re in very good company.</em></p><p>This isn’t a knowledge problem. It’s a recall problem. We use these things every day. We just stop calling them by their names.</p><p>So here’s your cheat sheet, in two parts. Part 1 is how JavaScript thinks: 11 fundamentals, each with a one-line answer, a tiny example and a picture.</p><p><strong>Five minutes before the interview?</strong> Just read the one-liners at the top of each section and the <strong>Remember it</strong> lines.</p><p>Let’s go.</p><h3>1. JavaScript and the Execution Context: Where It All Begins</h3><blockquote><strong><em>In one line:</em></strong><em> JavaScript is a synchronous, single-threaded language, and all code runs inside an execution context.</em></blockquote><p>Picture JavaScript as a chef with one pair of hands. One dish at a time, in order. No multitasking, no skipping ahead.</p><h3>The kitchen: execution context</h3><p>Every program gets one big kitchen, the <strong>Global Execution Context</strong>. It’s set up in two phases:</p><ol><li><strong>Memory phase (gather the ingredients):</strong> variables and functions get memory as key-value pairs. Variables start as undefined.</li><li><strong>Code phase (start cooking):</strong> code runs one line at a time.</li></ol><p>Call a function, and a new mini kitchen opens inside the big one. When the function returns, it closes.</p><pre>var n = 10;</pre><pre>function square(num) {<br>  var ans = num * num;<br>  return ans;<br>}</pre><pre>square(n);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-PbisFTzNhmRuIroG-Oyg.png" /></figure><p>Memory side = <strong>Variable Environment</strong>. Code side = <strong>Thread of Execution</strong>. (The diagram shows n: 10, which is memory after the code has run.)</p><p><strong>Remember it:</strong> Two phases, memory then code. Every function call gets its own execution context, which disappears when it returns.</p><h3>2. Hoisting: Using Things Before You Write Them</h3><blockquote><strong><em>In one line:</em></strong><em> variables and functions get memory before the code runs, so you can use them before they’re declared.</em></blockquote><p>Think of a restaurant that reserves your table before you arrive. The table is ready, but the chair is empty. That empty chair is undefined.</p><p>Functions are the VIP guests. They arrive fully seated, so calling them early works.</p><pre>console.log(n);   // undefined<br>greet();          // &quot;Hello!&quot;</pre><pre>var n = 10;</pre><pre>function greet() {<br>  console.log(&quot;Hello!&quot;);<br>}</pre><p><strong>Remember it:</strong> Hoisting = memory first, code later. var gives undefined early, functions work fully.</p><h3>3. let, const and the Temporal Dead Zone: The Waiting Room</h3><blockquote><strong><em>In one line:</em></strong><em> </em><em>let and </em><em>const are hoisted too, but you can&#39;t touch them until their line runs.</em></blockquote><p>var is the relaxed guest: &quot;I&#39;m here, I&#39;m just empty.&quot;</p><p>let and const sit in a waiting room from the moment they&#39;re hoisted until their line runs. That waiting room is the <strong>temporal dead zone</strong>. Call them out early, and JavaScript throws an error.</p><pre>console.log(a); // undefined<br>console.log(b); // ReferenceError: Cannot access &#39;b&#39; before initialization</pre><pre>var a = 10;<br>let b = 20;</pre><p><strong>Interview trap: two errors that look alike</strong></p><ul><li>Cannot access &#39;b&#39; before initialization: it exists, it&#39;s just still in the waiting room.</li><li>b is not defined: it was never declared at all.</li></ul><p><strong>Remember it:</strong> The temporal dead zone is the time between hoisting and initialization of let and const. Access them there, and you get a ReferenceError.</p><h3>4. Scope and the Scope Chain: Who Can See What</h3><blockquote><strong><em>In one line:</em></strong><em> scope is where a variable can be used, and it’s decided by where the code is written.</em></blockquote><p>Think of rooms inside rooms. A child room can peek into its parent’s room, all the way out to the front door. But a parent can never peek into the child’s room.</p><p>“Lexical” sounds fancy, but it only means <strong>where the code physically sits</strong>.</p><ul><li><strong>Lexical environment</strong> = local memory + a reference to the parent’s lexical environment.</li><li><strong>Scope chain</strong> = the path JavaScript follows to find a variable: own room, then parent, then all the way to global.</li></ul><pre>function a() {<br>  var x = 7;</pre><pre>  function c() {<br>    console.log(x); // 7, found in the parent&#39;s room<br>  }</pre><pre>  c();<br>}</pre><pre>a();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OCpmXGxbm76DyPxLqyzZ7g.png" /></figure><p><strong>Fun fact:</strong> even an empty JavaScript file gets a global execution context. In the browser, you also get a free window object and a this that points to it.</p><p><strong>Remember it:</strong> Lexical environment = local memory + parent’s reference. Following those references upward is the scope chain.</p><h3>5. Block Scope and Shadowing: What Happens Inside { }</h3><blockquote><strong><em>In one line:</em></strong><em> </em><em>let and </em><em>const stay inside the curly braces. </em><em>var escapes.</em></blockquote><p>A <strong>block</strong> is code wrapped in { }, also called a <strong>compound statement</strong>. It lets you put many statements where JavaScript expects just one, like after an if.</p><p>Inside a block, let and const get their own private memory space. var doesn&#39;t care about walls. It walks right out.</p><pre>{<br>  var a = 10;<br>  let b = 20;<br>}</pre><pre>console.log(a); // 10, var escaped<br>console.log(b); // ReferenceError, let stayed inside</pre><h3>Shadowing: the inner one wins</h3><p>Same name inside and outside a block? Inside the block, the inner variable “shadows” the outer one. Outside, the outer one is untouched.</p><pre>let b = 100;</pre><pre>{<br>  let b = 20;<br>  console.log(b); // 20<br>}</pre><pre>console.log(b); // 100</pre><h3>Illegal shadowing: when var breaks the rules</h3><pre>let a = 10;</pre><pre>{<br>  var a = 20; // SyntaxError: Identifier &#39;a&#39; has already been declared<br>}</pre><p>var tries to escape the block and crashes into the let that already lives outside. (The reverse, var outside and let inside, is perfectly legal.)</p><p><strong>Remember it:</strong> Block = code in { }. Shadowing = the inner variable hides the outer one. Shadowing a let with a var is illegal.</p><h3>6. Closures: The Function With a Backpack</h3><blockquote><strong><em>In one line:</em></strong><em> a closure is a function bundled together with its lexical environment.</em></blockquote><p>When a function leaves home, it packs a backpack with every variable it could see. Even after its parent function is long gone, the backpack stays on.</p><pre>function x() {<br>  var a = 7;<br>  function y() {<br>    console.log(a);<br>  }<br>  a = 100;<br>  return y;<br>}</pre><pre>var z = x();   // x is done and gone<br>z();           // 100</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOUD5XnTPtgzIj_20hPQyA.png" /></figure><p><strong>Plot twist:</strong> it prints 100, not 7. The backpack holds <strong>references</strong>, not photocopies. Change the value, and the closure sees the change.</p><h3>The famous setTimeout loop</h3><pre>for (var i = 1; i &lt;= 3; i++) {<br>  setTimeout(() =&gt; console.log(i), i * 1000);<br>}<br>// 4, 4, 4</pre><pre>for (let i = 1; i &lt;= 3; i++) {<br>  setTimeout(() =&gt; console.log(i), i * 1000);<br>}<br>// 1, 2, 3</pre><p>With var, all three callbacks share one i. With let, every loop round gets its own fresh i.</p><h3>Data hiding: a secret only the closure knows</h3><pre>function createCounter() {<br>  let count = 0;<br>  return () =&gt; ++count;<br>}</pre><pre>const counter = createCounter();<br>counter(); // 1<br>counter(); // 2<br>// nobody outside can touch count</pre><p><strong>Where you’ll meet closures:</strong> the module pattern, currying, once, memoize, async state, setTimeout and iterators.</p><p><strong>One caution:</strong> a backpack you never take off gets heavy. Closures keep variables alive, so careless use can hold memory longer than needed.</p><p><strong>Remember it:</strong> A closure remembers the variables from where it was written, even after the outer function has returned. It holds references, not copies.</p><h3>7. Currying: One Argument at a Time</h3><blockquote><strong><em>In one line:</em></strong><em> currying turns </em><em>f(a, b) into </em><em>f(a)(b), and it works because of closures.</em></blockquote><p>Ordering coffee: “Size?” Large. “Milk?” Oat. “Sugar?” None. One question at a time, and the barista remembers every answer. That memory is a closure.</p><pre>const add = a =&gt; b =&gt; a + b;</pre><pre>add(2)(3);             // 5</pre><pre>const addTwo = add(2); // a = 2 is remembered<br>addTwo(10);            // 12</pre><p><strong>Where it helps:</strong> reusing a function with some arguments already fixed, like addTwo above.</p><p><strong>Remember it:</strong> Currying = one argument at a time, powered by closures.</p><h3>8. The this Keyword: It Depends Who’s Asking</h3><blockquote><strong><em>In one line:</em></strong><em> </em><em>this is decided by </em><strong><em>how</em></strong><em> a function is called, not where it is written.</em></blockquote><p>this is like the word &quot;here&quot;. Where &quot;here&quot; points depends on where you&#39;re standing when you say it.</p><p><strong>Where does </strong><strong>this point?</strong></p><ul><li><strong>Global scope:</strong> the global object (window in the browser).</li><li><strong>Inside a regular function call:</strong> undefined in strict mode, window otherwise.</li><li><strong>Inside a method, </strong><strong>obj.fn():</strong> the object before the dot.</li><li><strong>Inside an arrow function:</strong> it has no this of its own, so it borrows one from the surrounding code.</li><li><strong>With </strong><strong>call, </strong><strong>apply or </strong><strong>bind:</strong> whatever you choose.</li><li><strong>Inside an event listener (regular function):</strong> the element that received the event.</li></ul><pre>const user = {<br>  greet() {<br>    console.log(this === user);<br>  }<br>};</pre><pre>user.greet();            // true, called with user before the dot</pre><pre>const greet = user.greet;<br>greet();                 // false, the object got left behind</pre><p><strong>Interview trap:</strong> copy a method into a variable, and it forgets its object. this is not stored with the function, it&#39;s decided at every call.</p><p><strong>Remember it:</strong> this is decided at call time. Quick trick: look left of the dot.</p><h3>9. Arrow Functions: Short, Sweet, and Borrowing Their this</h3><blockquote><strong><em>In one line:</em></strong><em> arrow functions are a shorter way to write functions, and they don’t have their own </em><em>this.</em></blockquote><pre>// Regular function<br>function square(n) {<br>  return n * n;<br>}</pre><pre>// Arrow function<br>const squareArrow = n =&gt; n * n;</pre><p>An arrow function is like a guest who never brings their own umbrella. When it rains, they share yours. Their this is whatever this was around them when they were written.</p><h3>Where that actually helps</h3><pre>const timer = {<br>  seconds: 0,<br>  start() {<br>    setTimeout(function () {<br>      console.log(this.seconds); // undefined, this is not timer<br>    }, 1000);</pre><pre>    setTimeout(() =&gt; {<br>      console.log(this.seconds); // 0, borrowed from start()<br>    }, 1000);<br>  }<br>};</pre><pre>timer.start();</pre><h3>How arrows are different</h3><ul><li><strong>No own </strong><strong>this.</strong> It comes from the surrounding code. This is called <strong>lexical </strong><strong>this</strong>.</li><li><strong>call, </strong><strong>apply and </strong><strong>bind can&#39;t change it.</strong></li><li><strong>No </strong><strong>arguments object.</strong> Use rest parameters, (...args), instead.</li><li><strong>Can’t be used with </strong><strong>new.</strong> They are not constructors.</li><li><strong>Not hoisted like function declarations.</strong> They live in a variable, so a const arrow sits in the temporal dead zone until its line runs.</li></ul><p><strong>Interview trap:</strong> don’t write object methods as arrow functions. They won’t see the object as this.</p><p><strong>Remember it:</strong> Arrow functions are shorter, and they borrow this from where they are written.</p><h3>10. call, apply and bind: Choosing Your this</h3><blockquote><strong><em>In one line:</em></strong><em> </em><em>call and </em><em>apply run a function right now with the </em><em>this you choose. </em><em>bind gives you a new function with </em><em>this locked in.</em></blockquote><p>Now that this makes sense, here are the three ways to take control of it.</p><pre>const person = { name: &quot;Sonia&quot; };</pre><pre>function greet(greeting, mark) {<br>  console.log(greeting + &quot;, &quot; + this.name + mark);<br>}</pre><pre>greet.call(person, &quot;Hello&quot;, &quot;!&quot;);    // Hello, Sonia!<br>greet.apply(person, [&quot;Hello&quot;, &quot;!&quot;]); // Hello, Sonia!</pre><pre>const later = greet.bind(person);<br>later(&quot;Hi&quot;, &quot;!&quot;);                    // Hi, Sonia!</pre><p><strong>The ABC trick:</strong></p><ul><li><strong>C</strong>all = <strong>C</strong>omma-separated arguments.</li><li><strong>A</strong>pply = <strong>A</strong>rray of arguments.</li><li><strong>B</strong>ind = <strong>B</strong>rings back a new function for later.</li></ul><p><strong>Bonus:</strong> give bind some arguments up front, and you get <strong>partial application</strong>, currying&#39;s close cousin.</p><pre>const multiply = (a, b) =&gt; a * b;<br>const double = multiply.bind(null, 2);<br>double(5); // 10</pre><p><strong>Remember it:</strong> call and apply run now, bind returns a function for later. None of them can change an arrow function&#39;s this.</p><h3>11. Prototypes: JavaScript’s Family Tree</h3><blockquote><strong><em>In one line:</em></strong><em> every object has a hidden link to another object, its </em><strong><em>prototype</em></strong><em>, and JavaScript follows that chain to find properties the object doesn’t have itself.</em></blockquote><p>Your wallet is empty, so you ask your parent. Their wallet is empty too, so they ask your grandparent. That’s the <strong>prototype chain</strong>.</p><p>Ever wondered where push comes from? You never wrote it.</p><pre>const arr = [1, 2, 3];<br>arr.push(4); // push lives on Array.prototype, not on arr</pre><p>The chain: arr → Array.prototype → Object.prototype → null. When the chain reaches null, JavaScript gives up and returns undefined.</p><h3>Building your own family tree</h3><pre>const animal = {<br>  eat() { console.log(&quot;Eating&quot;); }<br>};</pre><pre>const dog = Object.create(animal); // animal is dog&#39;s prototype<br>dog.bark = () =&gt; console.log(&quot;Woof&quot;);</pre><pre>dog.bark(); // found on dog itself<br>dog.eat();  // not on dog, found on its prototype</pre><p>This is <strong>prototypal inheritance</strong>: objects inheriting directly from other objects.</p><p><strong>Sound familiar?</strong> It works just like the scope chain. The scope chain finds variables, and the prototype chain finds properties.</p><h3>The two names that confuse everyone</h3><ul><li><strong>__proto__</strong> is the link every object has to its prototype. (The modern way to read it is Object.getPrototypeOf(obj).)</li><li><strong>prototype</strong> is a property on functions and classes. Objects created with new get linked to it.</li></ul><pre>class Person {<br>  greet() { console.log(&quot;Hi&quot;); }<br>}</pre><pre>const sonia = new Person();<br>Object.getPrototypeOf(sonia) === Person.prototype; // true</pre><p><strong>Interview trap:</strong> classes in JavaScript are syntactic sugar. Under the hood, it’s prototypes all the way down.</p><p><strong>Remember it:</strong> Every object links to a prototype. JavaScript walks that chain to find properties, ending at null.</p><h3>Two-Minute Revision: Read This in the Elevator</h3><p>All of Part 1 in 16 lines. Screenshot it, save it, read it on the way in.</p><ul><li><strong>JavaScript:</strong> a synchronous, single-threaded language.</li><li><strong>Execution context:</strong> built in two phases, memory creation and code execution.</li><li><strong>Function call:</strong> creates a new execution context, deleted when the function returns.</li><li><strong>Hoisting:</strong> memory is given before code runs, so var gives undefined early and functions work fully.</li><li><strong>Temporal dead zone:</strong> the time between hoisting and initialization of let and const.</li><li><strong>Lexical environment:</strong> local memory plus a reference to the parent’s lexical environment.</li><li><strong>Scope chain:</strong> the chain of lexical environments JavaScript follows to find a variable.</li><li><strong>Block scope:</strong> let and const stay inside { }, var leaks out.</li><li><strong>Shadowing:</strong> an inner variable hides an outer one. Shadowing a let with a var is illegal.</li><li><strong>Closure:</strong> a function bundled with its lexical environment. It remembers references, not copies.</li><li><strong>Currying:</strong> f(a, b) becomes f(a)(b), powered by closures.</li><li><strong>this:</strong> decided at call time. Look left of the dot.</li><li><strong>Arrow functions:</strong> shorter, with no own this. They borrow it from where they&#39;re written.</li><li><strong>call, apply, bind:</strong> comma-separated, array, and a new function for later.</li><li><strong>Prototype chain:</strong> objects link to prototypes, and JavaScript walks the chain to find properties, ending at null.</li><li><strong>Classes:</strong> syntactic sugar over prototypes.</li></ul><h3>One Last Thing</h3><p>If a word slips away mid-interview, don’t panic. Your brain didn’t delete it. It’s just in the temporal dead zone for a moment.</p><p>Take a breath. Picture the boxes, the backpack and the VIP line. Start with the one-liner, and the rest will follow.</p><p><strong>Coming up in Part 2, How JavaScript Waits and Reacts:</strong> callbacks, event bubbling, promises, the event loop, async/await, and a peek under the engine’s hood.</p><p>Save this. Share it with someone who has an interview this week. Come back whenever your memory returns undefined.</p><p>You’ve got this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73bd7055cfe4" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/you-know-javascript-your-brain-just-forgets-part-1-how-javascript-thinks-73bd7055cfe4">You Know JavaScript. Your Brain Just Forgets. (Part 1: How JavaScript Thinks)</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular turns 10 this year, and I’ve been along for 8 of those.]]></title>
            <link>https://medium.com/@soniagoplani/angular-turns-10-this-year-and-ive-been-along-for-8-of-those-4f0b9f83a050?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f0b9f83a050</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Tue, 22 Sep 2026 09:05:49 GMT</pubDate>
            <atom:updated>2026-09-22T09:05:49.255Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*qVuCf2S76EkkJT517inYPg@2x.jpeg" /></figure><p>Thinking back, it’s wild how much of my “growth as a developer” is really just Angular quietly forcing me to unlearn my own bad habits. I’d get comfortable with a pattern, ship it everywhere, feel very clever about it – and then the framework would evolve and gently point out that there was a better way all along.</p><p>NgModules taught me structure, then Standalone Components taught me I didn’t need half of that structure. RxJS taught me to think in streams, then Signals taught me I didn’t need to wrap every single thing in one. Zone.js quietly did its job for years, and now Zoneless is asking why we needed it at all. Even the build tooling went through its own glow-up – watching compile times drop with ESBuild after years of Webpack patience felt like the framework returning a favor.</p><p>And now the story’s rhyming again. Just when I thought I’d caught up with Signals and zoneless change detection, AI walked in and started rewriting the rules once more – MCP servers letting Angular apps talk directly to AI tools and agents, AI-assisted scaffolding, code review, even architecture decisions. A decade ago the big question was “how do I structure my modules.” Today it’s “how does my frontend reason with an AI agent in the loop.” Same restlessness, new frontier.</p><p>None of it ever felt like the ground shifting under me. It felt more like the framework growing up alongside the apps I was building – and every version genuinely made the code I was already proud of a little easier to maintain, a little faster, a little less “clever” in the bad way.</p><p>Ten years in, Angular v22, AI in the mix, and somehow it still manages to make “how did we ever do it the old way” a recurring feeling instead of a one-time thing.</p><p>Here’s to a decade of Angular making us better developers, sometimes against our own will. 🎉</p><p>What’s the Angular shift that changed how you build?</p><p>#Angular10Years #Angular #WebDevelopment #frontendDevelopment</p><p>#Angular22</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f0b9f83a050" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular SSR Feels Dry? You Might Be Missing Hydration]]></title>
            <link>https://medium.com/@soniagoplani/angular-ssr-feels-dry-you-might-be-missing-hydration-d31a32c0e7e9?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d31a32c0e7e9</guid>
            <category><![CDATA[core-web-vitals]]></category>
            <category><![CDATA[server-side-rendering]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[hydration]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 14:06:01 GMT</pubDate>
            <atom:updated>2026-04-24T14:06:01.667Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tIJUFrzts1qOVRPzCNSGQ.png" /></figure><p>Modern web applications sit on a tightrope: you want HTML that search engines and slow networks can consume immediately, yet you also want a rich, interactive client. Server-Side Rendering (SSR) gets you the first half of that story. The second half — making the browser <em>continue</em> from what the server sent instead of throwing it away — is where hydration matters.</p><p>This article walks through that journey in order: what breaks without hydration, how client hydration fixes it, what incremental hydration adds on top, how event replay keeps early clicks honest, and how we apply those ideas in real apps without stepping on sharp edges.</p><h3>The hidden performance problem</h3><p>Picture a typical load. The server sends HTML; the browser paints it; the user briefly sees real content. Then Angular boots, tears the DOM down, and rebuilds it from scratch. Content flashes, layout jumps, and metrics that depend on stability — LCP, CLS, even how “finished” the page feels — take a hit.</p><p>That is SSR <em>without</em> a hydration story that the framework can trust.</p><h3>What actually happens without hydration</h3><p>The sequence is predictable once you’ve seen it once:</p><ol><li>The server renders your app to HTML.</li><li>The browser shows HTML as a static snapshot.</li><li>Angular starts on the client.</li><li>The client discards the server snapshot and reconstructs the tree.</li><li>The user sees flicker, shift, and sometimes worse-perceived performance than a client-only app.</li></ol><p>So you may have improved discoverability with SSR, yet the <em>human</em> still watches the page “reload” under them. That gap between “HTML arrived” and “UI settled” is exactly what hydration is meant to close.</p><h3>Understanding hydration: the server–client handshake</h3><p>Hydration is often described as a handshake: the server renders a meaningful snapshot, and the client agrees to adopt that snapshot instead of replacing it. Angular’s job on the client becomes “attach behaviour and state to what is already there,” not “assume the DOM is empty.”</p><h3>What shows up on the page</h3><p>When hydration is enabled, you will notice a serialised state alongside your markup — commonly a script such as ng-state carrying JSON that the runtime uses to reconcile what the server produced with what the client needs to run. Think of it as a compact set of instructions so the client does not have to guess.</p><pre>&lt;script id=&quot;ng-state&quot; type=&quot;application/json&quot;&gt;<br>{<br>  &quot;components&quot;: { &quot;...&quot;: &quot;...&quot; },<br>  &quot;routes&quot;: { &quot;...&quot;: &quot;...&quot; },<br>  &quot;state&quot;: { &quot;...&quot;: &quot;...&quot; }<br>}<br>&lt;/script&gt;</pre><p>The important idea is not the exact shape of the payload, but the contract: the server and client share enough structure that the UI can stabilise without a destructive second paint.</p><h3>Turning hydration on</h3><p>Wiring it in is intentionally small; the complexity lives in how you structure templates and when you load code.</p><pre>// app.config.ts<br>import { provideClientHydration } from &#39;@angular/platform-browser&#39;;<br><br>export const appConfig: ApplicationConfig = {<br>  providers: [<br>    // ... other providers<br>    provideClientHydration()<br>  ]<br>};</pre><p>At this point, the architecture shift is conceptual more than syntactic: you have told Angular to preserve server output where possible. The next question is whether that preservation shows up where it hurts — in the numbers and in the user’s eye.</p><h3>Real performance impact: numbers don’t lie</h3><p>On a representative app with deferred, below-the-fold UI, flipping hydration on moved a Lighthouse performance score from the high seventies to around ninety in a single run. Your mileage will vary with hardware, throttling, and what else is running on the machine — Lighthouse is a compass, not a guarantee — but the <em>direction</em> is consistent.</p><p>What usually improves together:</p><ul><li>First Contentful Paint and Largest Contentful Paint tighten because the browser is not discarding meaningful paint.</li><li>Total Blocking Time often drops when you avoid wholesale DOM reconstruction.</li><li>Layout shift calms down when the server HTML and the hydrated tree agree.</li></ul><p>So hydration is not only “correctness for SSR.” It is a stability lever: fewer surprises between “HTML visible” and “app live.”</p><h3>Incremental hydration: when “hydrate everything” is too much</h3><p>Full hydration answers the rebuild problem. It does not, by itself, answer when every piece of JavaScript must run. If a block is heavy, below the fold, or rarely interacted with immediately, hydrating it on the first tick still costs time and bytes.</p><p>That is where incremental hydration comes in: you can ship real server-rendered content in the initial HTML while delaying the attachment of a component’s client-side lifecycle, listeners, and bundles — similar in spirit to lazy loading, but aligned with SSR so users see the right markup first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqCeW5bNfBzOK4XH06L3dA.png" /><figcaption>Hydration in Angular Dev Tools</figcaption></figure><h3>Defer vs. incremental hydration in one sentence</h3><p>With a classic @defer + placeholder flow, “view source” often shows a placeholder until the client does more work. With incremental hydration configured, you can arrange for the main template to appear in that HTML and still choose when hydration runs—so you reduce the “placeholder era” without giving up control over when JS wakes up.</p><h3>Enabling it</h3><p>Incremental hydration is applied on top of client hydration:</p><pre>// app.config.ts<br>import {<br>  provideClientHydration,<br>  withIncrementalHydration<br>} from &#39;@angular/platform-browser&#39;;<br><br>export const appConfig: ApplicationConfig = {<br>  providers: [<br>    // ... other providers<br>    provideClientHydration(withIncrementalHydration())<br>  ]<br>};</pre><p>If you add hydrate on … triggers inside @defer Without this flag, Angular will tell you that incremental hydration is required—a useful guardrail while you are wiring things up.</p><h3>Hydration triggers in practice</h3><p>You are choosing when the deferred region becomes a living Angular component, not only when it appears. Examples that map well to product UIs:</p><p>Viewport — hydrate when the user actually scrolls near the region:</p><pre>@defer (on viewport; hydrate on viewport) {<br>  &lt;product-list [products]=&quot;products&quot; /&gt;<br>} @placeholder {<br>  &lt;div class=&quot;loading-placeholder&quot;&gt;Loading products...&lt;/div&gt;<br>}</pre><p>Timer — hydrate after a short delay when you want to prioritise the critical path:</p><pre>@defer (when products(); hydrate on timer(5s)) {<br>  &lt;product-list [products]=&quot;products()&quot; /&gt;<br>}</pre><p>(products here stands in for whatever boolean or data signal you use once your HTTP resource or store has resolved.)</p><p>Never — keep markup static when there is nothing to wire up (pure presentation):</p><pre>@defer (when products(); hydrate never) {<br>  &lt;product-display [products]=&quot;products()&quot; /&gt;<br>}</pre><p>The through-line is the same: the server paints the truth, the client chooses the moment to pay for interactivity.</p><h3>Event replay: clicks that arrive “too early”</h3><p>Timer-based hydration raises an obvious question: what if someone scrolls to a deferred block and taps Add to cart before the timer fires? Without help, that click would land on inert markup.</p><p>Angular’s event replay answers that: user actions that occur before hydration can be recorded and replayed once listeners exist. In practice, the button “just works,” even though the component was not fully live at click time — a strong fit for e-commerce and dashboards where people do not wait for animations to finish.</p><p>You can also combine event replay with full hydration if your concern is “first input before hydration completes,” not only incremental regions:</p><pre>import { withEventReplay } from &#39;@angular/platform-browser&#39;;<br><br>export const appConfig: ApplicationConfig = {<br>  providers: [<br>    provideClientHydration(withEventReplay())<br>  ]<br>};</pre><p>So incremental hydration gives you scheduling; event replay gives you safety when humans are faster than your timers.</p><h3>Real-world implementation strategies</h3><p>With primitives in place, most teams converge on a few patterns.</p><h3>Progressive enhancement</h3><p>Hydrate what the user needs first; defer the rest.</p><pre>&lt;app-navigation /&gt;<br><br>@defer (on viewport; hydrate on viewport) {<br>  &lt;product-list [products]=&quot;products&quot; /&gt;<br>}<br><br>@defer (when recommendations(); hydrate on timer(3s)) {<br>  &lt;recommendations-widget [data]=&quot;recommendations()&quot; /&gt;<br>}</pre><h3>Content-heavy pages</h3><p>Keep long-form reading static; hydrate only the social or interactive chrome.</p><pre>@defer (when article(); hydrate never) {<br>  &lt;article-content [article]=&quot;article()&quot; /&gt;<br>}<br><br>@defer (on viewport; hydrate on viewport) {<br>  &lt;comments-section [articleId]=&quot;articleId&quot; /&gt;<br>}</pre><h3>E-commerce</h3><p>Details above the fold stay “hot”; carousels and reviews hydrate on visibility or interaction.</p><pre>&lt;product-details [product]=&quot;product&quot; /&gt;<br><br>@defer (on viewport; hydrate on viewport) {<br>  &lt;related-products [categoryId]=&quot;product.categoryId&quot; /&gt;<br>}<br><br>@defer (on interaction; hydrate on interaction) {<br>  &lt;product-reviews [productId]=&quot;product.id&quot; /&gt;<br>}</pre><p>Across all three, the design question is the same: what must be alive on first meaningful interaction, and what can wait?</p><h3>Gotchas that undo good intentions</h3><p>Hydration assumes the server HTML and the client template match. When they drift, you debug instead of shipping.</p><h3>Avoid direct DOM surgery</h3><p>Bypassing Angular to mutate the tree under hydrated regions breaks reconciliation. Prefer bindings, structural directives, and templates over innerHTML, ad-hoc appendChild, and similar patterns in hydrated subtrees.</p><h3>Keep HTML valid</h3><p>Invalid structures (for example, tables without tbody where the browser implicitly repairs the tree) can produce different shapes on the server and the client. Small markup sins become large hydration headaches.</p><h3>Separate data loading from @defer semantics</h3><p>@if / httpResource loading and error branches describe your API state. @defer describes when to load or hydrate UI. Mixing the two without a clear story produces confusing placeholders—decide which layer owns “waiting for data” and which owns “waiting for the right time to activate JS.”</p><h3>Skip hydration deliberately when you must</h3><p>For islands that are intentionally client-only or incompatible with reconciliation, ngSkipHydration opt a host out so Angular can rebuild that subtree without pretending continuity.</p><pre>@Component({<br>  selector: &#39;app-static-content&#39;,<br>  template: `&lt;div&gt;Static content only&lt;/div&gt;`,<br>  host: {<br>    &#39;ngSkipHydration&#39;: &#39;true&#39;<br>  }<br>})<br>export class StaticContentComponent {}</pre><p>Use this as a scalpel, not a default: every skip is a place where you accept a full client render for that subtree.</p><h3>Debugging and proving it in production</h3><p>When something looks wrong, Angular DevTools can show which components are hydrated and overlays for hydrated regions — fast feedback when you are comparing “server HTML” vs “client expectations.”</p><p>Beyond the overlay, treat hydration like any other performance feature: instrument it. Time-to-interactive for critical routes, hydration error rates, and bundle deltas for deferred chunks tell you whether your triggers match real behaviour.</p><pre>export class HydrationPerformanceService {<br>  private readonly hydrationStart = performance.now();<br><br>  onHydrationComplete(): void {<br>    const duration = performance.now() - this.hydrationStart;<br>    // Send to analytics, RUM, or your observability stack<br>    console.log(`Hydration completed in ${duration}ms`);<br>  }<br>}</pre><h3>Where this leaves us</h3><p>SSR gives crawlers and users an early, meaningful HTML response. Hydration stops the client from paying twice for the same paint. Incremental hydration schedules when interactivity and bundles attach, and event replay keeps early gestures honest.</p><p>A practical rollout path: enable client hydration, measure Core Web Vitals and perceived stability, then introduce incremental triggers where profiling shows heavy or late regions. Along the way, keep templates valid, keep DOM changes inside Angular, and reserve skip-hydration for true exceptions.</p><p>Performance work is never only about milliseconds — it is about whether the page feels like one continuous experience instead of two competing renders. Hydration is how you make SSR feel like a single story from server to browser.</p><p>Do try out, and if this helped you understand SSR and hydration more clearly, feel free to give it a clap 👏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d31a32c0e7e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular @defer: Lazy Execution, But Why Is the Chunk Downloaded Early?]]></title>
            <link>https://medium.com/@soniagoplani/angular-defer-lazy-execution-but-why-is-the-chunk-downloaded-early-c3a84aa5f955?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3a84aa5f955</guid>
            <category><![CDATA[defer-block]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[lazy-loading]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Mon, 20 Apr 2026 04:31:05 GMT</pubDate>
            <atom:updated>2026-04-20T04:31:05.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ejm9X7vPLaNg-HUonvHDw.png" /></figure><h3>The polite page that still ordered dessert for the whole table</h3><p>Picture a restaurant. You order just soup — but the kitchen quietly starts preparing every course anyway, “just in case.”</p><p>You don’t see it. The table feels calm. But in the kitchen, everything is already in motion.”</p><p>That’s exactly what happens in modern web apps, and that is the everyday reason that @defer exists: a way to say that this part of the screen can wait within a single route.</p><h3>@defer in a nutshell (so we can move on to the plot twist)</h3><p>Think of @defer as a timer and a bouncer for a chunk of template:</p><ul><li>Heavy UI goes inside @defer { ... }.</li><li>@placeholder is the polite “reserved seat”, so nothing jumps when the heavy piece is not there yet.</li><li>@loading is “the JavaScript file for that piece is on its way” (not your API spinner—that is a different story).</li><li>@error is “the file never arrived; show a fallback.”</li><li>Triggers decide when the bouncer lets the real component in: scroll into view (viewport), click or tap (interaction), hover, idle time, a timer, a when condition, or you can add prefetch When you <em>want</em> to start the download early on purpose.</li></ul><p>One sentence takeaway: @defer splits one screen into “now” and “later” so the browser is not forced to treat every widget as first-class on the first breath of the page.</p><h3>Why Lighthouse suddenly smiles (and what it is actually measuring)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*l-iCu5QU_E_9PNhqil0WUA.png" /><figcaption><em>Lighthouse before: high TBT / rough filmstrip; caption: heavy work on the critical path</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*07yFzfCY09MaQHwrjRojag.png" /><figcaption><em>Lighthouse after </em><em>@defer (on viewport): calmer thread / better perceived load; caption: work scheduled to match scroll</em></figcaption></figure><p>Lighthouse (and friends like Total Blocking Time, Speed Index) care a lot about the main thread: “How long was the CPU busy doing JavaScript before the page could breathe?”</p><p>If a giant list runs expensive work as soon as the route loads — tight loops, huge maps, chart code that wakes up on import — the filmstrip looks stuck. TBT looks angry. Even a fast network cannot fix a thread that will not yield.</p><p>Move that work behind a defer trigger that matches real intent — classic example: on viewport for below-the-fold UI.</p><h3>What Users actually see when ‘@defer’ is doing its job</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YbtP21A_072cf6DALysLFQ.png" /></figure><blockquote><strong><em>Case 1: Start timer only when visible</em></strong></blockquote><pre>@defer (on viewport) {<br>  &lt;app-claim-discount-banner class=&quot;container mx-auto my-6&quot; /&gt;<br>} @placeholder {<br>  &lt;div class=&quot;container mx-auto my-6 h-20 rounded-box bg-base-200/50&quot;&gt;&lt;/div&gt;<br>}</pre><blockquote><strong><em>Case 1: Load the products when asked for</em></strong></blockquote><pre> @defer (on viewport) {<br>    &lt;app-products-list [products]=&quot;productsService.products.value()&quot; /&gt;<br>  } @placeholder {<br>    &lt;app-loading-indicator /&gt;<br>  }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzalUDqL1uHQJfQ76r1ZFA.png" /></figure><p>‘@defer’ offers many options when you want to load the chunk, like ‘on timer’, ‘on idle’, ‘on hover’, etc.</p><p>Please visit <a href="https://angular.dev/guide/templates/defer">https://angular.dev/guide/templates/defer</a> to see all the interesting features.</p><h3>The mystery: “It’s lazy… so why did the chunk knock on the door early?”</h3><p>Here is where the story gets interesting — and where modulepreload and chunk preloading walks on stage.</p><p>Most developers quietly assume two timelines stay in sync:</p><ol><li>Download timeline: “Fetch this JS when I said so (trigger or explicit prefetch).”</li><li>Execute timeline: “Run and render when the trigger fires.”</li></ol><p>@defer is excellent at the second one. You can scroll once, watch the console, and see: the heavy component’s constructor still waits. The UI behaves lazy.</p><p>But in some setups people observed something uncanny: in Network (and sometimes in view-source), the lazy chunk for that deferred block still shows up early — sometimes alongside hints like modulepreload—as if the platform had decided this file deserves a head start, even though you did not ask for it prefetch.</p><p>So you get lazy execution, eager-ish download:</p><ul><li>CPU: “We waited. Good.”</li><li>Wire: “We… already started the party?”</li><li>Your mental model (“defer means the file is not in the first wave” — not always true on the network layer).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1n-bZn-_SZUwBCsxDlFPxA.png" /><figcaption><em>Network waterfall: deferred chunk, prefetched not executed untill we scoll</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*16C5-sEeyrzC4gu6GpiVqQ.png" /><figcaption><em>HTML fragment showing </em><em>link rel=&quot;modulepreload&quot; (or similar) for a chunk you expected only after scroll</em></figcaption></figure><h3>Closing</h3><p>@defer is still one of the best ways to tell a page: “Be kind on first contact.” It improves the story Lighthouse tells when the real problem was too much work too soon.</p><p>The modulepreload / early chunk angle is the footnote that keeps you honest: lazy is two questions—when does it run? and when does it download?—and the answers are not always the same. Until they line up again in every toolchain, treat Network + view-source as part of the same review as Lighthouse—so your readers never confuse feeling fast with being light on the wire.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3a84aa5f955" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Core Web Vitals: When Your Site Needs a Checkup (Not Just a Lighthouse Score)]]></title>
            <link>https://medium.com/@soniagoplani/core-web-vitals-when-your-site-needs-a-checkup-not-just-a-lighthouse-score-35af9d462a5b?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/35af9d462a5b</guid>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 14:31:01 GMT</pubDate>
            <atom:updated>2026-04-15T14:31:01.501Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*T5xC19jg1pJHIR5cIEZCXg.png" /></figure><p>A developer walks into a doctor’s office and says, “Doc, my Core Web Vitals are in the red.” The doctor replies, “Have you tried turning caching off and on again?” The developer says, “That’s not how — ” The doctor interrupts: “Also drink water and preload your fonts.” The developer leaves wondering if they just saw a cardiologist or a DevRel.</p><h4>Your site has vitals too</h4><p>We talk about Core Web Vitals the way we talk about blood pressure or resting heart rate: a few numbers that summarize whether something critical is <em>probably</em> fine — or worth a closer look. Google didn’t invent “fast”; they standardized how we measure real-world speed and stability so teams can compare apples to apples, using data from Chrome UX Report (CrUX) — real users on real networks, not only your laptop on Wi‑Fi with a warm cache.</p><p>That matters because your landing page might look flawless locally, then feel like a slideshow on a mid-tier phone. Web Vitals are the vocabulary for that gap. Core Web Vitals are the subset Google has historically treated as especially important for user experience signals (and yes, SEO conversations often follow).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kX-AdR5kDV9o8_r0tjL3CQ.png" /><figcaption>Core Web Vitals for a live website</figcaption></figure><h4>Largest Contentful Paint(LCP) — “The headline loads before the article”</h4><p>Largest Contentful Paint (LCP) is roughly: <em>when did the biggest visible element (often a hero image or big text block) finish rendering?</em><br>Good targets you’ll commonly hear: under ~2.5s for the “good” bucket in field data (CrUX thresholds evolve; always check current docs).</p><p>Classic LCP killers:</p><ul><li>Huge, uncompressed images</li><li>Slow server/TTFB is delaying everything downstream</li><li>Render-blocking resources are delaying the hero</li></ul><p>The emotional truth from real users: if the “main thing” takes too long to appear, people bounce — and bounce rate becomes its own signal that the result wasn’t satisfying.</p><h4>Interaction to Next paint(INP) — “Did the UI acknowledge me?”</h4><p>Interaction to Next Paint (INP) measures responsiveness: from interaction (click/tap/key) to the next paint that shows the UI reacted.<br>Field guidance you’ll often see summarized as: good is typically ≤200ms at the 75th percentile for your pages (treat thresholds as documented by Google, not as trivia).</p><p>Why it feels personal: native apps usually <em>do something immediately</em> when you tap — even if it’s just a spinner. The web feels “broken” when nothing happens, so users double-click, double-submit, rage-refresh. INP catches “the UI is busy elsewhere” problems, often from:</p><ul><li>Long JS tasks on the main thread</li><li>Big hydration/render work after interaction</li><li>Waiting on network before showing <em>any</em> affordance (optimistic UI and instant focus states help)</li></ul><h4>Cumulative layout shift(CLS) — “Stop moving the button while I’m aiming”</h4><p>Cumulative Layout Shift (CLS) measures unexpected layout movement. It’s the metric for the classic ad-loading punchline: you go to tap a link, the page jumps, you tap the wrong thing, and somehow the ad knew.</p><p>Common fixes:</p><ul><li>Width/height (or aspect-ratio) reserved for images and embeds</li><li>Careful font loading strategies (fallback fonts that don’t wildly mismatch metrics)</li><li>Avoid late-injected banners that push content without reserved space</li></ul><h4>FCP &amp; TTFB — “The door opened, but when?”</h4><p>Not always “Core” in the same headline trio, but still hugely explanatory:</p><ul><li><strong>First Contentful Paint (FCP):</strong> first time <em>any</em> content paints — often influenced by HTML/CSS delivery and early rendering.</li><li><strong>Time to First Byte (TTFB):</strong> time until the first byte of the response arrives — mostly server/network, caching, cold starts, SSR cost, etc.</li></ul><p>Syntax’s point is a good engineering instinct: toggling caching can swing lab numbers dramatically; always sanity-check “first visit” vs “warm repeat visit.”</p><h3>How to use this (without chasing a perfect Lighthouse score)</h3><p>Lighthouse / PageSpeed Insights are helpful checkups. They can also trick you: moving from 96 → 100 often means shaving off things users barely notice. That’s fine as a hobby; it’s not always the best use of work time.</p><p>Think in three steps:</p><ol><li>Start with real users (when you can)<br>Look at what <em>actual visitors</em> experience on your worst pages/routes (Search Console “Core Web Vitals”, CrUX, or a RUM tool).<br>Why: it answers “where should we spend a day of engineering?” instead of “what makes a number prettier?”</li><li>Then use your laptop to investigate<br>Open Chrome DevTools → Performance, reproduce the slow path, and find what’s blocking (big tasks, slow network, huge images, etc.).<br>Why: Lab tools are great for understanding <em>why</em> something is slow.</li><li>Fix what people feel first<br>Typical wins: don’t let images/layout jump around, don’t freeze the page after clicks, make the main content show up sooner.</li></ol><p>One sentence to keep your sanity:<br>It’s OK if your site isn’t “perfect” on every metric — if you know what you traded for (a hero video, a font, a richer animation) and real-user data says it’s not causing pain. The goal isn’t an empty page with a green score; the goal is a good experience with eyes open about the cost.</p><blockquote>Core Web Vitals aren’t magic SEO fairy dust; they’re a shared pulse check on whether your site loads its main story, responds like it’s listening, and doesn’t jerk around while people try to use it. Keep your <em>human</em> vitals in range with sleep and hydration — and your <em>site</em> vitals in range with budgets, caching, image discipline, and less main-thread hogging.</blockquote><h4>Try it in the browser: <a href="https://webvitals.com/">WebVitals.com</a></h4><p>If you want to <em>feel</em> what LCP, INP, CLS, FCP, and TTFB mean — not only read definitions — open <a href="https://webvitals.com/">WebVitals.com</a> (built by Sentry). It shows live Web Vitals for your current visit and includes small interactive demos (e.g. slow loading for LCP, slow response for INP, layout shifts for CLS) so you can connect the numbers to what actually happens on screen. Use it alongside Chrome DevTools’ Performance panel and your own site’s field data (CrUX / RUM) so lab demos and real traffic both make sense.</p><p>Do check out your site&#39;s web vitals and see if it raises your heart rate or not.<br><strong>Did you learn something new? If so, hit that clap 👏 button</strong> <strong>and share</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35af9d462a5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Webpack vs esbuild vs Vite: The Evolution of Frontend Build Tools]]></title>
            <link>https://medium.com/@soniagoplani/webpack-vs-esbuild-vs-vite-the-evolution-of-frontend-build-tools-a15193913e30?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/a15193913e30</guid>
            <category><![CDATA[module-bundler]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[esbuild]]></category>
            <category><![CDATA[vites]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 10:49:12 GMT</pubDate>
            <atom:updated>2026-04-14T10:49:12.627Z</atom:updated>
            <content:encoded><![CDATA[<p>I hope you are already aware of module bundlers, and if not, please read the blog <a href="https://medium.com/@soniagoplani/why-module-bundlers-exist-from-an-angular-developers-perspective-badc022518ed">https://medium.com/@soniagoplani/why-module-bundlers-exist-from-an-angular-developers-perspective-badc022518ed</a> and then switch back here to know them in detail.</p><p>Web development has gone through a massive transformation — from simple documents to complex, app-like experiences. The biggest shift has actually been how browsers <em>understand and execute JavaScript</em>.</p><p>The introduction of ES6 (2015) was a turning point, and browsers became smarter.</p><blockquote><em>Rise of Tooling (2015–2020)</em>: Developers started writing <em>modern JS</em>, but browsers couldn’t always understand it. The solution was using transpilers and bundlers.</blockquote><h4>Browser role:</h4><ul><li>Still executes JS</li><li>But tooling prepares code <em>before the browser sees it</em></li></ul><blockquote>At this point, you might be wondering why we’re talking about how browsers understand code instead of diving straight into bundlers. But every good story needs its characters to be introduced first — before the real action begins.</blockquote><p>Imagine you’re commuting to work.</p><p>One route is full of traffic signals, speed breakers, and checkpoints — you eventually reach your destination, but it takes time and patience. That’s how traditional bundlers like Webpack feel.</p><p>The other route is a newly built expressway — smooth, optimised, and designed for speed. No unnecessary stops, just a fast and efficient ride. That’s ESBuild.</p><p>Both get you to the same destination — a bundled JavaScript application —, but the journey is completely different. So what makes one so much faster than the other? Let’s break it down.</p><h3>🧊 Webpack?</h3><p>Webpack is a <strong>module bundler</strong> that builds a dependency graph of your application and bundles everything into optimised files for the browser.</p><p>Webpack’s workflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pir4Esp_GR7h7bQpGBLs0g.png" /></figure><p>&gt;AST(Abstract Syntax Tree)</p><p>Webpack have its own key features</p><p>🌳 <strong>Tree Shaking: </strong>Removes unused code (dead code elimination)</p><p>📦 <strong>Code Splitting / Chunking: </strong>Breaks bundle into smaller chunks</p><p>🔥 <strong>Hot Module Replacement (HMR): </strong>Updates only changed modules without a full reload</p><p>👀 <strong>Watcher: </strong>Watches file changes and rebuilds automatically</p><p>🧭 <strong>Alias: </strong>Custom import paths (cleaner imports)</p><p>🌍 <strong>Supports Multiple Module Types: </strong>ES Modules, CommonJS, AMD</p><p>🧓 <strong>Legacy Compatibility: </strong>Works with older browsers using Babel</p><h3>Performance: Webpack vs ESBuild</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*spA7NqC30lEN8H3hFncH8g.png" /></figure><p>But if we look at the speed, the esbuild website shows this great comparison. Let us understand why this is so.</p><h4>Why is Webpack slow?</h4><h4>🧊Runs on JavaScript, Thinks Like a Builder</h4><p>Webpack feels slow mainly because of the amount of work it does behind the scenes. The first reason is that it is written in <strong>JavaScript</strong> and runs on Node.js. Since Node.js uses a single-threaded event loop, Webpack is not ideal for CPU-heavy tasks. JavaScript is great for handling asynchronous operations, but parsing thousands of files, building dependency graphs, and transforming code is expensive work, especially in large projects.</p><h4>🧊Understanding Your Entire App First</h4><p>Another reason is that Webpack builds a full dependency graph before it can create a bundle. It starts from the entry file and follows every import in the application, then every import inside those files, until it understands the complete structure of the app. In a small project, this is fine, but in a large Angular or React application with hundreds or thousands of files, this process alone can take time because every file must be read, parsed, and analysed.</p><h4>🧊Doing the Same Work Twice</h4><p>A major performance issue comes from the fact that Webpack often ends up parsing the same code more than once. Webpack first parses the source code into an AST so that it can understand it. Then the code is passed to tools like Babel, which transform modern JavaScript into an older version for browser compatibility. After Babel generates the new code, Webpack has to parse it again to continue the bundling process. So the flow becomes parse → transform → parse again. That repeated work adds noticeable overhead, especially in bigger projects.</p><h4>🧊Every File Needs a Translator</h4><p>Loaders also contribute to slower builds. By default, Webpack only understands JavaScript and JSON. If your application uses CSS, SCSS, images, TypeScript, or other file types, Webpack needs loaders to transform them. For example, a CSS file may go through css-loader and thenstyle-loader, while a TypeScript file may go through ts-loader. Every loader adds another processing step, and when several loaders are chained together, the total build time increases.</p><h4>🧊Power Comes with Extra Weight</h4><p>Plugins make Webpack more powerful, but they can also make it slower. Plugins are used for tasks like generating HTML files, minifying code, optimising assets, or injecting environment variables. The problem is that plugins hook into different stages of Webpack’s build lifecycle, so every plugin adds more work to the process. A few simple plugins are usually fine, but a large configuration with many heavy plugins can significantly slow down the build.</p><h4>🧊Build Everything Before You See Anything</h4><p>Webpack is also slower because it bundles everything before serving the application. When you start the development server, Webpack first creates the full bundle and only then shows the app in the browser. This means that for large projects, you often have to wait several seconds before seeing anything.</p><h4>How esbuild Solves Webpack’s Problems:</h4><h4>⚡Speed Starts with the Foundation</h4><p>esbuild is built using <strong>Go</strong>, a compiled language, which allows it to run as native machine code. This makes it naturally fast when handling heavy tasks like parsing files and transforming code. It can also take advantage of multiple CPU cores, which helps it process large projects efficiently without slowing down as the codebase grows.</p><h4>⚡Mapping the Whole App Behind the Scenes</h4><p>esbuild creates a dependency graph by following imports across your application, but it does this in a highly optimised way. It reads and analyses files quickly using efficient internal structures and parallel processing. This ensures that even applications with many files can be processed smoothly without noticeable delays.</p><h4>⚡Single-Pass, No Rework</h4><p>One of the key strengths of esbuild is that it performs parsing and transformation in a single step. Instead of repeatedly analysing the same code, it reads the source, transforms it, and generates output in one flow. This reduces unnecessary work and keeps the build process fast and efficient.</p><h4>⚡Built-In Power, Less Setup</h4><p>esbuild comes with built-in support for many commonly used file types such as JavaScript, TypeScript, CSS, and JSON. This means it can handle these files directly without requiring multiple transformation steps. As a result, the build process becomes simpler and faster, with fewer moving parts involved.</p><h4>⚡Keeping It Simple Under the Hood</h4><p>The plugin system in esbuild is designed to be minimal and efficient. It avoids complex lifecycle hooks and focuses on doing only what is necessary. This simplicity reduces overhead and ensures that additional functionality does not significantly impact performance.</p><h4>⚡From Code to Running App — Fast</h4><p>esbuild is designed to complete builds very quickly, which results in a faster startup experience during development. Instead of waiting for long build steps, developers can see their application running almost immediately, making the development workflow smoother and more responsive.</p><blockquote><strong>Esbuild is not a complete framework because it was never meant to be one. It focuses on doing a small set of tasks extremely well — transforming and bundling code at high speed — while leaving higher-level concerns to other tools. That’s why it is often used under the hood, powering modern development workflows without trying to control them.</strong></blockquote><p>That’s where <strong>Vite</strong> comes into the picture. If you notice the icon of Esbuild, it clearly says <strong>Fast </strong>and if you look at the icon of Vite Its says<strong> lightning Fast</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*Txuqg2UvcvAMOD2Yqe3HbQ.png" /></figure><h4>What is Vite, and why do we need this if we have ESbuild?</h4><p>Vite is a modern frontend build tool that focuses on <strong>speed and developer experience</strong>. It is not a full framework like Vue.js, but it works really well with frameworks and can also be used for plain JavaScript projects. Internally, it combines the strengths of tools like esbuild and Rollup to give you the best of both worlds.</p><h4>Built with esbuild + Rollup</h4><p>Vite uses a hybrid approach:</p><ul><li>During development → uses <strong>esbuild</strong></li><li>During production → uses <strong>Rollup</strong></li></ul><h4>Why Vite Feels So Fast</h4><p>The biggest shift Vite brings is how it uses modern browsers. <strong>Earlier, browsers did not properly support JavaScript modules</strong>, so tools had to bundle everything into a single file before running the app. That meant waiting for a full build even for small changes. <strong>Today, browsers understand ES modules</strong>, so Vite takes advantage of that and skips bundling during development. It simply serves files as they are and transforms them on demand. When you change a file, only that specific module is updated in the browser, which makes the experience feel almost instant.</p><blockquote><a href="https://angular.dev/">Angular</a> has officially integrated <strong>Vite</strong> as its default development server to provide a faster, more modern developer experience. Starting with <strong>Angular 17</strong>, the new build system — which combines <a href="https://vite.dev/">Vite</a> for serving and esbuild for bundling — is enabled by default for all new applications</blockquote><p>At the end of the day, it’s not about choosing one tool over another, but about understanding the trade-offs. Each tool solves a different problem, and knowing when and why to use them is what really makes a difference.<br>Do try it out for yourself and see the difference. Happy Coding !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a15193913e30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Module Bundlers Exist (From an Angular Developer’s Perspective)]]></title>
            <link>https://medium.com/@soniagoplani/why-module-bundlers-exist-from-an-angular-developers-perspective-badc022518ed?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/badc022518ed</guid>
            <category><![CDATA[esbuild]]></category>
            <category><![CDATA[module-bundler]]></category>
            <category><![CDATA[dependency-resolution]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[webpack]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 07:30:04 GMT</pubDate>
            <atom:updated>2026-04-14T07:30:04.876Z</atom:updated>
            <content:encoded><![CDATA[<p>While working with modern Angular and JavaScript tools, we all use module bundlers — sometimes without even realising it.</p><p>But at some point, I paused and asked myself:<br> <strong>What exactly is a bundler? And why do we even need one?</strong></p><h4>🧩 The Problem</h4><p>In real-world projects, we never write everything in a single file.</p><p>Instead, we have:</p><ul><li>Multiple JavaScript files</li><li>Components (App, Header, etc.)</li><li>CSS and styling files</li><li>Images and assets</li><li>Configuration files</li></ul><p>Now imagine loading all of this directly in the browser.</p><p>That would mean <strong>hundreds of separate requests</strong>, which is slow and inefficient.</p><h4>📦 So, what is a Module Bundler?</h4><p>A module bundler is a tool that:</p><ul><li>Starts from your main file</li><li>Follows all its dependencies</li><li>Combines everything into optimised output files (bundles)</li></ul><p>It doesn’t just merge files — it also improves your code along the way.</p><h4>🔍 How Bundlers Actually Work</h4><p>Let’s break it down in a simple flow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-tbwF_2uzztyAbBtpAHSJQ.png" /></figure><p><strong>1. Finding Dependencies(DependencyResolution) </strong>🔗<br> The bundler starts from your entry file and looks for import statements.<br> Then it follows each import, and keeps going until it maps the entire project.</p><p>Think of it like building a <strong>dependency tree</strong>.</p><p><strong>2. Transforming Files(Loaders/transformers)</strong>🔄<br> Whenever the bundler encounters a file (JS, TS, CSS, etc.), it transforms it into something the browser understands.</p><p>Example:</p><ul><li>TypeScript → JavaScript</li><li>SCSS → CSS</li></ul><p><strong>3. Creating the Bundle(Bundling)</strong>📦<br> Finally, it combines everything into one (or a few) optimised files that the browser can load efficiently.</p><p><strong>4. Loading: </strong>The bundled code is loaded into the browser using a script tag. The browser executes the code, and the application starts running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*eXPOHEJXQrhiIyIG9itVGA.png" /></figure><h4>🛠️ Popular Bundlers (and how they feel in real life)</h4><p>Instead of just listing tools, here’s how I personally understood them:</p><h4>🏗️ Webpack — The All-Rounder</h4><p>Webpack is one of the oldest and most trusted bundlers out there.<br> It builds a complete map of your app and gives you full control over how everything is processed.</p><p>The trade-off?<br> You get flexibility, but you also spend time setting things up and managing configurations — especially in larger projects.</p><h4>📦 Parcel — The Plug-and-Play Option</h4><p>Parcel is all about getting started fast.<br> No configs, no setup — just install and run.</p><p>It’s great when you want something that works instantly, but as your project grows, you might start missing deeper control.</p><h4>⚡ esbuild — Speed First</h4><p>esbuild is built for one thing: speed.<br> It processes and bundles code in a single flow, making builds feel almost instant.</p><p>It’s incredibly efficient, but usually works best as a foundation that other tools build on top of.</p><h4>🚀 Vite — The Modern Experience</h4><p>Vite takes a different route by skipping bundling during development.<br> It serves files on demand, which makes the dev server start instantly.</p><p>It feels fast and lightweight, and is quickly becoming a favourite for modern frontend projects.</p><p>When I first heard about bundlers, it felt like a complex topic.<br> But once I understood the <em>problem they solved</em>, everything started making sense. I will talk about these bundlers in detail in upcoming blogs. Stay tuned!!</p><p>If you’re learning frontend deeply, this is one concept that really connects a lot of dots.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=badc022518ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How often do we think of happiness than actually being happy?]]></title>
            <link>https://medium.com/@soniagoplani/how-often-do-we-think-of-happiness-than-actually-being-happy-561c46b687c4?source=rss-ec340cc870d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/561c46b687c4</guid>
            <category><![CDATA[music]]></category>
            <dc:creator><![CDATA[Sonia Goplani]]></dc:creator>
            <pubDate>Fri, 07 Jul 2017 10:08:39 GMT</pubDate>
            <atom:updated>2017-07-07T10:18:57.420Z</atom:updated>
            <content:encoded><![CDATA[<p>What is happiness?</p><p>an idea? or a theory? ,a feeling?</p><p>Whatever it is ,it is something that everyone wants and seeks every moment in their lives.</p><p>So the question that arises in our hearts is “How Can we Be Happy”?</p><p>Whenever we get something that we desire for then we see a pinch of happiness in us ,but how long does that last?</p><p>But there are others ways that give us immense , blissful feelings and its more than happiness..</p><p>What are they??</p><p>Have you seen a child smiling when you give him a chocolate?</p><p>Or have you donated blood to someone in need and seen faces of their family , how much grateful and happy they are.</p><p>such feeling are great!!!</p><p>A conclusion is drawn from this seeing nature of humans ,not by me of course but by researchers</p><p>that Giving is hardwired in us , and it gives us happiness and that’s what is secret of a happy person.</p><p>They think of giving more than they think of getting.</p><p>365 gifts is an idea to adopt in our lives.</p><p>1 thing to give everyday to someone out there in need and a smile they give you back will make your day.</p><p>There is nothing incredible about giving if you have in abundant, speciality lies when we give out something from whatever we have.</p><p>No matter how small it is , you never know what’s so unimportant and not valuable to you can mean a lot to someone else.</p><p>Start with anything giving something, being kind to neighbour , helping a stranger and you could see lives transforming from anxiety and depression to happy.</p><p>Share our stories of sharing in comment box will be happy to hear.</p><p>365 gifts is not my concept , i got inspiration from Jaqueline Way , a mother who taught her 3 year old child art of giving and how to be happy everyday by giving 1 gift each day for 365 days with her son.</p><p>Read below about her-</p><p><a href="http://365give.ca/about-us/">http://365give.ca/about-us/</a></p><p><a href="https://www.youtube.com/watch?v=78nsxRxbf4w&amp;t=675s">https://www.youtube.com/watch?v=78nsxRxbf4w&amp;t=675s</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=561c46b687c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>