<?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 Dan A on Medium]]></title>
        <description><![CDATA[Stories by Dan A on Medium]]></description>
        <link>https://medium.com/@idanka322?source=rss-66d161e9298f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Dan A on Medium</title>
            <link>https://medium.com/@idanka322?source=rss-66d161e9298f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 15:25:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@idanka322/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[The Death of the “Hack”: How Modern CSS and HTML are Eliminating Third-Party Dependencies]]></title>
            <link>https://medium.com/@idanka322/the-death-of-the-hack-how-modern-css-and-html-are-eliminating-third-party-dependencies-4615c777149d?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4615c777149d</guid>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 07:01:36 GMT</pubDate>
            <atom:updated>2026-04-27T07:01:36.653Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-0lHon0QDFg-efOC.png" /></figure><p>The history of frontend development is defined by our attempts to bridge the gap between design vision and browser reality. For over a decade, achieving a fluid “Pinterest-style” layout, managing complex z-index popovers, or creating scroll-synced animations required heavy JavaScript (JS) libraries and performance-draining “hacks.” These solutions often bloated bundle sizes and introduced accessibility hurdles.</p><p>We are entering a new era of the web. The latest updates to the HTML and CSS specifications are moving complex UI logic from the script layer back into the browser’s native engine. This shift improves performance, simplifies codebase maintenance, and ensures that the web remains accessible by default. This article explores ten transformative features that are redefining our development standards in 2026.</p><h3>1. Native CSS Masonry: The End of JavaScript Layout Calculations</h3><p>The Masonry layout where items of varying heights are packed tightly together has been a CSS “holy grail.” Previously, CSS Grid forced items into rigid rows, causing large gaps if one item was taller than its neighbor.</p><h4>The New Standard</h4><p>The proposed grid-template-rows: masonry value allows the browser to automatically place items in the next available space in the column, regardless of the heights of other items in that row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iKEwBbYNUMtRtxdG.png" /></figure><pre>.container {<br>  display: grid;<br>  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));<br>  grid-template-rows: masonry; /* The magic happens here */<br>}</pre><p><strong>Why it matters:</strong> It eliminates the need for JS libraries like Macy.js or complex height-calculation logic. It handles window resizing and reflows natively with the efficiency of the browser’s C++ rendering engine.</p><h3>2. The Popover API: Native Top-Layer Management</h3><p>Managing modals, tooltips, and menus used to mean fighting “z-index wars” and writing complex focus-trapping logic.</p><h4>The Solution</h4><p>The Popover API provides a native way to display elements in the “top layer” a special layer above all other elements in the document, regardless of their z-index or stacking context.</p><pre>&lt;button popovertarget=&quot;my-menu&quot;&gt;Open Menu&lt;/button&gt;<br><br>&lt;div id=&quot;my-menu&quot; popover&gt;<br>  &lt;p&gt;I am rendered in the top layer automatically!&lt;/p&gt;<br>&lt;/div&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*60ocahEKOMzJ6xWk.gif" /></figure><p><strong>Industry Standard:</strong> Use this for 90% of your UI overlays. It handles the “light-discard” behavior (closing on click-outside) and keyboard interactions out of the box.</p><h3>3. Scroll-Driven Animations (SDA)</h3><p>Linking an animation to a user’s scroll position once required heavy event listeners that frequently caused “jank” (visual stuttering).</p><h4>The Implementation</h4><p>With animation-timeline, we can now link CSS Keyframes directly to the scroll progress of a container or the entire viewport.</p><pre>@keyframes progress-grow {<br>  from { scale: 0 1; }<br>  to { scale: 1 1; }<br>}<br><br>.progress-bar {<br>  animation: progress-grow auto linear;<br>  animation-timeline: scroll(root);<br>}</pre><p><strong>Performance Note:</strong> Because this runs on the compositor thread, animations remain butter-smooth even if the main thread is busy with heavy data processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*rPx9zPvLJkhpWXwX.gif" /></figure><h3>4. Name-Only Container Queries</h3><p>We’ve moved past Media Queries (viewport-based) to Container Queries (parent-based). However, “Name-Only” queries allow us to target a specific parent by name, regardless of its size.</p><pre>.sidebar-wrapper {<br>  container-name: sidebar;<br>}<br><br>@container sidebar {<br>  .card {<br>    grid-template-columns: 1fr; /* Specific style only when inside the sidebar */<br>  }<br>}</pre><p><strong>Impact:</strong> This replaces the need for “Context Providers” in frameworks like React just for styling logic. A component can now “know” where it is in the DOM and style itself accordingly.</p><h3>5. Modernizing the Basics: Sticky Positioning and Multi-Column Fixes</h3><h4>Bidirectional Sticky</h4><p>position: sticky has been refined to handle simultaneous axes. This is vital for massive data tables where you need both the header (top) and the first column (left) to remain fixed while scrolling diagonally.</p><h4>Multi-Column Layout (MCL) Updates</h4><p>Updates to column-count and column-gap now handle &quot;orphans&quot; and &quot;widows&quot; (stray lines of text at the start or end of columns) with greater stability, ensuring images don&#39;t break awkwardly across columns in editorial layouts.</p><h3>6. Emerging &amp; Experimental Features</h3><p>While the following are not yet “Production Ready” for all browsers, they represent the immediate future:</p><ul><li><strong>The CSS </strong><strong>random() Function:</strong> Allows for generative art and organic UI variations (e.g., left: random(0, 100vw)) without JS-injected styles.</li><li><strong>HTML in Canvas (</strong><strong>CanvasFormattedText):</strong> Provides a way to render selectable, accessible text inside a &lt;canvas&gt;, merging high-performance graphics with SEO-friendly content.</li><li><strong>::search-text Pseudo-element:</strong> Allows developers to customize the look of the browser’s &quot;Find&quot; (Cmd+F) highlights, ensuring they match brand identity.</li><li><strong>Element-Scoped View Transitions:</strong> Scopes the View Transition API to specific DOM sub-trees rather than the entire page, perfect for smooth “thumbnail-to-hero” animations.</li></ul><h3>Troubleshooting &amp; Best Practices</h3><p><strong>Popover API: </strong>Full Support. <strong>Adopt Now.</strong> Replace custom JS logic.<br><strong>Native Masonry: </strong>Experimental, Use grid with JS fallback (Macy.js).<br><strong>Scroll Animations: </strong>High (Chromium/Safari)Use for progressive enhancement.<br><strong>random()</strong>: Low. Use CSS Variables as a fallback.</p><h3>Summary and Key Takeaways</h3><ul><li><strong>Performance First:</strong> Native browser features always outperform JavaScript-based polyfills.</li><li><strong>Accessibility by Default:</strong> Native APIs like Popover and SDA handle focus management and screen readers better than custom-built solutions.</li><li><strong>Code Deletion:</strong> Many of these updates allow you to remove heavy NPM packages, leading to faster load times.</li></ul><p>The “hacky” era of frontend development is closing. By embracing these native features, we build a web that is faster, more resilient, and significantly easier to maintain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4615c777149d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Magic: A Deep Dive into How React (Really) Works Behind the Scenes]]></title>
            <link>https://medium.com/@idanka322/unveiling-the-magic-a-deep-dive-into-how-react-really-works-behind-the-scenes-959e1aee18d5?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/959e1aee18d5</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Thu, 12 Feb 2026 03:31:27 GMT</pubDate>
            <atom:updated>2026-02-12T03:31:27.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K3wWSN9vn9WGXWho.jpg" /></figure><p>Happy New Year, everyone!</p><p>It’s been a little while since my last deep dive here on Medium. After a whirlwind year of pushing boundaries and collaborating on some truly game-changing projects (more on those in due time!), I took some much-needed time off with the family. Recharging, unplugging, and enjoying those precious moments away from the keyboard has been invaluable. But now, I’m back, refreshed, and incredibly excited to share something I believe will fundamentally elevate your understanding of React.</p><p>For years, React has been the bedrock of modern web development, powering everything from small personal projects to colossal enterprise applications. We often interact with it through its elegant API useState, useEffect, JSX; but how many of us truly understand the intricate dance happening <em>behind</em> that API? What makes React so fast, so declarative, and so resilient?</p><p>Today, we’re pulling back the curtain. We’re not just scratching the surface; we’re diving headfirst into the very engine that powers React. This isn’t just an article; it’s <em>the</em> ultimate entry point for anyone who wants to move beyond simply <em>using</em> React to genuinely <em>understanding</em> it.</p><p>Prepare to unravel the secrets of <strong>React Fiber</strong>, the genius of <strong>Concurrent Mode</strong>, the upcoming revolution of the <strong>React Compiler</strong>, and how all these pieces coalesce to deliver that buttery-smooth user experience we’ve come to expect.</p><p>Let’s begin.</p><h3>The Illusion of Simplicity: What React Does (and Doesn’t Do)</h3><p>At its core, React is a <strong>UI library</strong> for building user interfaces with a declarative paradigm. You describe <em>what</em> your UI should look like for a given state, and React figures out <em>how</em> to make it happen. This “how” is where the magic lies.</p><p>Before React, directly manipulating the DOM was the norm. This was slow, error-prone, and led to complex, imperative code. React introduced the <strong>Virtual DOM</strong>, an in-memory representation of the actual DOM. When your component’s state changes, React doesn’t immediately touch the browser’s DOM. Instead, it:</p><ol><li><strong>Updates its internal Virtual DOM.</strong></li><li><strong>Compares the new Virtual DOM with the previous one (diffing).</strong></li><li><strong>Calculates the minimal set of changes needed to update the real DOM.</strong></li><li><strong>Applies those changes efficiently.</strong></li></ol><p>This approach is powerful, but the Virtual DOM itself isn’t the whole story. The real innovation lies in <em>how</em> React performs steps 2, 3, and 4 especially when dealing with complex, dynamic UIs. This brings us to…</p><h3>React Fiber: The Reconciler That Changed Everything</h3><p>React Fiber is the complete re-implementation of React’s core reconciliation algorithm, introduced in React 16. It’s the beating heart of modern React, and without understanding it, you can’t truly grasp how React manages its workload.</p><p>Think of reconciliation as the process by which React updates the UI to match the latest state. Before Fiber, this process was largely synchronous and interruptible. If a large update came in, React would lock up the main thread until it was done, leading to janky animations and unresponsive UIs.</p><p>Fiber addresses this by introducing a new data structure and a new execution model:</p><h4>1. The “Fiber” Unit of Work</h4><p>A <strong>Fiber</strong> is a plain JavaScript object that represents a unit of work. Every React element (component, DOM node, text node) corresponds to a Fiber. It holds information about:</p><ul><li><strong>Type:</strong> What kind of element it is (e.g., div, MyComponent).</li><li><strong>Props:</strong> The current and next props.</li><li><strong>State:</strong> The current and next state.</li><li><strong>Child, Sibling, Return (Parent) Pointers:</strong> These pointers form a tree structure, much like the component tree, allowing React to traverse it efficiently.</li><li><strong>Effects:</strong> A list of changes (mutations) that need to be applied to the real DOM (e.g., PLACEMENT, UPDATE, DELETION).</li></ul><p>Crucially, Fibers can be thought of as a <strong>stack frame that can be paused, resumed, and even aborted</strong>. This is the key to React’s newfound flexibility.</p><h4>2. Two Phases of Reconciliation</h4><p>Fiber reconciliation operates in two distinct phases:</p><p>a) The Render (or “Reconciliation”) Phase</p><p>This phase is where React performs the computational work of building the Fiber tree, figuring out what needs to change, and identifying effects.</p><ul><li><strong>It’s Asynchronous &amp; Interruptible:</strong> React traverses the Fiber tree, calling component functions, comparing old and new props/state, and determining what needs to be updated. It can pause this work, yield to the browser, and resume later without blocking the main thread. This is a game-changer for UI responsiveness.</li><li><strong>It Does NOT Touch the DOM:</strong> During this phase, React is purely calculating. It’s building a new “work-in-progress” Fiber tree and marking effects. The actual browser DOM remains untouched.</li><li><strong>Outputs a List of Effects:</strong> Once completed, this phase produces a linked list of all the DOM mutations (insertions, updates, deletions) that need to occur.</li></ul><p>Imagine Joe Savona and Josh Story meticulously designing a blueprint for a new building. They’re calculating loads, stress points, and material lists. This is the Render Phase all planning, no construction yet.</p><p>b) The Commit Phase</p><p>This phase is where React takes the list of effects generated in the Render Phase and actually applies them to the browser’s DOM.</p><ul><li><strong>It’s Synchronous &amp; Uninterruptible:</strong> Once React starts committing, it doesn’t stop. It rapidly applies all the necessary DOM mutations. This ensures UI consistency the browser sees a single, atomic update.</li><li><strong>Fires Lifecycle Hooks/Effects:</strong> This is also when componentDidMount, componentDidUpdate, and useLayoutEffect hooks fire (after DOM mutations but before the browser paints), followed by useEffect (after paint).</li></ul><p>Think of Lauren Tan and Sathya Gunasekaran on the construction site, swiftly executing the blueprint. They’re pouring concrete, erecting walls, and installing windows. This has to be done quickly and without interruption to ensure the structure is sound.</p><p>The beauty of Fiber lies in the separation of these two phases. The expensive, potentially time-consuming calculation (Render Phase) can be broken into smaller chunks and spread out over multiple frames, while the actual DOM update (Commit Phase) remains fast and atomic.</p><h3>Concurrent Mode: Embracing Interruptibility</h3><p>Fiber laid the groundwork, and <strong>Concurrent Mode</strong> (now often referred to simply as “concurrent features” within React 18+) is the manifestation of its power. Concurrent React allows React to work on multiple tasks <em>concurrently</em>, prioritizing urgent updates (like user input) over less urgent ones (like fetching data).</p><p>Imagine a scenario:</p><ol><li>A user types into an input field (urgent update).</li><li>Simultaneously, a background data fetch completes, and React needs to render a large list of items (less urgent update).</li></ol><p>In synchronous React, the large list render would block the input, causing a noticeable delay. With Concurrent React:</p><ul><li>React starts rendering the large list.</li><li>The user types; React <em>pauses</em> the list rendering.</li><li>React <em>prioritizes</em> and processes the input event, updating the input field immediately.</li><li>Once the input is handled, React <em>resumes</em> rendering the large list from where it left off, or even discards the old work and restarts if necessary.</li></ul><p>This is enabled by startTransition and useDeferredValue, allowing developers to mark updates as &quot;transitions&quot; (non-urgent) or defer their rendering, respectively. Andrew Clark&#39;s work on this paradigm has been monumental, allowing applications to remain responsive even under heavy load.</p><p>The core idea is <strong>“interruptibility with prioritization.”</strong> React can decide <em>when</em> to render, not just <em>what</em> to render. This leads to significantly smoother user experiences, especially on less powerful devices or with complex applications.</p><h3>The React Compiler: The Future of Performance</h3><p>Now, let’s talk about the absolute frontier of React performance, a project that Joe Savona and Sathya Gunasekaran have been tirelessly championing: the <strong>React Compiler</strong> (formerly known as React Forget).</p><p>The problem: React components re-render whenever their parent re-renders, or their state/props change. To optimize performance, developers have traditionally relied on manual memoization using useMemo and useCallback to prevent unnecessary re-renders of expensive sub-trees.</p><p>The React Compiler aims to make this manual optimization largely obsolete.</p><p><strong>How it works (at a high level):</strong></p><p>The compiler is a Babel transform (and soon, a native part of the React build process) that statically analyzes your React components at <em>build time</em>. It understands:</p><ol><li><strong>React’s Rules of Hooks:</strong> How useState, useEffect, etc., are used.</li><li><strong>JavaScript Semantics:</strong> Which values are pure, which are immutable, and which might change.</li><li><strong>Dependency Tracking:</strong> It can accurately determine the dependencies of every function and expression within your component.</li></ol><p>Based on this analysis, the compiler <em>automatically inserts memoization logic</em> around parts of your component that are safe to memoize. It essentially does the job of useMemo and useCallback for you, but with perfect accuracy and without you having to lift a finger.</p><p>Consider this component:</p><pre>function MyComponent({ user, settings }) {<br>  const greeting = `Hello, ${user.name}!`; // Pure<br>  const config = useMemo(() =&gt; ({<br>    theme: settings.theme,<br>    language: settings.lang<br>  }), [settings.theme, settings.lang]); // Manual memoization today<br><br>return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{greeting}&lt;/h1&gt;<br>      &lt;ChildComponent config={config} /&gt;<br>      &lt;ExpensiveCalculation value={user.id} /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>With the React Compiler, you would write MyComponent naturally, and the compiler would automatically detect that greeting only changes when user.name changes, and that config only changes when settings.theme or settings.lang change. It would then transform your code (behind the scenes) to include the necessary memoization.</p><p>The implications are profound:</p><ul><li><strong>Automatic Performance:</strong> Developers can focus on writing correct, idiomatic React code, and the performance optimizations are applied automatically.</li><li><strong>Reduced Bundle Size:</strong> Less useMemo and useCallback boilerplate.</li><li><strong>Fewer Bugs:</strong> Manual memoization is notoriously tricky; the compiler eliminates a common source of bugs.</li><li><strong>Future-Proofing:</strong> It prepares React for even more advanced optimizations, potentially even automatically optimizing across component boundaries.</li></ul><p>This compiler is arguably the biggest leap in React’s developer experience and performance since Fiber itself. It’s truly a testament to the forward-thinking minds that are constantly pushing the boundaries of what’s possible with UI libraries.</p><h3>Bringing It All Together: A Symphony of Abstraction</h3><p>So, when you type npm start and your React application springs to life, here&#39;s a simplified orchestration of what&#39;s happening:</p><ul><li><strong>Initial Render:</strong> React creates the initial Fiber tree representing your application.</li><li><strong>Commit Phase:</strong> This tree is “committed” to the DOM, making your UI visible.</li><li><strong>State/Prop Updates:</strong> When state or props change, a new render phase begins.</li><li><strong>Prioritization:</strong> Concurrent features allow React to prioritize urgent updates.</li><li><strong>Work In Progress:</strong> React builds a new “work-in-progress” Fiber tree, comparing it to the current one. This can be paused and resumed.</li><li><strong>Compiler Magic:</strong> If enabled, the React Compiler has already memoized parts of your components at build time, significantly reducing the amount of work React needs to do in this phase.</li><li><strong>Effect List:</strong> A list of necessary DOM mutations (effects) is generated.</li><li><strong>Commit Phase (again):</strong> The new Fiber tree replaces the old one, and the effects are swiftly applied to the real DOM.</li><li><strong>Browser Paint:</strong> The browser renders the updated UI.</li></ul><p>This continuous cycle, orchestrated by Fiber and optimized by Concurrent Mode and the upcoming Compiler, is what gives React its unparalleled blend of power, flexibility, and performance.</p><h3>Beyond the Horizon: What’s Next?</h3><p>The journey doesn’t stop here. The React team and the broader community are continuously innovating. From further advancements in Server Components (a paradigm where much of this “render phase” logic can happen on the server, sending only HTML and minimal JavaScript to the client) to refined hydration techniques, the ecosystem is vibrant.</p><p>The goal, as always, is to empower developers to build incredible user experiences with less effort and greater efficiency. Understanding the machinery beneath the surface doesn’t just make you a better React developer; it makes you a better <em>engineer</em>. It equips you to debug more effectively, optimize more intelligently, and contribute more meaningfully to the future of the web.</p><p>I hope this deep dive has demystified React’s inner workings for you. The complexity is hidden behind a beautiful API, but the understanding of that complexity is what truly distinguishes a capable engineer.</p><p>Keep building, keep learning, and here’s to a productive and innovative year ahead!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=959e1aee18d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Zero-Day Bugs to Type-Safe APIs: The Advanced TypeScript You Need to Know (Part 1)]]></title>
            <link>https://medium.com/@idanka322/from-zero-day-bugs-to-type-safe-apis-the-advanced-typescript-you-need-to-know-part-1-942ac6cca602?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/942ac6cca602</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Tue, 16 Dec 2025 05:35:14 GMT</pubDate>
            <atom:updated>2025-12-16T05:35:14.997Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b0E4uLEucP5FmWxH" /></figure><h3>1. Stop Using any: The TypeScript Security Hole That&#39;s Costing You Millions</h3><h3>Introduction: The Lie of TypeScript</h3><p>TypeScript is lauded as the tool that brings static type safety to JavaScript. It’s supposed to save us from runtime errors, provide beautiful IntelliSense, and make refactoring painless. And yet, many large codebases still harbor a silent killer, a single keyword that effectively rips out the type checker’s core: the <strong>any</strong> type.</p><p>When you use any, you aren&#39;t just telling TypeScript, &quot;I don&#39;t know the type.&quot; You are telling it, <strong>&quot;Turn off all type checking for this variable. I promise I know what I&#39;m doing.&quot;</strong> It&#39;s a blank check with your company&#39;s uptime in the balance.</p><h3>The any Time Bomb: An Innocent Mistake</h3><p>Consider this seemingly harmless function used to process data from a third-party service:</p><pre>// The &quot;Innocent&quot; Code<br>function processConfig(config: any) {<br>  // We assume &#39;config&#39; has a &#39;data&#39; property, which is an array<br>  if (config.data.length &gt; 0) {<br>    return config.data.map((item: any) =&gt; item.toUpperCase());<br>  }<br>  return [];<br>}<br>// In environment A, it works fine:<br>processConfig({ data: [&#39;a&#39;, &#39;b&#39;] }); // -&gt; [&#39;A&#39;, &#39;B&#39;]<br>// In environment B, a team member passes in a null/undefined value<br>// because the API sometimes returns a null body:<br>processConfig(null);<br>// 💣 Runtime Error in Production: Cannot read properties of null (reading &#39;data&#39;)</pre><p>The error is not caught at compile time because any tells TypeScript to trust you. It lets you access any property (.data), call any method (.length), and chain any operation, all while blissfully ignorant of the inevitable runtime crash. <strong>any is a contract you sign saying, &quot;I accept all runtime errors.&quot;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/0*kmztp_YERXHlTF8v.jpg" /></figure><h3>2. The Type-Safe Trinity: any, unknown, and never</h3><p>To truly master type safety, we must replace the permissive any with its safer, more expressive cousins.</p><p><strong>any: “The Wildcard” </strong>=&gt; Everything can be assigned to it, and it can be assigned to everything. =&gt; <strong>(Bad)</strong> Bypasses type checking entirely.</p><p><strong>unknown: “The Black Box” =&gt; </strong>Everything can be assigned to it, but it cannot be used until its type is <strong>narrowed. =&gt; (Good)</strong> The safe alternative to any. Forces runtime type checks.</p><p><strong>never: “The Impossible” =&gt; </strong>Nothing can be assigned to it, and it can only be assigned to itself. =&gt; <strong>(Essential)</strong> Guarantees code exhaustiveness; signifies a code path that should be unreachable.</p><p>Here are some Simple examples:</p><p>Think of data types in TypeScript like special containers for toys.</p><h3>1. any (The Free-for-All Box)</h3><ul><li><strong>What it is:</strong> The <strong>least safe</strong> type. It’s like a box where you can put <strong>any kind of toy</strong> (a car, a ball, a doll), and when you take it out, TypeScript <strong>assumes you know exactly what it is</strong> and lets you do anything with it, without checking.</li><li><strong>The Problem:</strong> If you put a car in and then later treat it like a ball (e.g., you try to bounce it), TypeScript won’t stop you, but the program will crash or do something unexpected when it runs!</li><li><strong>Analogy:</strong> The <strong>“Trust Me”</strong> type. TypeScript says: “Okay, I trust you, go ahead.”</li></ul><p><strong>Example:</strong></p><pre>let favoriteToy: any = { name: &quot;Red Car&quot;, drive: () =&gt; console.log(&quot;Vroom!&quot;) }<br><br>favoriteToy.drive() // Works! (It has the &#39;drive&#39; method)<br><br>favoriteToy.bounce() // 💥 TypeScript doesn&#39;t complain, but at runtime,<br>                    // this will crash because the car doesn&#39;t have a &#39;bounce&#39; method.</pre><h3>2. unknown (The Mystery Box)</h3><ul><li><strong>What it is:</strong> The <strong>safest</strong> “accepts everything” type. It’s also a box that can hold <strong>any kind of toy</strong>. However, when you take a toy out, TypeScript says: <strong>“Wait! I don’t know what this is. You must check it first.”</strong></li><li><strong>The Solution:</strong> Before you can use the toy (like driving it or bouncing it), you have to do a check (like checking if it has wheels or is round). This is called <strong>type narrowing</strong>.</li><li><strong>Analogy:</strong> The <strong>“Show Me”</strong> type. TypeScript says: “Prove to me what it is before you use it.”</li></ul><p><strong>Example:</strong></p><pre>let mysteryToy: unknown = { name: &quot;Blue Ball&quot;, bounce: () =&gt; console.log(&quot;Boing!&quot;) }<br><br>// mysteryToy.bounce() // 🛑 ERROR! TypeScript stops you: &quot;I don&#39;t know if it has &#39;bounce&#39;.&quot;<br><br>// The safe way (Type Narrowing):<br>if (typeof mysteryToy === &#39;object&#39; &amp;&amp; mysteryToy !== null &amp;&amp; &#39;bounce&#39; in mysteryToy) {<br>  // Now, TypeScript knows it&#39;s an object with a &#39;bounce&#39; property!<br>  (mysteryToy as { bounce: () =&gt; void }).bounce() // Works safely!<br>}</pre><h3>3. never (The Impossible Box)</h3><ul><li><strong>What it is:</strong> This is the container for things that <strong>can never, ever happen</strong>. It’s the type you use when a function will <strong>never finish</strong> (e.g., it’s stuck in an infinite loop) or when an error is <strong>always thrown</strong>.</li><li><strong>The Use Case:</strong> It’s great for ensuring all cases are covered in a switch statement (called <strong>Exhaustiveness Checking</strong>). If a case that should be impossible somehow happens, TypeScript will warn you because it expects that variable to be never.</li><li><strong>Analogy:</strong> The <strong>“No Entry”</strong> or <strong>“Dead End”</strong> type.</li></ul><p><strong>Example:</strong></p><pre>function blastOff(): never {<br>  throw new Error(&quot;Rocket exploded!&quot;) // This function never returns a value, it throws.<br>}<br><br>function checkShape(shape: &quot;square&quot; | &quot;circle&quot;): never {<br>  // If we somehow get a &#39;triangle&#39; here, TypeScript yells at us!<br>  const _exhaustiveCheck: never = shape<br>  return _exhaustiveCheck<br>}</pre><h3>2.1. The Safe Default: Why unknown is the New any</h3><p>The unknown type, introduced in TypeScript 3.0, is your first line of defense against dangerous external data like API responses or user input.</p><p><strong>The Key Difference:</strong> You cannot perform any operation on an unknown variable without first performing a type check (a process called <strong>Type Narrowing</strong>).</p><h4>Practical unknown Example: Fixing the Time Bomb</h4><p>Let’s fix the processConfig function:</p><pre>function processConfig(config: unknown) {<br>  // 🛑 Compiler Error: &#39;config&#39; is of type &#39;unknown&#39;.<br>  // console.log(config.data);<br><br>  // We must first narrow the type:<br>  if (typeof config === &#39;object&#39; &amp;&amp; config !== null &amp;&amp; &#39;data&#39; in config) {<br>    const safeConfig = config as { data: unknown[] }; // Narrowing the shape<br><br>    if (Array.isArray(safeConfig.data)) {<br>      // Now we narrow the array contents:<br>      const safeData = safeConfig.data.filter(<br>        (item): item is string =&gt; typeof item === &#39;string&#39;<br>      );<br>      return safeData.map(item =&gt; item.toUpperCase());<br>    }<br>  }<br><br>  return [];<br>}</pre><p>By using unknown, TypeScript forces us to handle the null checks, property existence, and internal type checks explicitly, preventing the runtime error at the very beginning. This is defensive coding enforced by the compiler.</p><h3>2.2. The Ultimate Safety Net: Mastering never for Exhaustiveness</h3><p>The never type&#39;s primary power is in <strong>exhaustive checking</strong>—guaranteeing that every possible case in a union type has been explicitly handled. This is often used in a switch statement&#39;s default block.</p><pre>type Status = &#39;PENDING&#39; | &#39;SUCCESS&#39; | &#39;ERROR&#39;;<br><br>function handleStatus(status: Status) {<br>  switch (status) {<br>    case &#39;PENDING&#39;:<br>      return &#39;Waiting...&#39;;<br>    case &#39;SUCCESS&#39;:<br>      return &#39;Complete!&#39;;<br>    // case &#39;ERROR&#39;:<br>    //   return &#39;Failed!&#39;; // We intentionally omit this for the example<br><br>    default:<br>      // We assign the final value of `status` to a type of `never`.<br>      // If a case is missed, &#39;status&#39; will be the type of the missed case (&#39;ERROR&#39;),<br>      // which is NOT assignable to &#39;never&#39;, thus creating a COMPILE-TIME ERROR.<br>      const exhaustiveCheck: never = status;<br>      throw new Error(`Unhandled status: ${exhaustiveCheck}`);<br>  }<br>}<br><br>// 🛑 COMPILE ERROR! Argument of type &#39;&quot;ERROR&quot;&#39; is not assignable to parameter of type &#39;never&#39;.<br>// This error appears the moment we try to compile, not when the code runs.<br>handleStatus(&#39;ERROR&#39;)</pre><p>If we were to add a new status, like &#39;IN_PROGRESS&#39;, to the Status union, the default block would instantly throw a compile-time error, forcing us to update handleStatus. This pattern, pioneered by the TypeScript team, is a cornerstone of robust state machine logic.</p><h3>3. Generics: The Power to Navigate the Unknown</h3><p>Generics are the final piece of the advanced type-safety puzzle. They are essentially <strong>type-level variables</strong> that allow you to write reusable components while preserving the exact type information.</p><h3>3.1. What are Generics and Why are They Awesome?</h3><p>Imagine a simple function to return the first element of an array:</p><pre>// Without Generics (Bad)<br>function getFirst(arr: any[]): any {<br>  return arr[0]; // Returns &#39;any&#39;, losing all type info.<br>}<br><br>// With Generics (Awesome)<br>function getFirst&lt;T&gt;(arr: T[]): T {<br>  return arr[0]; // Returns type T (whatever was passed in!)<br>}<br><br>const names = [&#39;Alice&#39;, &#39;Bob&#39;];<br>const firstName = getFirst(names); // TypeScript infers firstName is &#39;string&#39;<br><br>const scores = [100, 95, 88];<br>const firstScore = getFirst(scores); // TypeScript infers firstScore is &#39;number&#39;The &lt;T&gt; is the generic type parameter. It tells TypeScript: &quot;I don&#39;t care what type T is, but the input type of the array (T[]) must match the output type of the element (T).&quot; This preserves type safety while providing maximum flexibility.</pre><h3>3.2. Generics and APIs: The Unknown Navigator</h3><p>This is where generics shine — when dealing with data whose structure is <em>predictable</em> but whose <em>contents</em> are <em>unknown</em> until runtime, such as an API response.</p><p>Let’s define a reusable API wrapper:</p><pre>// Define a standard wrapper that holds our data and maybe some metadata<br>interface ApiResponse&lt;T&gt; {<br>  success: boolean;<br>  data: T; // The key: &#39;T&#39; is a placeholder for the actual payload type<br>  message: string | null;<br>}<br><br>// 1. Define the actual, strict type for User<br>interface User {<br>  id: number;<br>  username: string;<br>  email: string;<br>}<br><br>// 2. Use the generic wrapper to type the fetch function<br>async function fetchUser(id: number): Promise&lt;ApiResponse&lt;User&gt;&gt; {<br>  // In a real app, you would fetch data here<br>  const rawData: ApiResponse&lt;User&gt; = {<br>    success: true,<br>    data: { id, username: &#39;danielr&#39;, email: &#39;dr@ms.com&#39; },<br>    message: null,<br>  };<br>  return rawData;<br>}<br><br>// 3. The magic: Type inference works perfectly<br>const response = await fetchUser(123);<br>// response.data is automatically inferred as type &#39;User&#39;<br>console.log(response.data.username.toUpperCase()); // ✅ Autocomplete and type-safe!</pre><p>Without generics, you’d be forced to create a separate interface for ApiResponseUser, ApiResponseProduct, and so on. Generics allow you to write one robust, type-safe wrapper that works for <strong>any</strong> payload type, eliminating redundant code and making the code more readable and maintainable a core tenet of building large-scale applications.</p><h3>Part 2 Teaser: From Type-Checked to Runtime-Validated</h3><p>In Part 1, we tackled the <em>compiler’s</em> safety features. But what happens when external data — like a request body or an API response — is malformed? TypeScript’s types disappear at runtime, and bad data will still crash your application.</p><p><strong>The Solution?</strong> Runtime validation that guarantees your data shape <em>after</em> it leaves the wire.</p><p>In <strong>Part 2</strong>, we will leverage the incredible power of <strong>Zod</strong> to build:</p><ul><li><strong>Runtime Schemas:</strong> Define your data structure once.</li><li><strong>Type Inference:</strong> Get your TypeScript types for free, directly from the schema.</li><li><strong>Strongly Typed CRUD:</strong> Create a fully type-safe CRUD (Create, Read, Update, Delete) scenario where API parameters are validated at runtime and automatically typed at compile time.</li></ul><h3>Let’s Continue the Conversation</h3><p>The journey to true type safety is ongoing, and it’s built on shared knowledge and critical discussion.</p><p>I’ve shared the foundational concepts; escaping the trap of any, leveraging the strictness of unknown and never, and harnessing the flexibility of Generics. These principles are what separate resilient, scalable architecture from fragile codebases.</p><p>But the TypeScript ecosystem is vast, and every project has its unique challenges.</p><p><strong>I want to hear from you:</strong></p><ul><li><strong>What is the single biggest “Aha!” moment</strong> you had when you first mastered unknown or Generics?</li><li><strong>What common patterns or concepts</strong> (like type predicates, conditional types, or template literal types) are you still wrestling with?</li><li><strong>Do you have a personal story</strong> about an any-related bug that slipped into production?</li></ul><p>Drop your thoughts, questions, and concept requests in the comments below. Your feedback will directly influence the deep dives we tackle in future posts, helping us collectively raise the bar for TypeScript development.</p><p><strong>Stay tuned for Part 2</strong>, where we transition from compile-time safety to runtime validation with <strong>Zod</strong> to build truly robust, end-to-end type-safe APIs.</p><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, Frontened engineer best practices, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=942ac6cca602" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Blaming Scrum: How Misguided Practices Turned a Liberating Framework into a Corporate Cage]]></title>
            <link>https://medium.com/@idanka322/stop-blaming-scrum-how-misguided-practices-turned-a-liberating-framework-into-a-corporate-cage-4faaadf64e0d?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4faaadf64e0d</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[teamwork]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Thu, 11 Dec 2025 05:34:10 GMT</pubDate>
            <atom:updated>2025-12-11T05:34:10.137Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*PSwFa6A5uCGg2XJo" /></figure><p>The whispers are everywhere on LinkedIn, in Reddit threads, and certainly in private Slack channels. Engineers are fed up. They say Scrum “sucks the fun out of engineering,” that it’s a tool for micromanagement, a calendar packed with “silly ceremonies,” and a framework that forces them into a constant state of “survival mode.”</p><p>I’ve heard it all, and my message is simple: <strong>You are absolutely right to be frustrated. But you are aiming your frustration at the wrong target.</strong></p><p>The problem is not Scrum. The problem is what I call <strong>Fake Scrum</strong>, or a corrupt implementation of its foundational principles.</p><p>We built Scrum to be an early warning system, a way to deliver value predictably, and, most critically, a method for teams to <strong>self-manage and self-correct</strong>. If your Scrum process feels like a cage, it means your leadership has mistakenly used it as a whip.</p><p>Let’s strip away the toxic practices and remember the true power of Scrum.</p><h3>The True Purpose of the “Silly Ceremonies”</h3><p>A common lament is the endless cycle of meetings Daily Scrums, Retrospectives, Reviews that turn into status updates and blame sessions. This is a profound misunderstanding of the framework’s mechanics.</p><h4>1. The Daily Scrum (The 15-Minute Sync, Not the Status Report)</h4><p><strong>The Fake Scrum:</strong> Teams sit around while a manager or Scrum Master pulls status from each person: “What did you do yesterday? What will you do today? Are you blocked?” This is management surveillance masquerading as a meeting.</p><p><strong>The Real Scrum (The Jeff Sutherland Way):</strong> This is a <strong>planning meeting for the Development Team, by the Development Team.</strong> The focus is not on individual status, but on the <strong>Sprint Goal</strong>. The three questions are a guide, not a script. The real question is: <strong>“Does what we are planning to do today move us closer to the Sprint Goal?”</strong> If the answer is no, the team must adapt. It should only take 15 minutes. If it takes longer, the team is likely solving the problem <em>in the meeting</em>, <strong>which defeats the purpose</strong>.</p><h4>2. The Sprint Retrospective (Continuous Improvement, Not a Blame Game)</h4><p><strong>The Fake Scrum:</strong> A poorly facilitated meeting where everyone quietly avoids eye contact, hoping someone else brings up the elephant in the room, which usually results in one or two people being scapegoated.</p><p><strong>The Real Scrum (The Mike Cohn Insight):</strong> The Retrospective is the single most important mechanism for <strong>organizational growth</strong>. We built this event on the fundamental principle of <strong>Inspect and Adapt</strong>. It is a safe space for the team to identify organizational barriers and systemic process flaws. The purpose is not to fix people, but to fix the process. If your team is not walking out with one or two concrete, actionable improvements and an agreement to execute them in the next Sprint you are failing the Retrospective.</p><h4>3. The Sprint Review (Demonstrate Value, Not Just “Finished” Work)</h4><p><strong>The Fake Scrum:</strong> A formal presentation to stakeholders, focused on checking off items on the Sprint Backlog. A transactional, “show-and-tell.”</p><p><strong>The Real Scrum (The Ken Schwaber Principle):</strong> The Review is an opportunity for <strong>collaboration and empirical product development</strong>. The goal is to demonstrate the <strong>Increment</strong> — the <em>potentially releasable</em> product — and engage stakeholders in a discussion about its value, the state of the Product Backlog, and the next most valuable things to work on. It prevents wasted effort by course-correcting <em>every single Sprint</em>.</p><h3>4. The Weaponization of Story Points (The Velocity Trap)</h3><p><strong>The Fake Scrum:</strong> Leadership begins tracking <strong>Velocity</strong> (the sum of Story Points completed in a Sprint) not as a planning tool for the team, but as a direct measure of <strong>individual performance</strong>. Engineers are subtly or overtly told that the more Story Points they “take” and complete, the better they are, leading to bigger bonuses and faster promotions.</p><p><strong>The Real Scrum (The Ultimate Misuse):</strong> This is where <strong>True Scrum</strong> dies. The instant a numerical metric intended for <strong>team forecasting</strong> is co-opted for <strong>individual evaluation</strong>, the entire system breaks.</p><ul><li><strong>Story Points are an estimate of complexity, not a measure of individual effort or hours worked.</strong> Using them for performance reviews forces engineers to inflate their estimates, horde work, or take on easier tasks just to boost their individual score. This fosters an <strong>individualistic survival mode</strong> where engineers stop collaborating, justifying their actions to a manager instead of the team, and completely lose sight of the <strong>Sprint Goal</strong> and the <strong>business goal</strong>.</li><li><strong>Velocity Belongs to the Team:</strong> Velocity is a measure of the <strong>team’s capacity and throughput</strong> over time, used to help the Product Owner forecast how many items the team can reasonably pull into the next Sprint. It is a <strong>Team Metric</strong>, valuable only for planning, and is mathematically nonsensical when applied to a single person.</li><li><strong>The Focus Must Be on the Increment:</strong> The only measure of success in Scrum is the delivery of a <strong>“Done” Increment</strong> that creates value for the customer. A team that completes 10 low-value, low-point stories is a worse team than one that completes 5 high-value, complex stories that achieve a critical business objective. The focus must be on <strong>Outcomes</strong>, not arbitrary <strong>Output</strong> numbers.</li></ul><blockquote><strong><em>Ken Schwaber’s insight on this misuse:</em></strong><em> “I will fire a person who is using velocity to measure productivity.” This isn’t about being harsh; it’s about protecting the </em><strong><em>integrity of the framework</em></strong><em> and the safety of the engineers. When you use velocity as a whip, you invite gaming, corruption, and organizational dishonesty.</em></blockquote><p><strong>Action Item:</strong> As a leader, your metric for success is the <strong>delivery of value</strong> and the <strong>impact on the customer</strong>. As an engineer, push back against any practice that treats you as a component in a factory line. Scrum requires self-managing teams, and self-managing teams cannot exist in an environment where they are being monitored by a metric they themselves created for their own planning purposes.</p><h3>Scrum is Your Shield Against Micromanagement</h3><p>You mentioned being forced to stay in “survival mode.” This is exactly what Scrum is designed to eliminate. The core concepts of self-managing teams and transparency are the <strong>antidote</strong> to the toxic monitoring you describe.</p><p><strong>1. Scrum Emphasizes Outcome Over Output:</strong> If a manager is demanding an “autopsy report” or a deployment plan <strong>in addition to</strong> the standard Scrum events, they are betraying the framework. Scrum is built on <strong>trust</strong>. The single measure of success in a Sprint is the <strong>Sprint Goal</strong>. If the team meets the goal, they are successful. The transparency of the <em>potentially releasable Increment</em> at the Sprint Review makes micromanagement redundant.</p><p><strong>2. The Power of the Product Owner:</strong> Ambiguous requirements are the enemy of engineering joy. A well-functioning Product Owner is the team’s shield. Their role is to provide a clear, prioritized <strong>Product Backlog</strong> and an inspiring <strong>Product Goal</strong>. When uncertainty strikes, the Product Owner is accountable for providing clarity and making hard trade-off decisions, allowing the Development Team to focus on what they do best: engineering.</p><p><strong>3. Small Sprints Reduce Risk:</strong> Scrum uses short Sprints (usually two to four weeks) to navigate uncertain times. When you are sailing in a fog (ambiguous requirements), you don’t chart a course for 12 months; you chart a course for 2 weeks, check your position, and adjust the rudder. This mechanism, known as <strong>Empiricism</strong>, is what makes Scrum the most powerful tool for uncertain environments.</p><blockquote><strong><em>Empiricism:</em></strong><em> </em>The process of making decisions based on what is observed. In Scrum, Empiricism means working in a factual, experience-based, and evidence-based manner (Transparency, Inspection, Adaptation).</blockquote><h3>The Call to Action</h3><p>If your current process “sucks the fun out of engineering,” it’s time to stop complaining about the framework and start demanding <strong>True Scrum</strong>.</p><ul><li><strong>To Engineers:</strong> Challenge the status quo. If your Daily Scrum is a status update, politely ask, “What is our Sprint Goal, and is this discussion moving us toward it?” Demand psychological safety in the Retrospective.</li><li><strong>To Managers/Leaders:</strong> Stop using the artifacts (Velocity, Backlog items) as management weapons. Focus on removing systemic impediments and providing an inspiring vision. <strong>Trust your teams.</strong> You hired smart people; let them do their jobs.</li><li><strong>To Scrum Masters:</strong> You are the process champion. Protect the team from bad practices. Coach the Product Owner, the Development Team, and the Organization on the <em>why</em> and <em>how</em> of true Scrum.</li></ul><p>Scrum isn’t a problem; it’s the solution. It is a liberating framework designed by engineers, for engineers, to maximize value and minimize waste.</p><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, Frontened engineer best practices, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4faaadf64e0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React’s 10.0 RCE Horror: The Server Component Design Flaw That Broke the Cloud]]></title>
            <link>https://medium.com/@idanka322/reacts-10-0-rce-horror-the-server-component-design-flaw-that-broke-the-cloud-47304a31f047?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/47304a31f047</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 08:27:30 GMT</pubDate>
            <atom:updated>2025-12-05T08:27:30.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kMiGKwRJaz3mNlGp3EqKag.jpeg" /></figure><h3>TL;DR</h3><ul><li>A critical vulnerability, tracked as <strong>CVE-2025–55182</strong> (React) and <strong>CVE-2025–66478</strong> (Next.js), was disclosed in the core React Server Components (RSC) protocol, achieving the maximum possible severity score of <strong>CVSS 10.0</strong> [1], [3].</li><li>The flaw is an unauthenticated Remote Code Execution (RCE) vulnerability rooted in <strong>unsafe deserialization</strong> within the React Flight protocol. No user interaction or prior authentication is required for exploitation.</li><li>Security firms Wiz and Unit 42 estimate that the flaw exposed a staggering attack surface, impacting nearly one million internet-facing servers and <strong>39% of cloud environments</strong> [4].</li></ul><blockquote><em>“It’s not just a bug; it’s a philosophical failure. When you start serializing the server’s inner logic and shipping it over the wire, you are actively inviting the void.” (Satirical Opinion)</em></blockquote><p>Let’s be honest. The Full Stack Framework hype train, specifically the one fueled by the promise of seamless client-server magic, just slammed into a wall of grim reality. This wasn’t a minor bump or a cross-site scripting hiccup. This was the catastrophic, total-system-failure kind of event that makes security commentators like myself stop roasting NFTs for a minute and pay serious attention.</p><p>In early December 2025, the digital world received its belated holiday gift: a maximum-severity, unauthenticated <strong>Remote Code Execution (RCE)</strong> vulnerability lurking deep inside the architecture powering the modern web. The culprit? The very mechanism intended to simplify development: <strong>React Server Components (RSC)</strong>, and its primary deployment vehicle, <strong>Next.js</strong> [2].</p><p>It was a full 10.0 on the CVSS scale — the digital equivalent of the “Game Over” screen. This wasn’t some convoluted exploit requiring a chain of three separate misconfigurations; this was a single, elegantly malicious HTTP request that turned millions of shiny, modern web servers into remote command prompts for any attacker with a browser and an unkind heart.</p><h3>1. What Happened: The Facts, Unfiltered</h3><p>On December 3, 2025, the React and Next.js teams simultaneously disclosed what they termed a “critical security vulnerability” [1]. The issue, which allows for RCE under default configurations, was assigned two primary identifiers:</p><p><strong>CVE IDTargetCVSS v3.1 ScoreSeverityDescriptionCVE-2025–55182</strong>React Server Components (RSC)<strong>10.0</strong>CriticalRoot cause RCE in the core React Flight protocol [1]<strong>CVE-2025–66478</strong>Next.js<strong>10.0</strong>CriticalDownstream RCE impact for Next.js applications using the App Router [2], [3]</p><p>The severity is maximal because the attack is <strong>unauthenticated</strong>, <strong>remote</strong>, and requires <strong>no user interaction</strong> or complex setup. An attacker simply needs to be able to send a specially crafted HTTP request to a vulnerable endpoint.</p><p>Affected Packages and Versions:</p><p>The vulnerability resides in the internal React packages responsible for the RSC/Flight implementation, primarily: react-server-dom-webpack, react-server-dom-parcel, and react-server-dom-turbopack.</p><ul><li><strong>Vulnerable React versions:</strong> 19.0, 19.1.0, 19.1.1, and 19.2.0.</li><li><strong>Vulnerable Next.js versions (using App Router):</strong> All Next.js 15.x and 16.x versions prior to the patches, as well as canary releases starting from 14.3.0-canary.77 [3].</li></ul><p>The advisory timeline was grimly tight. The vulnerability was privately reported only days before public disclosure, demonstrating the zero-day nature and extreme criticality of the flaw [4]. Public proof-of-concept code (PoC) for the exploit, codenamed “React2Shell” by some researchers, was confirmed to exist and was released shortly after the advisories, guaranteeing that mass exploitation attempts would follow almost immediately [4].</p><h3>2. The Vulnerability in Plain English: Trusting the Enemy</h3><p>To understand this flaw, you need to understand the magic of React Server Components (RSC). RSC works by allowing React components to render on the server, sending the final <em>instructions</em> — not HTML, not JSON, but a special serialized payload called <strong>“React Flight”</strong> — over the network to the client. The client then <em>deserializes</em> this payload to reconstruct the UI.</p><p>The issue, technically classified as <strong>CWE-502: Deserialization of Untrusted Data</strong>, lies in this deserialization step within the React Flight protocol itself.</p><p>The Deserialization Flaw:</p><p>When the server receives a request for a Server Function (a piece of code designed to run exclusively on the server, often triggered by a client-side action), it has to decode, or deserialize, the incoming data. This data is supposed to describe which function to call and what arguments to use.</p><p>The exploit works by crafting a malicious payload that, instead of representing harmless data structures, tricks the deserializer into interpreting the attacker’s input as an internal command. Essentially, the protocol allows an attacker to smuggle in code disguised as application data [4].</p><p>Imagine a secure airport baggage scanner that is supposed to confirm “This is a book” or “This is a laptop.” An attacker found a way to label a hand grenade as “a very large, complex book.” The system, trusting its own protocol definition, then processes the “book” without suspicion, leading to catastrophic results.</p><p>In the case of React/Next.js, the “hand grenade” is arbitrary JavaScript code, and the “processing” is <strong>Remote Code Execution</strong> running with the privileges of the hosting server [2].</p><h3>3. Scope &amp; Impact: The Bleeding Edge Cuts Deep</h3><p>The immediate impact is significant, precisely <em>because</em> the vulnerability affects the default, modern configuration of one of the world’s most popular web frameworks. Next.js applications using the App Router (introduced in versions 13+) rely fundamentally on the vulnerable RSC implementation.</p><p>The adoption rate of React and Next.js guarantees massive exposure:</p><ul><li><strong>Exposed Servers:</strong> Palo Alto Networks’ Unit 42 reported identifying <strong>over 968,000 servers</strong> running common modern frameworks like Next.js exposed to the internet, creating a vast and lucrative target surface for attackers [4].</li><li><strong>Cloud Penetration:</strong> Cloud security firm Wiz delivered the most damning metric: their data indicated that <strong>39% of cloud environments</strong> globally contain instances of Next.js or React in the vulnerable state [4]. This isn’t just about small projects; this is a systemic risk to enterprise and SaaS applications built on this architecture.</li><li><strong>Default Vulnerability:</strong> Crucially, a standard Next.js application generated using create-next-app and built for production is <strong>immediately vulnerable</strong> without the developer having written a single line of insecure code [4]. The vulnerability is <em>in the framework</em>, not in user code.</li></ul><blockquote><em>“The system executes the malicious payload with the same reliability as legitimate code because it operates exactly as intended, but on malicious input.” (Serious Quote — Justin Moore, Unit 42 [4])</em></blockquote><p>This means the architectural choice itself was the root of the problem, turning an elegant developer experience into a security nightmare.</p><h3>4. The Complexity Tax</h3><p>Let’s step back and look at the hubris required to ship a protocol that attempts to <strong>serialize and deserialize function calls</strong> between a client and a server without comprehensive, pre-disclosure security scrutiny.</p><p>For years, security experts have warned about the dangers of <strong>unsafe deserialization</strong>. It is consistently listed among the most dangerous attack types because, by its nature, it allows data to morph into executable instructions. It is the original <strong>master key exploit</strong> [4]. To re-introduce this risk vector into the modern JavaScript ecosystem, which prided itself on safer boundaries than older languages, is an act of spectacular self-sabotage.</p><p>Did we really need to invent an entirely new, bespoke, binary-encoded network protocol just to send component instructions, completely bypassing established, battle-tested standards like JSON or GraphQL, and inherit the most critical security flaw of Java/PHP deserialization bugs from 15 years ago?</p><p>The complexity tax of the “Server Components Everywhere” vision is now officially due. When a developer can’t easily tell if their code is running on the client, the server, or Schrödinger’s Box somewhere in between, the security model is already broken. The developers most exposed are those who followed the path of least resistance, trusting the framework to handle the complex security boundary automatically.</p><p>This is the equivalent of a fighter jet architect saying, “We’ve added a feature that lets the co-pilot quickly change the engine settings via a simple, custom-designed satellite link. We think it’s secure because we wrote it ourselves!”</p><p>The irony is savage: the feature designed to improve performance and developer ergonomics — by making client/server communication seamless — is precisely what gave attackers an invisible, direct RCE pathway. They called it Flight. We call it falling straight out of the sky.</p><h3>5. How to Fix &amp; Mitigate: Patch Now, Plan Later</h3><p>The immediate and non-negotiable step is to <strong>update your application</strong>. The patched versions include hardened input validation and stricter deserialization logic to prevent the attacker from crafting the necessary malicious payload.</p><p><strong>Patch Details (Mandatory Upgrade):</strong></p><ul><li><strong>React:</strong> Upgrade react-server-dom-* packages to at least version <strong>19.0.1</strong>, <strong>19.1.2</strong>, or <strong>19.2.1</strong> [1].</li><li><strong>Next.js (App Router):</strong> Upgrade to the latest patched version in your respective major line [2].</li><li>For Next.js 15.x users: Upgrade to <strong>15.0.5</strong>, <strong>15.1.9</strong>, <strong>15.2.6</strong>, or later.</li><li>For Next.js 16.x users: Upgrade to <strong>16.0.7</strong> or later.</li></ul><blockquote><strong><em>Official Next.js Patch Command Example:</em></strong><em> </em><em>npm install next@15.0.5 [2]</em></blockquote><p><strong>Mitigation &amp; Inventory Checks:</strong></p><ol><li><strong>Inventory Scan:</strong> Do not assume you are safe. Use tools to check your package.json and lockfiles for the vulnerable dependencies, paying special attention to any projects using React 19 or Next.js App Router.</li><li><strong>Web Application Firewall (WAF) Rules:</strong> While a patch is the only true fix, immediate platform-level protection is vital. Major providers like Vercel, Cloudflare, AWS, and Google Cloud (Cloud Armor) rapidly deployed <strong>virtual patches/WAF rules</strong> specifically designed to detect and block known exploit patterns for CVE-2025–55182/CVE-2025–66478 [4]. Enable these rules immediately if your application runs in an affected environment and cannot be patched instantly.</li><li><strong>Canary Releases:</strong> If you are running on a Next.js canary release starting from 14.3.0-canary.77, you must either upgrade to the fixed canary version (15.6.0-canary.58) or <strong>downgrade</strong> to the latest stable 14.x release [2].</li></ol><p>There is <strong>no configuration setting</strong> to disable the vulnerable code path without updating the framework itself. If you’re using RSC, you are exposed until you patch.</p><p>You just spent three years arguing about state management, and the vulnerability that killed your application was a deserialization bug from 1999. The modern web is a comedy of errors. (Suggested Image: Distracted Boyfriend Meme, where the “New RCE Vulnerability” is the passing girl, and the “Distracted Boyfriend” is “JS Developers,” looking back at “A 10.0 Deserialization Flaw.”)</p><h3>Sources</h3><p>[1] React Team. (2025, December 3). <em>Critical Security Vulnerability in React Server Components</em>. React Blog. <a href="https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components"><strong>https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components</strong></a></p><p>[2] Story, J., &amp; Markbåge, S. (2025, December 3). <em>Security Advisory: CVE-2025–66478</em>. Next.js Blog. <a href="https://nextjs.org/blog/CVE-2025-66478"><strong>https://nextjs.org/blog/CVE-2025-66478</strong></a></p><p>[3] GitHub Advisory Database. (2025, December 3). <em>Next.js is vulnerable to RCE in React flight protocol · CVE-2025–66478</em>. <a href="https://github.com/advisories/GHSA-9qr9-h5gf-34mp"><strong>https://github.com/advisories/GHSA-9qr9-h5gf-34mp</strong></a></p><p>[4] Rescana. (2025, December 3). <em>Critical React2shell Vulnerability (CVE-2025–55182, CVE-2025–66478) Enables Unauthenticated RCE in React Server Components and Next.js</em>. <a href="https://www.rescana.com/post/critical-react2shell-vulnerability-cve-2025-55182-cve-2025-66478-enables-unauthenticated-rce-in-r"><strong>https://www.rescana.com/post/critical-react2shell-vulnerability-cve-2025-55182-cve-2025-66478-enables-unauthenticated-rce-in-r</strong></a> (Used for consolidated CVSS score, Exploit PoC confirmation, Wiz 39% cloud environments stat, and Unit 42 968,000 servers stat)</p><p>[5] Vercel. (2025, December 3). <em>Summary of CVE-2025–55182</em>. Vercel Changelog. <a href="https://vercel.com/changelog/cve-2025-55182"><strong>https://vercel.com/changelog/cve-2025-55182</strong></a> (Used for detailed fixed versions)</p><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47304a31f047" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Stopped Watching Framework Tutorials and Accidentally Became a Staff Engineer]]></title>
            <link>https://medium.com/@idanka322/i-stopped-watching-framework-tutorials-and-accidentally-became-a-staff-engineer-e15c24ed2ca8?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e15c24ed2ca8</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Fri, 28 Nov 2025 05:27:43 GMT</pubDate>
            <atom:updated>2025-11-28T05:27:43.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/702/0*id-KrJKGlRknJL2K.jpg" /></figure><p>Everyone wants to know if I’m Team <strong>React</strong> or <strong>Vue</strong>.</p><p>Nobody asks if I can <strong>think</strong>.</p><p>Job listings demand 19 different frameworks, developer influencers teach the same to-do app 9,000 times, and the internet keeps telling you that installing the right package will magically promote you to senior engineer.</p><p>But the cold truth is this:</p><blockquote><strong><em>Frameworks change. Problems don’t. Your ability to solve them determines your career.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*JCBMJMUssSvxYx_p.jpg" /></figure><h3>The Great Engineer Filter</h3><p>Here’s a story that proves it; with zero stickers and zero emotional trauma.</p><p>A few weeks ago, our team needed to generate <strong>PDF reports for 5,000+ users</strong>, each personalized with analytics from our dashboard.<br>Clicking “Download PDF” 5,000 times was not an option (I enjoy having wrists).<br>Emailing them one-by-one was even worse (I also enjoy free time).</p><p>The problem wasn’t “How do I PDF?”</p><p>The real problem was:</p><p>🔹 How do we <strong>mass-produce documents reliably</strong>?<br>🔹 Without crashing servers OR my sanity?<br>🔹 And make sure users actually <em>receive the right report</em>?</p><p>And that’s when it hit me: <strong>I don’t need another React tutorial. I need a plan.</strong></p><h3>Step 1: Understand the Problem (Deeply)</h3><p>Most developers start by writing code immediately.</p><p>Great developers start by writing questions.</p><p>✔ We need 5,000+ personalized PDFs<br> ✔ Each PDF pulls unique analytics<br> ✔ Delivery must be automated<br> ✔ System must fail gracefully<br> ✔ Must not explode infrastructure</p><p>Einstein didn’t build spaceships before understanding physics. Don’t architect systems before understanding constraints.</p><blockquote><strong><em>Spend 55 minutes thinking. 5 minutes typing.</em></strong></blockquote><h3>Step 2: Chop the Monster into Bite-Sized Problems</h3><p>Big problems are just tiny problems stacked in a trench coat.</p><ol><li>Fetch user analytics</li><li>Create report data model</li><li>Generate PDF from template</li><li>Queue jobs so the server doesn’t cry</li><li>Deliver reports (email, storage, etc.)</li><li>Log failures and retry safely</li></ol><p>Suddenly this terrifying 5k+ workload looks like a grocery list.</p><h3>Step 3: Pseudocode It Like Mozart Played the Piano</h3><p>No frameworks. No syntax. Just logic.</p><pre>processReports() {<br>   init analytics client<br>   for each user {<br>      get analytics<br>      format report data<br>      add job to PDF queue<br>   }<br>   run queue safely<br>}</pre><p>Tell me you can’t solve this in <em>any language</em>. I’ll wait.</p><h3>Step 4: Learn Your Tools → Then Build</h3><p>You don’t build a house by googling “bricklaying while falling”.</p><p>You inspect the tools <em>beforehand</em>:</p><p>Test your PDF template generator<br>Mock analytics API payloads<br>Use a job queue (Redis, Bull, SQS, doesn’t matter)<br>Add back-pressure so your infra survives<br>Batch delivery, don’t bombard</p><p>This isn’t a framework problem. This is a <strong>systems thinking problem</strong>.</p><p>Welcome to senior engineering.</p><h3>Step 5: Prototype Fast, Polish Later</h3><p>The first version didn’t need to be perfect. It needed to <strong>work</strong>.</p><ol><li>Build pipeline</li><li>Test with 10 users</li><li>Test with 100 users</li><li>If server still alive → ship</li><li>If server not alive → cry then fix</li></ol><p>Optimizing a working system &gt; optimizing a fantasy architecture.</p><p>After the prototype succeeded?</p><p>Then came:</p><p>Caching<br>Parallel workers<br>Monitoring dashboards<br>Auto-retry logic<br>Error tracing</p><p>You refine <strong>after</strong> you prove the idea ✅</p><h3>Step 6: The Staff Engineer Ritual</h3><p>Once you solve enough real problems like this, something changes.</p><p>You start seeing solutions instantly.</p><p>Like leveling up in a video game:</p><ul><li>You detect the real problem behind the fake problem</li><li>You break complexity down without panic</li><li>You design systems instead of components</li><li>You write logic first, syntax later</li><li>You mentor by thinking, not by showing imports</li></ul><blockquote><strong><em>That’s not senior coding. That’s Staff Engineering.</em></strong></blockquote><h3>Step 7: Reflect, Iterate, Become Unstoppable</h3><p>Problem solving compounds.</p><p>The frameworks you learned once? Helpful, but temporary.</p><p>The skill that actually scales your career?</p><p>Not:</p><p><em>“Look mom, I installed Bun and Tailwind!”</em></p><p>But:</p><p><em>“I solve problems before they solve us.”</em></p><h3>Final Thought</h3><p>Problem solving is like playing guitar:</p><p>Beginners learn riffs (tutorial code).</p><p>Pros write songs (solutions to real problems).</p><p>Legends improvise on stage… <strong>with design under pressure and systems in their head</strong>.</p><p>That legend can be you.</p><p>Now please go close those 27 tutorial tabs and build something real.</p><p>Your repo, your system, your rules ;)</p><h3>Bottom Line</h3><blockquote><strong><em>Framework mastery gets you the interview.<br>Problem solving gets you the job.<br>Systems thinking gets you the promotion.</em></strong></blockquote><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e15c24ed2ca8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The JavaScript Event Loop: The Dark Magic Powering Your ‘Simple’ Button Clicks]]></title>
            <link>https://medium.com/@idanka322/the-javascript-event-loop-the-dark-magic-powering-your-simple-button-clicks-574a26268147?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/574a26268147</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 06:26:45 GMT</pubDate>
            <atom:updated>2025-11-17T06:26:45.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*Eif_BDNv959ij2xn" /></figure><h3>Intro: The Hidden Boss of the Browser</h3><p>Every time a user clicks a button, scrolls a page, or watches your “smooth” animation stutter like a PowerPoint presentation, there’s one thing deciding how bad it gets:</p><p><strong>The browser event loop.</strong></p><p>You can memorize every React hook and Tailwind utility class on earth, but if you don’t understand how the browser <strong>runs JavaScript</strong>, <strong>schedules work</strong>, and <strong>decides when to render</strong>, you’re building UI on hard mode.</p><p>In this article, we’re going to:</p><ul><li>Demystify <strong>how the browser runs JavaScript</strong> on the <strong>main thread</strong></li><li>Break down <strong>the event loop</strong>, tasks (macrotasks), microtasks, and requestAnimationFrame</li><li>Show how bad decisions lead to <strong>frozen UIs, race conditions, and visual jank</strong></li><li>Give you a mental model to reason about <strong>performance, animations, and async code</strong>By the end, you’ll look at setTimeout, Promise, and requestAnimationFrame and think:<br> “Oh. I’ve been abusing you for years.”</li></ul><p>here is the event loop in action visualized, let’s break it down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*boBFL9wM6XW2VzGs.png" /></figure><h3>1. The Main Thread: Where Everything Important Happens</h3><p>First, the brutal truth:</p><p>Your web page has one main thread. And that’s where almost everything happens.</p><p>On the <strong>main thread</strong>, the browser:</p><ul><li>Executes <strong>JavaScript</strong></li><li>Keeps the <strong>DOM</strong> and CSSOM</li><li>Does <strong>style calculation</strong>, <strong>layout</strong>, and <strong>painting</strong> (rendering)</li></ul><p>That means:</p><ul><li><strong>Only one thing runs at a time</strong> → no two pieces of JS run simultaneously on the main thread.</li><li><strong>Long-running tasks freeze everything</strong> → no clicks, no scroll, no rendering. Just pain.</li></ul><pre>// JavaScript on the main thread<br>while (true) {<br>  // Infinite loop = infinite freeze<br>  console.log(&quot;Say goodbye to your UI&quot;);<br>}</pre><p>That code doesn’t just block your logic; it blocks:</p><ul><li>User interactions</li><li>Rendering</li><li>Even other async callbacks you’re expecting to “eventually run”</li></ul><p>The main thread is a <strong>single lane highway</strong>. The event loop is the <strong>traffic controller</strong>.</p><h3>2. The Event Loop: The Conductor of the Browser Orchestra</h3><p>The <strong>event loop</strong> is not a function you call. It’s the <strong>scheduler</strong> the browser runs continuously to decide:</p><ul><li><strong>Which piece of JavaScript to run next</strong></li><li><strong>When to render the page</strong></li><li><strong>When to run microtasks like promises</strong></li><li><strong>When to process user events, network callbacks, timers, etc.</strong></li></ul><p>High-level responsibilities:</p><ul><li>Orchestrates execution of <strong>JavaScript</strong> and <strong>browser tasks</strong></li><li>Ensures tasks queued from other threads (network, timers, workers) <strong>eventually</strong> run on the main thread</li><li>Guarantees a <strong>deterministic execution order</strong> for tasks</li></ul><p>If the main thread is the actor, the event loop is the stage manager yelling:</p><p>“You: run now. You: wait. You: we render in 16ms, hold that animation callback.”</p><h3>3. Where the Event Loop Lives in the Big Picture</h3><p>Picture this stack:</p><ul><li><strong>Other threads</strong></li><li>Network</li><li>Web Workers</li><li>Timers / internal browser stuff</li><li><strong>Task queues</strong> (macrotasks): click events, setTimeout, network responses, worker messages</li><li><strong>Microtask queue</strong>: Promise callbacks, MutationObserver</li><li><strong>Render pipeline</strong>: style, layout, paint</li><li><strong>Main thread</strong>: where JS and rendering actually run</li></ul><p>The event loop sits in the middle and runs something like this (conceptually):</p><ol><li>If there’s JS currently running → <strong>let it run to completion</strong>.</li><li>When the call stack is empty:</li></ol><ul><li>Process all <strong>microtasks</strong> (promises, etc.) until the microtask queue is empty.</li></ul><ol><li>Decide if it’s time to <strong>render</strong> (style → layout → paint).</li><li>Pick the next <strong>task (macrotask)</strong> from the task queue and run it.</li><li>Repeat. Forever.</li></ol><p>This is why <strong>you never see two bits of JavaScript truly execute at the exact same time</strong> on the main thread. The event loop guarantees <strong>single-threaded, ordered execution</strong>.</p><h3>4. Tasks (Macrotasks): The Big Chunks of Work</h3><p><strong>Tasks</strong>, also called <strong>macrotasks</strong>, are the big pieces of work the event loop picks from the <strong>task queue</strong>.</p><p><strong>Examples of tasks:</strong></p><ul><li>setTimeout / setInterval callbacks</li><li>User events (clicks, scroll, input)</li><li>Network responses (fetch, XHR)</li><li>Messages from Web Workers</li></ul><p>Rules of the game:</p><ul><li><strong>Only one task runs at a time.</strong></li><li>While a task is running:</li><li><strong>Rendering cannot occur</strong></li><li><strong>Other tasks must wait</strong></li><li>Tasks <strong>run to completion</strong> before the event loop moves on to the next task.</li></ul><pre>setTimeout(() =&gt; {<br>  console.log(&quot;Task 1: starting a heavy operation&quot;);<br>  const start = performance.now();<br>  while (performance.now() - start &lt; 2000) {<br>    // Block for 2 seconds<br>  }<br>  console.log(&quot;Task 1: done&quot;);<br>}, 0);<br><br>setTimeout(() =&gt; {<br>  console.log(&quot;Task 2: I thought I was 0ms too…&quot;);<br>}, 0);</pre><p>Even though both are 0ms, <strong>Task 2</strong> won’t run until <strong>Task 1</strong> finishes its 2-second block, because:</p><p>The event loop runs one task at a time, to completion.</p><h3>5. setTimeout: The Misleading Timer</h3><p>setTimeout sounds like:<br> “Wait X ms, then run this function.”</p><p>Reality:</p><ul><li>When you call setTimeout(callback, ms):</li></ul><ol><li>The browser schedules a <strong>timer</strong> in another thread.</li><li>After at least ms milliseconds, the callback is <strong>queued as a task</strong>.</li><li>The callback runs <strong>only when the event loop is ready to pick that task</strong>.</li></ol><p>The waiting part is <strong>non-blocking</strong>. It does not pause the main thread.</p><pre>console.log(&quot;A&quot;);<br>setTimeout(() =&gt; {<br>  console.log(&quot;B (timer callback)&quot;);<br>}, 0);<br>console.log(&quot;C&quot;);</pre><p>Output:</p><pre>A<br>C<br>B (timer callback)</pre><p>Even with 0, setTimeout <strong>never</strong> runs immediately. It always waits for:</p><ul><li>Current JS stack to finish</li><li>Microtasks to finish</li><li>Then the task gets a turn</li></ul><p>Also:</p><ul><li>Repeated setTimeout calls don’t block rendering <strong>if each callback is small</strong>.</li><li>If you stuff heavy work into each callback, you can still freeze the UI — just in small, annoying bursts.</li></ul><p>TL;DR:</p><p>setTimeout schedules, it does not sleep.</p><h3>6. Rendering: When the Browser Actually Draws Your UI</h3><p>Rendering is not random; it’s <strong>inserted into the event loop</strong>.</p><p>Typical render pipeline steps:</p><ol><li><strong>Style calculation</strong> (CSS computed styles)</li><li><strong>Layout</strong> (construct render tree, compute positions, sizes)</li><li><strong>Paint</strong> (draw pixels)</li></ol><p>Frequency:</p><ul><li>Browsers aim for <strong>60Hz</strong> → ~16.67ms per frame</li><li>If the tab is in the background or nothing changed, the browser may <strong>skip frames</strong></li></ul><p>Rendering usually happens <strong>between tasks</strong>, when:</p><ul><li>Call stack is empty</li><li>Microtasks are done</li><li>Browser decides “it’s time for a new frame”</li></ul><p>If you keep the main thread busy with heavy JS tasks:</p><ul><li>The browser can’t get to the render step in time</li><li>You drop frames → <strong>stutter, jank, and a cheap-feeling UI</strong></li></ul><p>If you use tasks (setTimeout) to repeatedly modify the DOM <strong>without aligning with frames</strong>, you can:</p><ul><li>Force extra layout/paint cycles</li><li>Do work that never makes it to the screen</li><li>Burn battery and kill performance</li></ul><h3>7. requestAnimationFrame: Animations Done Right</h3><p>requestAnimationFrame (RAF) is the browser’s official way of saying:</p><p>“Tell me what to draw on the next frame.”</p><p>Instead of:</p><pre>// Bad: timing is approximate, not synced with rendering<br>setTimeout(step, 16);</pre><p>Use:</p><pre>// Good: runs once per frame, in sync with display<br>function step(timestamp) {<br>  // Update your animations based on the timestamp<br>  box.style.transform = `translateX(${timestamp / 10}px)`;<br>  requestAnimationFrame(step);<br>}<br><br>requestAnimationFrame(step);</pre><ul><li>Callbacks run <strong>as part of the render steps</strong>, in sync with display refresh (e.g., 60Hz).</li><li>Browser can <strong>skip frames</strong> (e.g., background tab), and your callback will only fire when rendering actually occurs.</li><li>Provides a timestamp so you can animate based on real time, not on “hope this ran at 16ms intervals”.</li></ul><p>Why RAF beats setTimeout for animation:</p><ul><li><strong>No drift</strong>: setTimeout gets delayed by other tasks, leading to uneven intervals.</li><li><strong>No wasted frames</strong>: RAF callbacks only run when the browser is actually painting.</li><li><strong>Better performance</strong>: Browser can coalesce and optimize.</li></ul><h3>8. Microtasks: Promises and Friends</h3><p>Now for the sneaky ones: <strong>microtasks</strong>.</p><p>Examples:</p><ul><li>Promise .then and .catch callbacks</li><li>async/await behind the scenes</li><li>MutationObserver callbacks</li></ul><p>These are queued in the <strong>microtask queue</strong>.</p><p>When are microtasks processed?</p><ul><li><strong>Right after the current JavaScript stack empties</strong></li><li><strong>Before the next task or render step</strong></li></ul><p>Microtasks run with <strong>higher priority</strong> than macrotasks (tasks).</p><pre>console.log(&quot;A&quot;);<br>setTimeout(() =&gt; {<br>  console.log(&quot;Task (macrotask)&quot;);<br>}, 0);<br>Promise.resolve().then(() =&gt; {<br>  console.log(&quot;Microtask (promise)&quot;);<br>});<br>console.log(&quot;B&quot;);</pre><p>Output:</p><pre>A<br>B<br>Microtask (promise)<br>Task (macrotask)</pre><p>Flow:</p><ol><li>Run main script (A, schedule timeout, schedule microtask, B).</li><li>JS stack empty → run <strong>all microtasks</strong>.</li><li>Then event loop picks the next <strong>task</strong> (the timeout).</li></ol><p>Important behavior:</p><ul><li>Microtasks <strong>run to completion</strong>, including any new microtasks created by other microtasks.</li><li>You <em>can</em> starve rendering and tasks if you create an infinite microtask chain.</li></ul><pre>function loop() {<br>  Promise.resolve().then(loop);<br>}<br>loop(); // Congratulations, you just blocked rendering via microtasks.</pre><h3>9. Task vs Microtask vs RAF: The Cheat Sheet</h3><p><strong>Task (Macrotask)</strong></p><ul><li><strong>When it runs</strong>: One at a time, picked by event loop</li><li><strong>Relation to rendering</strong>: Rendering can happen <strong>between tasks</strong></li><li><strong>Examples</strong>: setTimeout, events, network callbacks, worker messages</li><li><strong>Characteristics</strong>: Heavyweight; run to completion; can block rendering if long</li></ul><p><strong>Microtask</strong></p><ul><li><strong>When it runs</strong>: After current JS stack is empty</li><li><strong>Relation to rendering</strong>: Runs <strong>before</strong> the next task or render step</li><li><strong>Examples</strong>: Promise callbacks, MutationObserver</li><li><strong>Characteristics</strong>: High priority; runs to completion (including newly queued microtasks); can block rendering if misused</li></ul><p><strong>requestAnimationFrame (RAF)</strong></p><ul><li><strong>When it runs</strong>: During render steps</li><li><strong>Relation to rendering</strong>: <strong>Directly synced</strong> with display refresh; once per frame</li><li><strong>Examples</strong>: Animations, visual updates</li><li><strong>Characteristics</strong>: Best for smooth animations; avoids drift and wasted work</li></ul><h3>10. Gotchas That Bite Frontend Engineers</h3><h4>1. Infinite loops block everything</h4><pre>while (true) {} // JS, rendering, events... all dead.</pre><p>No event loop magic can save you here. The main thread is stuck.</p><h4>2. Using setTimeout for animation</h4><p>This can cause:</p><ul><li><strong>Render inefficiency</strong>: You might update the DOM more often than the browser can render.</li><li><strong>Timing drift</strong>: setTimeout is not precise; delays add up.</li><li><strong>Visual jank</strong>: Uneven frame times make your animation feel off.</li></ul><p>Use requestAnimationFrame instead.</p><h4>3. Microtasks and “empty stack” behavior</h4><p>Microtasks run <strong>after</strong> JS finishes and <strong>before</strong> the next render or task.</p><p>This means:</p><ul><li>If you keep pushing microtasks inside microtasks, the browser can’t render.</li><li>Promise behavior can <strong>change</strong> depending on whether the JS stack is empty.</li></ul><p>Example: automated actions like element.click().</p><ul><li>If you trigger .click() programmatically <strong>inside</strong> existing JS, microtasks might be delayed longer than you expect, because the stack is not empty yet.</li><li>This can affect things like preventDefault, validations, or state updates that rely on promises.</li></ul><h3>11. Why This Matters if You’re a Frontend Engineer</h3><p>Understanding the event loop is not trivia. It’s how you:</p><ul><li>Avoid <strong>race conditions</strong> (“Why does this run before that?”)</li><li>Fix <strong>visual jank</strong> and dropped frames</li><li>Prevent <strong>frozen UIs</strong> caused by long tasks</li><li>Design <strong>smooth animations</strong> with requestAnimationFrame</li><li>Structure async code with <strong>tasks vs microtasks</strong> in mind</li><li>Debug weird behavior in frameworks that lean heavily on promises and microtasks</li></ul><p>React, Vue, Svelte, Solid, whatever — you’re still running on the same:</p><ul><li><strong>Main thread</strong></li><li><strong>Event loop</strong></li><li><strong>Task &amp; microtask queues</strong></li><li><strong>Render pipeline</strong></li></ul><p>If you want to be more than just a framework user and start being a <strong>frontend engineer</strong> this is the level you need to operate at.</p><h3>TL;DR Summary</h3><ul><li>The <strong>main thread</strong> is single-threaded; JS, DOM, and rendering live there. Block it, and you block the entire UI.</li><li>The <strong>event loop</strong> controls when JavaScript runs and when the browser renders.</li><li><strong>Tasks (macrotasks)</strong>: setTimeout, events, network responses. Run one at a time; rendering can occur between tasks.</li><li><strong>Microtasks</strong>: Promise callbacks and MutationObserver. Run after the JS stack empties and <strong>before</strong> the next task or render. High priority; can starve rendering.</li><li><strong>requestAnimationFrame</strong>: Run during render steps, synced with display refresh. Use it for animations instead of setTimeout.</li><li>Proper understanding of the event loop helps you avoid <strong>race conditions</strong>, <strong>visual jank</strong>, and <strong>inefficient DOM updates</strong>, and makes your apps feel <strong>fast, intentional, and premium.</strong></li></ul><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=574a26268147" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The New CSS Positioning System Explained, Plus 10 Advanced CSS Tips just for you ;)]]></title>
            <link>https://medium.com/@idanka322/the-new-css-positioning-system-explained-plus-10-advanced-css-tips-just-for-you-0f5a3e19b883?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f5a3e19b883</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Wed, 12 Nov 2025 13:10:20 GMT</pubDate>
            <atom:updated>2025-11-12T13:10:20.899Z</atom:updated>
            <content:encoded><![CDATA[<h3>The New CSS Positioning System Explained, Plus 10 Advanced CSS Tips just for you ;)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qymf4vKA23QrdgfX.png" /></figure><h3>The Future of CSS Positioning Is Here! No JavaScript Required</h3><p><em>and 10 Modern CSS Tips You’ll Wish You Knew Sooner</em></p><p>In my <a href="https://medium.com/@daniakabani/tailwind-css-sucks-and-thats-okay-why-it-s-not-real-css-and-why-you-re-not-a-frontend-engineer-7567eb57eef6">previous article</a> i talked about Tailwind, how it is not CSS, and how can you become a CSS master knowing foundational CSS rules, and fundamentals, today, you and I will take what you learned to the next level, and beyond, let’s do this!</p><p>Let’s be honest; for years, front-end engineers have been <em>gaslit</em> into thinking everything needs JavaScript.<br>Dropdowns? JS. Tooltips? JS. Modals? JS.<br>And then Tailwind came along and said, “bro, just add 37 utility classes and call it a day.”</p><p>But now, modern CSS has entered its golden age.<br>We’re talking native popovers, anchor positioning, fallback layouts; all handled by the browser, no JavaScript gymnastics required.</p><p>Let’s dive in!</p><h3>1. Popovers Made Easy</h3><p>No event listeners. No toggle scripts. Just… this:</p><pre>&lt;button popovertarget=&quot;menu&quot; id=&quot;menu-button&quot;&gt;Menu&lt;/button&gt;<br>&lt;div id=&quot;menu&quot; popover&gt;Dropdown content here&lt;/div&gt;</pre><p>Click the button → popup opens.<br>Click anywhere else → it closes.</p><p>That’s the new popover API doing its magic.<br>And popovertarget links the trigger to its content; <strong>no JS required</strong>.</p><h3>2. Anchor Positioning</h3><p>Now let’s position that popover <em>intelligently; </em>relative to its button.</p><pre>#menu-button {<br>  anchor-name: --menu-button;<br>}</pre><pre>#menu {<br>  position: absolute;<br>  position-anchor: --menu-button;<br>}</pre><p>This says:</p><blockquote><em>“Hey menu, your anchor is this button.”</em></blockquote><p>Now you can align them elegantly; bottom center, top right, or even pixel-perfect.</p><p>Read more about this <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position-anchor">here</a></p><h3>3. Controlling Placement</h3><p>Option A: the <strong>position-area</strong> syntax.<br> Think of a 3×3 grid: top/center/bottom × left/center/right.</p><pre>#menu {<br>  position-area: bottom center;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KOFf9nj_k-VQOcXY.png" /></figure><p>Option B: the <strong>anchor()</strong> function — for laser precision:</p><pre>#menu {<br>  top: anchor(bottom);<br>  left: anchor(left);<br>}</pre><p>That means:</p><blockquote><em>“Attach your top edge to my bottom edge, align our left edges.”</em></blockquote><p>Read more about <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position-area">position-area here</a>, and <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/anchor">anchor() here</a></p><h3>4. Fallbacks that Think for Themselves</h3><p>Here’s where CSS becomes a sentient being.<br>When your button is near the screen’s edge, your menu might overflow.<br>Not anymore.</p><pre>@position-try --below-right {<br>  inset: unset;<br>  top: anchor(bottom);<br>  left: anchor(left);<br>}</pre><pre>@position-try --bottom-left {<br>  inset: unset;<br>  top: anchor(bottom);<br>  right: anchor(right);<br>}</pre><pre>#menu {<br>  position-try: --bottom-right, --bottom-left;<br>}</pre><p>If the menu doesn’t fit below-right, it automatically flips to below-left.<br>No JS. No math. No broken layouts.</p><p>Read more about <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@position-try">position-try here</a></p><p>The final result?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ioTpq3l3ZRbnCXpiovZ8pw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Y0RHX7GVLhWESNEiKzhAg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0EBjq-KEAl26sD22sahddg.png" /></figure><h3>5. Big Picture</h3><p>This isn’t a minor update; it’s a paradigm shift:<br> Native intelligent positioning<br> Built-in fallback logic<br> Zero JavaScript overhead</p><p>Currently Chrome-only (for now), but once this hits full support, so be mindful of using this on production, but soon enough it will be widely adopted.<br><strong>your “usePopper.js” dependency is toast.</strong></p><h3>10 Modern CSS Tips You’ll Wish You Knew Sooner</h3><p>CSS is finally the elegant powerhouse it was always meant to be.<br> Here are 10 techniques that make your UI beautiful, performant, and maintainable.</p><h3>1. Gradient Borders ; No Pseudo-Elements Needed</h3><pre>.my-box {<br>  border: 5px solid;<br>  border-image: linear-gradient(45deg, #ff3cac, #784ba0, #2b86c5) 1;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JhMeNMcpeVO_SCRU.png" /></figure><p>Yes, that’s a real gradient border; no ::before wrappers.</p><h3>2. Masonry Layout in One Line</h3><pre>.gallery {<br>  columns: 3 300px;<br>  column-gap: 1rem;<br>}</pre><p>Three columns, responsive, Pinterest-style.<br> No JS, no Grid. Just CSS columns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VMlRhhihbsTFBz8h.png" /></figure><h3>3. Beautiful Form Elements</h3><pre>input[type=&quot;checkbox&quot;],<br>input[type=&quot;radio&quot;],<br>progress,<br>input[type=&quot;range&quot;] {<br>  accent-color: #ff3cac;<br>}</pre><pre>input[type=&quot;text&quot;] {<br>  caret-color: #ff3cac;<br>}</pre><p>Your checkboxes, radios, sliders, and cursors; all on brand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*7fi_MTeinBGtuI_a.png" /></figure><h3>4. Simplify Absolute Positioning with inset</h3><pre>.child {<br>  position: absolute;<br>  inset: 0;<br>  margin: auto;<br>  width: 100px;<br>  height: 100px;<br>}</pre><p>inset: 0; margin: auto;<br> Centers any element <em>perfectly</em>. Forget translate(-50%, -50%).</p><h3>5. Smarter Overflow</h3><pre>.container {<br>  overflow-y: auto;<br>  overflow-x: hidden;<br>}</pre><p>No ugly scrollbars. No cut-off content.<br>auto adds scrollbars <em>only</em> when needed.</p><h3>6. Shadows that Respect Transparency</h3><pre>.icon {<br>  filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.4));<br>}</pre><p>Unlike box-shadow, this one wraps around the actual visible shape.<br>Perfect for PNGs or SVGs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Uv_vGk8r_UHZ4IuT.jpg" /></figure><h3>🪄 7. Animate “height: auto” with Grid</h3><pre>.details {<br>  display: grid;<br>  grid-template-rows: 1.5em 0fr;<br>  transition: grid-template-rows 0.4s ease;<br>  overflow: hidden;<br>}</pre><pre>.details.open {<br>  grid-template-rows: 1.5em 1fr;<br>}</pre><p>A pure CSS accordion; smooth, flexible, and no JS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*_pFOfXS6XlD9FVfF.gif" /></figure><h3>8. Shape Anything with clip-path</h3><pre>.image {<br>  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);<br>}</pre><p>Cut triangles, stars, blobs; all natively.<br>Use <a href="https://bennettfeely.com/clippy/">Clippy</a> to visually design complex shapes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*o-g15K29fXrPp8C0.jpg" /></figure><h3>9. Dynamic Text from HTML Attributes</h3><pre>&lt;button data-label=&quot;Follow&quot;&gt;&lt;/button&gt;</pre><pre>button::after {<br>  content: attr(data-label);<br>  display: block;<br>}</pre><p>Now your pseudo-elements can read dynamic data.<br>Perfect for badges, labels, or dynamic states.</p><h3>10. Conic Gradients + CSS Variables = Pure Magic</h3><pre>.loader {<br>  --angle: 0deg;<br>  background: conic-gradient(from var(--angle), #ff3cac, #784ba0, #ff3cac);<br>  animation: spin 2s linear infinite;<br>  border-radius: 50%;<br>}</pre><pre>@keyframes spin {<br>  to { --angle: 360deg; }<br>}</pre><p>Smooth, GPU-friendly, and framework-free.<br>This is how you make beautiful loaders in 2025.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*H1e9KvbV6R-QNlhH.gif" /></figure><h3>Final Thoughts</h3><p>CSS isn’t broken; it’s evolving.<br>We just stopped paying attention while frameworks sold us shortcuts.</p><p>Once you start using these tools, you’ll realize:</p><blockquote><em>Tailwind isn’t the future of CSS.<br> </em><strong><em>CSS is.</em></strong></blockquote><p>Forget the bloat. Build like it’s 2025.<br>And next time someone says “just use a div,”<br>show them what real front-end engineering looks like.</p><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f5a3e19b883" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Didn’t Kill HTML; Our Laziness Did]]></title>
            <link>https://medium.com/@idanka322/react-didnt-kill-html-our-laziness-did-65b625f0bd50?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/65b625f0bd50</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Fri, 07 Nov 2025 03:46:33 GMT</pubDate>
            <atom:updated>2025-11-07T03:46:33.087Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ES09GQi1F8Vmr-jJ.png" /></figure><blockquote><em>“If your entire React app is a </em><em>&lt;div&gt; wrapped inside another </em><em>&lt;div&gt;, wrapped inside 14 more </em><em>&lt;div&gt;s… congratulations! You’ve built the world’s most semantic soup ;)”</em></blockquote><p>Let’s be real for a second.<br>As of today the year is 2025. We live in the golden age of frontend frameworks; React, Next.js, Astro, you name it.<br>But somewhere along the way, developers collectively decided that HTML doesn’t matter anymore.</p><p>All hail the &lt;div&gt;.<br>The one true tag.<br>The beginning and the end of all modern web UIs.</p><p>You open some “senior React developer”’s codebase and see something like this:</p><pre>&lt;div className=&quot;app&quot;&gt;<br>  &lt;div className=&quot;container&quot;&gt;<br>    &lt;div className=&quot;content&quot;&gt;<br>      &lt;div className=&quot;section&quot;&gt;<br>        &lt;div className=&quot;card&quot;&gt;<br>          &lt;div className=&quot;header&quot;&gt;Welcome&lt;/div&gt;<br>          &lt;div className=&quot;body&quot;&gt;Here’s some text&lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>14 &lt;div&gt;s. Zero semantics.<br>No context, no structure, no meaning; just visual spaghetti.</p><p>And these are the same people who say “React is declarative.”<br>Bro, it’s <em>barely readable</em>.</p><h3>The “Div-Driven Development” Epidemic</h3><p>We need to talk about <strong>Div-Driven Development (DDD)</strong> — the silent killer of modern UIs.</p><h3>Problem 1; Unnecessary DOM Clutter</h3><p>Every extra &lt;div&gt; means another element for the browser to paint, another node to track, another headache for your layout engine.<br>It bloats your DOM faster than a Tailwind fan at a kebab buffet.</p><h3>Problem 2; Style Collisions</h3><p>Ever seen styles “randomly break” because of nested containers with conflicting flexbox rules?<br>Yeah, that’s because you wrapped your wrapper inside a wrapper that wraps another wrapper. (I see you!)</p><p>CSS doesn’t know which parent is which anymore; it’s like trying to parent 12 identical twins.</p><h3>Problem 3; Accessibility and SEO</h3><p>Search engines and screen readers don’t “see” your styles; they read your HTML structure.<br>If everything is a &lt;div&gt;, your page might as well be written in <strong>Wingdings</strong>.</p><p>No &lt;header&gt;, &lt;main&gt;, &lt;article&gt;?<br>Google has no idea what’s important. Screen readers have no clue where to start.</p><p><strong>Remember:</strong> Not only folks with eyes are viewing your site. if not everyone is able to visit, and enjoy your site, then you are not a frontend engineer, you are a con artist.</p><h3>Problem 4; Developer Sanity</h3><p>When your JSX tree looks like a <strong>Jenga tower made of divs</strong>, debugging layout bugs becomes a horror movie.</p><h3>The Forgotten Magic of Semantic HTML</h3><p>Let’s bring back the lost art of writing HTML that <em>means something</em>.</p><p>Semantic elements are not there to make HTML “pretty.”<br>They exist to give your markup <strong>structure, hierarchy, and accessibility</strong> — for free.</p><p>Here’s your cheat sheet to becoming a civilized React developer again:</p><h3>&lt;article&gt;; The Story Container</h3><p>Use it for standalone content like blog posts, cards, or feed items.<br>If it makes sense on its own, it’s an &lt;article&gt;.</p><p>You can read more about &lt;article&gt; <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/article">here</a></p><pre>&lt;article&gt;<br>  &lt;header&gt;<br>    &lt;h2&gt;Why Divs Are the Real Villains of Frontend&lt;/h2&gt;<br>  &lt;/header&gt;<br>  &lt;p&gt;This post explores how semantic HTML can save your sanity.&lt;/p&gt;<br>&lt;/article&gt;</pre><h3>&lt;aside&gt;; The Sidekick</h3><p>Sidebars, ads, secondary info; that’s what &lt;aside&gt; is for. Stop putting your sidebar in &lt;div class=&quot;sidebar&quot;&gt; like it’s 2010.</p><p>You can reade more about <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/aside">Aside here</a></p><pre>&lt;aside&gt;<br>  &lt;h3&gt;Related Posts&lt;/h3&gt;<br>  &lt;ul&gt;&lt;li&gt;Learn Flexbox in 5 Minutes&lt;/li&gt;&lt;/ul&gt;<br>&lt;/aside&gt;</pre><h3>&lt;section&gt;; Logical Grouping</h3><p>A section groups content around a specific theme or purpose.<br> Think of it as a “chapter” of your page.</p><p>You can reade more about <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/section">&lt;section&gt; here</a></p><pre>&lt;section&gt;<br>  &lt;h2&gt;Features&lt;/h2&gt;<br>  &lt;p&gt;Here’s why you’ll love this product.&lt;/p&gt;<br>&lt;/section&gt;</pre><h3>&lt;nav&gt;; Navigation, Literally</h3><p>Stop using &lt;div class=&quot;nav&quot;&gt;. Please.<br> Your future self will thank you when screen readers automatically announce your nav as “navigation.”</p><p>You can read more about <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/nav">&lt;nav&gt; here</a></p><pre>&lt;nav&gt;<br>  &lt;ul&gt;<br>    &lt;li&gt;&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br>    &lt;li&gt;&lt;a href=&quot;/blog&quot;&gt;Blog&lt;/a&gt;&lt;/li&gt;<br>  &lt;/ul&gt;<br>&lt;/nav&gt;</pre><h3>&lt;figure&gt; + &lt;figcaption&gt;; Media With Context</h3><p>Images and diagrams deserve context. Don’t bury them in a &lt;div&gt;.</p><p>Read more about <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/figure">&lt;figure&gt;</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/figcaption">&lt;figcaption&gt;</a></p><pre>&lt;figure&gt;<br>  &lt;img src=&quot;div-hell.jpg&quot; alt=&quot;A mountain of nested divs&quot; /&gt;<br>  &lt;figcaption&gt;The modern frontend developer’s natural habitat.&lt;/figcaption&gt;<br>&lt;/figure&gt;</pre><h3>⏰ &lt;time&gt;; Date With Meaning</h3><p>When you mark up dates with &lt;time&gt;, machines understand them.<br> Useful for SEO, feeds, and search previews.</p><p>Read more about <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/time">&lt;time&gt; here</a></p><pre>&lt;time datetime=&quot;2025-11-03&quot;&gt;November 3, 2025&lt;/time&gt;</pre><h3>&lt;details&gt; + &lt;summary&gt;; Native Expand/Collapse</h3><p>No JavaScript. No state management. No reason not to use it.</p><p>You can read more about <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/details">&lt;details&gt;</a> &amp; <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/summary">&lt;summary&gt;</a></p><pre>&lt;details&gt;<br>  &lt;summary&gt;Why Semantic HTML Matters&lt;/summary&gt;<br>  &lt;p&gt;Because Google, screen readers, and your coworkers will love you for it.&lt;/p&gt;<br>&lt;/details&gt;</pre><h3>🎯 &lt;main&gt;, &lt;header&gt;, &lt;footer&gt;, &lt;form&gt;, &lt;mark&gt;</h3><ul><li>&lt;main&gt; — The <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/main">main</a> content of your page. One per view.</li><li>&lt;header&gt; — A <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/header">header</a> is used for intro or navigational elements.</li><li>&lt;footer&gt; — A <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/footer">footer</a> is used for Metadata, links, or closing notes.</li><li>&lt;form&gt; — Actual <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/form">forms</a> (yes, people still forget).</li><li>&lt;mark&gt; — A <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/mark">mark</a> is used for highlighting text. Like a built-in yellow highlighter.</li></ul><h3>🧠 Why Semantic HTML Still Matters in 2025</h3><p>You’re not writing HTML for your GPU.<br>You’re writing it for:</p><ul><li>Search engines</li><li>Screen readers</li><li>Fellow developers</li><li>Future you</li></ul><p>Semantic HTML:<br>Improves accessibility<br>Boosts SEO<br>Simplifies CSS<br>Reduces DOM clutter<br>Makes your code human-readable</p><h3>React Developers, Please Stop Writing &lt;div&gt; Soup</h3><p>JSX is not a get-out-of-HTML-free card.<br>Fragments (&lt;&gt; &lt;/&gt;) are not the answer either; they’re just invisible divs with better PR.</p><p>If you build everything with &lt;div&gt;s and &lt;Fragment&gt;, you’re not building <em>components; </em>you’re building <strong>containers for pain</strong>.</p><h3>Final Words</h3><p>HTML is the language of the web.<br>CSS is its style.<br>JavaScript is its behavior.</p><p>If you treat HTML like a second-class citizen, your React app will reflect that; in SEO, accessibility, performance, and sanity.</p><p>Stop writing &lt;div&gt; soup.<br>Start writing meaningful markup.<br>The web deserves better, and it is our responsibility as engineers to make it a better place for everyone.</p><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65b625f0bd50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tailwind CSS Sucks (and That’s Okay): Why It’s Not Real CSS, and Why You’re Not a Frontend Engineer…]]></title>
            <link>https://medium.com/@idanka322/tailwind-css-sucks-and-thats-okay-why-it-s-not-real-css-and-why-you-re-not-a-frontend-engineer-7567eb57eef6?source=rss-66d161e9298f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7567eb57eef6</guid>
            <category><![CDATA[css]]></category>
            <category><![CDATA[tailwind-css]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Dan A]]></dc:creator>
            <pubDate>Mon, 03 Nov 2025 05:48:41 GMT</pubDate>
            <atom:updated>2025-11-03T08:45:56.542Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tailwind CSS Sucks (and That’s Okay): Why It’s Not Real CSS, and Why You’re Not a Frontend Engineer If You Don’t Know CSS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/0*K61_fjETBuiMTL4O.jpeg" /></figure><blockquote>“Tailwind is the worst way to do CSS… except for all the other ways that have been tried.”</blockquote><p>Let’s get this out of the way:<br>I’ve shipped production apps in Tailwind. I’ve used it at scale. I’ve built design systems with it.</p><p>And I still think Tailwind <strong>sucks</strong>.</p><p>Not because it doesn’t work; it works brilliantly.<br>But because it teaches you <em>just enough</em> to build things fast, while ensuring you never actually understand CSS.</p><p>Tailwind isn’t CSS. It’s a clever abstraction, a layer of linguistic sugar that whispers sweet nothings to your dopamine receptors while robbing you of long-term control.<br>Let’s unpack that.</p><h3>Problem 1: Co-location and Naming Hell</h3><p>Traditional CSS separates styling from markup — meaning you have to name everything yourself:<br>.btn-primary, .card-container, .navbar-right-thingy, etc.</p><p>And then you forget which class does what, three weeks later.</p><p><strong>Tailwind fix:</strong> standardized utility classes directly in your HTML.<br>It looks messy, but you instantly know what styles apply and can edit safely.</p><p><em>Pro tip:</em> Install the “Inline Fold” VS Code extension, it hides long Tailwind class lists like magic.</p><p>But here’s the irony:<br>Tailwind solved <em>naming hell</em> by… making you memorize <strong>hundreds of cryptic abbreviations</strong> instead.<br>If you’ve ever spent five minutes wondering if it’s justify-between or justify-around, congratulations; you’re learning Tailwind, not CSS.</p><h3>Problem 2: CSS Verbosity</h3><p>Yes, CSS can be verbose.<br>Want a fixed header? Write 10 lines.<br>Tailwind? fixed top-0 left-0 right-0 z-50 bg-white. Done.</p><p><strong>Tailwind fix:</strong> concise utility names that bundle multiple properties.<br><strong>Downside</strong>: you must learn Tailwind’s naming conventions; another dialect, another abstraction.</p><p>If you’re fluent in Tailwind, you’ve mastered <em>Tailwind</em>.<br>If you’re fluent in CSS, you can build <em>anything</em>.</p><h3>Problem 3: Control and Consistency</h3><p>Vanilla CSS gives you too much freedom.<br>Bootstrap gives you too little.<br>Tailwind strikes a balance; consistent constraints, yet fully customizable.</p><p>But here’s the catch: the moment you start “customizing,” you’re knee-deep in tailwind.config.js, defining theme extensions and color scales.<br>You just reinvented your own design system… with extra steps.</p><h3>Problem 4: Zombie Styles</h3><p>I’ll give Tailwind this: its dead-code elimination is chef’s kiss.<br>No unused CSS. No bloat.<br>Your bundle is as lean as your last salary raise.</p><p>But you paid for that convenience with a PostCSS pipeline, a CLI, and more dev dependencies than an npm influencer starter pack.</p><h3>Trade-offs &amp; Verdict</h3><p>Tailwind is <strong>fast</strong>, <strong>convenient</strong>, and <strong>productive; </strong>until you need to debug why overflow-hidden suddenly breaks your layout.</p><p>For large projects, it’s worth the setup.<br>For quick demos, maybe try PicoCSS.<br>For learning? Stick with native CSS first.</p><blockquote><em>If you like Tailwind, use it.<br>If you don’t, don’t.<br>Nobody cares; except you.</em></blockquote><h3>Now, Let’s Talk About Real CSS</h3><p>You can’t call yourself a frontend engineer if you don’t know CSS.<br>You’re a <strong>markup mechanic</strong>, not an <strong>interface architect</strong>.</p><p>So let’s fix that.</p><p>Here are <strong>11 CSS techniques</strong> that’ll make you forget Tailwind ever existed.</p><h3>Tip #1 — Learn CSS Fundamentals (Skip the Frameworks… for Now)</h3><p>Frameworks are fast food: tasty, but not nutritious.</p><p>If you start with Tailwind, you’re learning <em>Tailwind</em>, not CSS.<br>When you eventually “divorce” it, you’ll realize it’s a messy breakup.</p><p>Master the box model, positioning, and display properties first; so when you use frameworks later, you’re in control, not dependent.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS">Best source to learn CSS</a></p><h3>Tip #2 — Understand the Box Model (The Heart of CSS)</h3><p>Everything is a box. Once you <em>see</em> that, CSS starts making sense.</p><p>Use browser dev tools (especially Firefox) to visualize this. Which brings us to…</p><p><a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Box_model">Learn the box model in details</a></p><h3>Tip #3 — Debug CSS in Firefox, Not Chrome</h3><p>Firefox DevTools show you <strong>the box model</strong>, <strong>flexbox</strong>, and <strong>grid</strong> visually.<br>Chrome? It’s fine; until you need real layout introspection.</p><p><a href="https://medium.com/@daniakabani/how-to-debug-your-frontend-code-like-a-distinguished-engineer-c31a2ecc0b6e">Checkout this article i wrote to become an expert debugger.</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WjTfzj6943Hy05jY.png" /></figure><h3>Tip #4 — Flexbox: Center Everything Without Pain</h3><p>Old way:</p><pre>.center-me {<br>  position: absolute;<br>  top: 50%;<br>  left: 50%;<br>  transform: translate(-50%, -50%);<br>}</pre><p>Modern way:</p><pre>.parent {<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8BzGcw6-cgOYHidD.png" /></figure><p>Clean. Readable. Universal.<br>If you can’t center a div with Flexbox, you don’t need Tailwind; you need therapy.</p><p><a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/CSS_layout/Flexbox">Learn Flexbox in deep detail</a></p><h3>Tip #5 — CSS Grid: The Big-Picture Layout</h3><p>Flexbox is great for one dimension.<br>Grid is your 2D superpower.</p><pre>.container {<br>  display: grid;<br>  grid-template-columns: 1fr 2fr 1fr;<br>  grid-template-rows: auto 200px;<br>  gap: 1rem;<br>}</pre><p>Grid can replace 50–70% of your HTML wrappers.<br>It’s like tables; but with taste.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/grid">Learn grid layout in detail</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tOWCG3axvyo5bUTt.jpg" /></figure><h3>Tip #6 — Write Responsive CSS Without Media Query Headaches</h3><pre>.article {<br>  width: clamp(200px, 50%, 600px);<br>}</pre><p>No more media query chaos.<br>clamp() does the math for you; simple, elegant, future-proof.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UqIvqNtU3oYylNxQ.jpg" /></figure><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/clamp">Learn CSS clamp() function</a></p><h3>Tip #7 — CSS Variables for Dynamic Themes</h3><pre>:root {<br>  --brand-color: #ff3cac;<br>}<br>button {<br>  background: var(--brand-color);<br>}</pre><p>Change one line, update your entire theme.<br>Combine with calc() for clever logic and responsive magic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*e_Sy--sdUTHea-id" /></figure><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_cascading_variables/Using_CSS_custom_properties">Learn CSS custom properties in detail</a></p><h3>Tip #8 — CSS Counters</h3><p>You can count stuff. In CSS. No JS.</p><pre>body { counter-reset: section; }<br>h2::before {<br>  counter-increment: section;<br>  content: counter(section) &quot;. &quot;;<br>}</pre><p>Your headings now number themselves.<br>Minimalism? No; wizardry.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/counter">Learn CSS counter() function</a></p><h3>Tip #9 — :focus-within — Dropdowns Without JavaScript</h3><pre>.dropdown:focus-within .menu {<br>  display: block;<br>}</pre><p>It stays open when you focus child elements.<br>One selector replaces 30 lines of JS.<br>You’re welcome.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-within">Learn focus-within property in detail</a></p><h3>🧰 Tip #10 — PostCSS + Autoprefixer = Sanity</h3><p>Vendor prefixes are the herpes of the web; they never truly go away.<br>Let PostCSS handle them for you. You’ll sleep better.</p><p><a href="http://postcss.org/">Checkout PostCSS</a></p><h3>🧩 Tip #11 — Use aspect-ratio, not padding hacks</h3><pre>video {<br>  aspect-ratio: 16 / 9;<br>}</pre><p>No wrappers. No hacks. Just elegant CSS.</p><p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/aspect-ratio">Checkout aspect-ratio property in detail</a></p><h3>Final Thoughts</h3><p>Tailwind didn’t ruin frontend development; it revealed how many developers never really learned CSS.</p><p>If you understand CSS, Tailwind becomes a tool.<br>If you don’t, Tailwind becomes a crutch.</p><p>So go learn the language that built the web.<br>Then come back and bend Tailwind to <em>your</em> will; not the other way around.</p><p>🔥 <strong>Part 2 coming soon:</strong></p><blockquote><em>“Beyond Tailwind: Modern CSS Tricks You Probably Don’t Know — But Should.”</em></blockquote><p><em>I’m a founding Staff Engineer building AI-first applications through LLMs, RAG pipelines, and real-time web architectures. Follow me for deep dives into engineering patterns, scalability, and modern AI system design.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7567eb57eef6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>