<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tanoy Basak</title>
    <description>The latest articles on DEV Community by Tanoy Basak (@tanoy_basak).</description>
    <link>https://dev.to/tanoy_basak</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1508660%2F1296627b-b8e5-4c83-930b-6626865d53dd.jpg</url>
      <title>DEV Community: Tanoy Basak</title>
      <link>https://dev.to/tanoy_basak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanoy_basak"/>
    <language>en</language>
    <item>
      <title>Brain.JS -- The intelligence for your frontend app</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Thu, 17 Oct 2024 05:45:53 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/brainjs-the-intelligence-for-your-frontend-app-14ak</link>
      <guid>https://dev.to/tanoy_basak/brainjs-the-intelligence-for-your-frontend-app-14ak</guid>
      <description>&lt;p&gt;🚀 𝐋𝐨𝐨𝐤𝐢𝐧𝐠 𝐭𝐨 𝐚𝐝𝐝 𝐬𝐨𝐦𝐞 𝐢𝐧𝐭𝐞𝐥𝐥𝐢𝐠𝐞𝐧𝐜𝐞 𝐭𝐨 𝐲𝐨𝐮𝐫 𝐟𝐫𝐨𝐧𝐭𝐞𝐧𝐝 𝐚𝐩𝐩? 🎨🤖&lt;/p&gt;

&lt;p&gt;If you've ever struggled to choose the right text color for a dynamic background (we've all been there 🙋‍♂️), here’s a cool solution using Brain.js—a simple yet powerful JavaScript library for machine learning right in your browser!&lt;/p&gt;

&lt;p&gt;I recently explored Brain.js to solve this very problem: automatically selecting black or white text based on any background color for better readability.&lt;/p&gt;

&lt;p&gt;💡 𝐇𝐨𝐰 𝐝𝐨𝐞𝐬 𝐢𝐭 𝐰𝐨𝐫𝐤?&lt;/p&gt;

&lt;p&gt;Train a neural network with sample background colors and the most suitable text color.&lt;/p&gt;

&lt;p&gt;Input new background colors and let Brain.js predict which text color (black or white) offers the best contrast.&lt;/p&gt;

&lt;p&gt;Implement this directly into your app to make text always readable, no matter the background!&lt;/p&gt;

&lt;p&gt;Here’s an example prediction: For an orange-ish background color { r: 1, g: 0.4, b: 0 }, Brain.js tells me:&lt;/p&gt;

&lt;p&gt;White Text: 99% confidence ✅&lt;/p&gt;

&lt;p&gt;Black Text: 0.2% confidence ❌&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1augsq270f7yhe7e3dp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq1augsq270f7yhe7e3dp.png" alt="Image description" width="800" height="1053"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  javascript #machinelearning #webdevelopment #UIUX #brainjs #webdev #frontend #AI #React #DynamicUI
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>Automatic Batching in React 18</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Wed, 16 Oct 2024 04:57:01 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/automatic-batching-in-react-18-ddb</link>
      <guid>https://dev.to/tanoy_basak/automatic-batching-in-react-18-ddb</guid>
      <description>&lt;p&gt;React 18 introduces &lt;strong&gt;automatic batching&lt;/strong&gt; to optimize updates and improve performance. Batching is the process of grouping multiple state updates into a single re-render, reducing unnecessary renders and making updates more efficient.&lt;/p&gt;

&lt;p&gt;In previous versions of React, batching was limited to event handlers (e.g., clicks, input changes), but in asynchronous code like setTimeout, Promise, or async functions, state updates were not batched automatically. React 18 expands this batching to cover more cases, including asynchronous code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Automatic Batching Works:&lt;/strong&gt;&lt;br&gt;
When multiple setState calls are made, React now automatically batches these updates together, whether they happen inside an event handler, a timeout, or any asynchronous function. This ensures that React re-renders only once, no matter how many state updates occur in between.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1j6hh40i6m640nmj7h17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1j6hh40i6m640nmj7h17.png" alt="Image description" width="800" height="834"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Key Benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Performance: Reduces the number of renders when multiple state updates occur, making apps faster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cleaner Code: Developers no longer need to worry about manually batching updates in async code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>react</category>
    </item>
    <item>
      <title>Web Accessibility</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Tue, 06 Aug 2024 01:57:39 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/web-accessibility-4pp3</link>
      <guid>https://dev.to/tanoy_basak/web-accessibility-4pp3</guid>
      <description>&lt;p&gt;🌟 𝕮𝖍𝖆𝖒𝖕𝖎𝖔𝖓𝖎𝖓𝖌 𝖂𝖊𝖇 𝕬𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖎𝖑𝖎𝖙𝖞: 𝖀𝖓𝖑𝖔𝖈𝖐𝖎𝖓𝖌 𝖙𝖍𝖊 𝕯𝖎𝖌𝖎𝖙𝖆𝖑 𝖂𝖔𝖗𝖑𝖉 𝖋𝖔𝖗 𝕬𝖑𝖑! 🌟&lt;/p&gt;

&lt;p&gt;𝕴𝖓 𝖙𝖔𝖉𝖆𝖞'𝖘 𝖉𝖎𝖌𝖎𝖙𝖆𝖑 𝖆𝖌𝖊, 𝖜𝖊𝖇 𝖆𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖎𝖑𝖎𝖙𝖞 𝖎𝖘𝖓'𝖙 𝖏𝖚𝖘𝖙 𝖆 𝖋𝖊𝖆𝖙𝖚𝖗𝖊; 𝖎𝖙'𝖘 𝖆 𝖓𝖊𝖈𝖊𝖘𝖘𝖎𝖙𝖞. 𝕬𝖘 𝖉𝖊𝖛𝖊𝖑𝖔𝖕𝖊𝖗𝖘, 𝖉𝖊𝖘𝖎𝖌𝖓𝖊𝖗𝖘, 𝖆𝖓𝖉 𝖙𝖊𝖈𝖍 𝖊𝖓𝖙𝖍𝖚𝖘𝖎𝖆𝖘𝖙𝖘, 𝖜𝖊 𝖍𝖆𝖛𝖊 𝖙𝖍𝖊 𝖕𝖔𝖜𝖊𝖗—𝖆𝖓𝖉 𝖗𝖊𝖘𝖕𝖔𝖓𝖘𝖎𝖇𝖎𝖑𝖎𝖙𝖞—𝖙𝖔 𝖈𝖗𝖊𝖆𝖙𝖊 𝖎𝖓𝖈𝖑𝖚𝖘𝖎𝖛𝖊 𝖔𝖓𝖑𝖎𝖓𝖊 𝖊𝖝𝖕𝖊𝖗𝖎𝖊𝖓𝖈𝖊𝖘 𝖋𝖔𝖗 𝖊𝖛𝖊𝖗𝖞𝖔𝖓𝖊.&lt;/p&gt;

&lt;p&gt;🔓 𝖂𝖍𝖞 𝖂𝖊𝖇 𝕬𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖎𝖑𝖎𝖙𝖞 𝕸𝖆𝖙𝖙𝖊𝖗𝖘:&lt;/p&gt;

&lt;p&gt;𝕴𝖓𝖈𝖑𝖚𝖘𝖎𝖛𝖎𝖙𝖞: 𝕺𝖛𝖊𝖗 1 𝖇𝖎𝖑𝖑𝖎𝖔𝖓 𝖕𝖊𝖔𝖕𝖑𝖊 𝖜𝖔𝖗𝖑𝖉𝖜𝖎𝖉𝖊 𝖑𝖎𝖛𝖊 𝖜𝖎𝖙𝖍 𝖘𝖔𝖒𝖊 𝖋𝖔𝖗𝖒 𝖔𝖋 𝖉𝖎𝖘𝖆𝖇𝖎𝖑𝖎𝖙𝖞. 𝕬𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖑𝖊 𝖜𝖊𝖇𝖘𝖎𝖙𝖊𝖘 𝖊𝖓𝖘𝖚𝖗𝖊 𝖊𝖛𝖊𝖗𝖞𝖔𝖓𝖊 𝖈𝖆𝖓 𝖓𝖆𝖛𝖎𝖌𝖆𝖙𝖊 𝖆𝖓𝖉 𝖎𝖓𝖙𝖊𝖗𝖆𝖈𝖙 𝖜𝖎𝖙𝖍 𝖉𝖎𝖌𝖎𝖙𝖆𝖑 𝖈𝖔𝖓𝖙𝖊𝖓𝖙.&lt;/p&gt;

&lt;p&gt;𝕷𝖊𝖌𝖆𝖑 𝕮𝖔𝖒𝖕𝖑𝖎𝖆𝖓𝖈𝖊: 𝕬𝖉𝖍𝖊𝖗𝖎𝖓𝖌 𝖙𝖔 𝖘𝖙𝖆𝖓𝖉𝖆𝖗𝖉𝖘 𝖑𝖎𝖐𝖊 𝖂𝕮𝕬𝕲 𝖓𝖔𝖙 𝖔𝖓𝖑𝖞 𝖋𝖔𝖘𝖙𝖊𝖗𝖘 𝖎𝖓𝖈𝖑𝖚𝖘𝖎𝖛𝖎𝖙𝖞 𝖇𝖚𝖙 𝖆𝖑𝖘𝖔 𝖍𝖊𝖑𝖕𝖘 𝖆𝖛𝖔𝖎𝖉 𝖑𝖊𝖌𝖆𝖑 𝖈𝖔𝖒𝖕𝖑𝖎𝖈𝖆𝖙𝖎𝖔𝖓𝖘.&lt;/p&gt;

&lt;p&gt;𝕾𝕰𝕺 𝕭𝖊𝖓𝖊𝖋𝖎𝖙𝖘: 𝕾𝖊𝖆𝖗𝖈𝖍 𝖊𝖓𝖌𝖎𝖓𝖊𝖘 𝖑𝖔𝖛𝖊 𝖆𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖑𝖊 𝖜𝖊𝖇𝖘𝖎𝖙𝖊𝖘! 𝕴𝖒𝖕𝖗𝖔𝖛𝖊𝖉 𝖘𝖊𝖒𝖆𝖓𝖙𝖎𝖈𝖘 𝖆𝖓𝖉 𝖇𝖊𝖙𝖙𝖊𝖗 𝖈𝖔𝖓𝖙𝖊𝖓𝖙 𝖘𝖙𝖗𝖚𝖈𝖙𝖚𝖗𝖎𝖓𝖌 𝖈𝖆𝖓 𝖇𝖔𝖔𝖘𝖙 𝖞𝖔𝖚𝖗 𝖘𝖎𝖙𝖊'𝖘 𝖛𝖎𝖘𝖎𝖇𝖎𝖑𝖎𝖙𝖞.&lt;/p&gt;

&lt;p&gt;𝕰𝖓𝖍𝖆𝖓𝖈𝖊𝖉 𝖀𝖘𝖆𝖇𝖎𝖑𝖎𝖙𝖞: 𝕬𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖎𝖑𝖎𝖙𝖞 𝖋𝖊𝖆𝖙𝖚𝖗𝖊𝖘 𝖔𝖋𝖙𝖊𝖓 𝖑𝖊𝖆𝖉 𝖙𝖔 𝖇𝖊𝖙𝖙𝖊𝖗 𝖔𝖛𝖊𝖗𝖆𝖑𝖑 𝖚𝖘𝖊𝖗 𝖊𝖝𝖕𝖊𝖗𝖎𝖊𝖓𝖈𝖊, 𝖇𝖊𝖓𝖊𝖋𝖎𝖙𝖎𝖓𝖌 𝖆𝖑𝖑 𝖚𝖘𝖊𝖗𝖘.&lt;/p&gt;

&lt;p&gt;💡 𝕴𝖓𝖓𝖔𝖛𝖆𝖙𝖎𝖛𝖊 𝕿𝖎𝖕𝖘 𝖙𝖔 𝕰𝖓𝖍𝖆𝖓𝖈𝖊 𝖂𝖊𝖇 𝕬𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖎𝖑𝖎𝖙𝖞:&lt;/p&gt;

&lt;p&gt;𝕾𝖊𝖒𝖆𝖓𝖙𝖎𝖈 𝕳𝕿𝕸𝕷: 𝖀𝖘𝖊 𝖕𝖗𝖔𝖕𝖊𝖗 𝖙𝖆𝖌𝖘 𝖙𝖔 𝖈𝖔𝖓𝖛𝖊𝖞 𝖒𝖊𝖆𝖓𝖎𝖓𝖌 𝖆𝖓𝖉 𝖘𝖙𝖗𝖚𝖈𝖙𝖚𝖗𝖊. 𝕾𝖈𝖗𝖊𝖊𝖓 𝖗𝖊𝖆𝖉𝖊𝖗𝖘 𝖗𝖊𝖑𝖞 𝖔𝖓 𝖙𝖍𝖊𝖘𝖊 𝖙𝖔 𝖎𝖓𝖙𝖊𝖗𝖕𝖗𝖊𝖙 𝖈𝖔𝖓𝖙𝖊𝖓𝖙 𝖆𝖈𝖈𝖚𝖗𝖆𝖙𝖊𝖑𝖞.&lt;/p&gt;

&lt;p&gt;𝕬𝕽𝕴𝕬 𝕷𝖆𝖓𝖉𝖒𝖆𝖗𝖐𝖘: 𝕴𝖒𝖕𝖑𝖊𝖒𝖊𝖓𝖙 𝕬𝕽𝕴𝕬 (𝕬𝖈𝖈𝖊𝖘𝖘𝖎𝖇𝖑𝖊 𝕽𝖎𝖈𝖍 𝕴𝖓𝖙𝖊𝖗𝖓𝖊𝖙 𝕬𝖕𝖕𝖑𝖎𝖈𝖆𝖙𝖎𝖔𝖓𝖘) 𝖗𝖔𝖑𝖊𝖘 𝖆𝖓𝖉 𝖕𝖗𝖔𝖕𝖊𝖗𝖙𝖎𝖊𝖘 𝖙𝖔 𝖊𝖓𝖍𝖆𝖓𝖈𝖊 𝖓𝖆𝖛𝖎𝖌𝖆𝖙𝖎𝖔𝖓 𝖋𝖔𝖗 𝖆𝖘𝖘𝖎𝖘𝖙𝖎𝖛𝖊 𝖙𝖊𝖈𝖍𝖓𝖔𝖑𝖔𝖌𝖎𝖊𝖘.&lt;/p&gt;

&lt;p&gt;𝕶𝖊𝖞𝖇𝖔𝖆𝖗𝖉 𝕹𝖆𝖛𝖎𝖌𝖆𝖙𝖎𝖔𝖓: 𝕰𝖓𝖘𝖚𝖗𝖊 𝖆𝖑𝖑 𝖎𝖓𝖙𝖊𝖗𝖆𝖈𝖙𝖎𝖛𝖊 𝖊𝖑𝖊𝖒𝖊𝖓𝖙𝖘 𝖈𝖆𝖓 𝖇𝖊 𝖆𝖈𝖈𝖊𝖘𝖘𝖊𝖉 𝖛𝖎𝖆 𝖐𝖊𝖞𝖇𝖔𝖆𝖗𝖉. 𝕿𝖊𝖘𝖙 𝖚𝖘𝖎𝖓𝖌 𝖔𝖓𝖑𝖞 𝖙𝖍𝖊 𝕿𝖆𝖇, 𝕰𝖓𝖙𝖊𝖗, 𝖆𝖓𝖉 𝕾𝖕𝖆𝖈𝖊 𝖐𝖊𝖞𝖘.&lt;/p&gt;

&lt;p&gt;𝕮𝖔𝖑𝖔𝖗 𝕮𝖔𝖓𝖙𝖗𝖆𝖘𝖙: 𝕸𝖆𝖎𝖓𝖙𝖆𝖎𝖓 𝖍𝖎𝖌𝖍 𝖈𝖔𝖓𝖙𝖗𝖆𝖘𝖙 𝖇𝖊𝖙𝖜𝖊𝖊𝖓 𝖙𝖊𝖝𝖙 𝖆𝖓𝖉 𝖇𝖆𝖈𝖐𝖌𝖗𝖔𝖚𝖓𝖉. 𝕿𝖔𝖔𝖑𝖘 𝖑𝖎𝖐𝖊 𝕮𝖔𝖓𝖙𝖗𝖆𝖘𝖙 𝕮𝖍𝖊𝖈𝖐𝖊𝖗 𝖈𝖆𝖓 𝖍𝖊𝖑𝖕 𝖛𝖊𝖗𝖎𝖋𝖞 𝖈𝖔𝖒𝖕𝖑𝖎𝖆𝖓𝖈𝖊.&lt;/p&gt;

&lt;p&gt;𝕬𝖑𝖙 𝕿𝖊𝖝𝖙 𝖋𝖔𝖗 𝕴𝖒𝖆𝖌𝖊𝖘: 𝕻𝖗𝖔𝖛𝖎𝖉𝖊 𝖉𝖊𝖘𝖈𝖗𝖎𝖕𝖙𝖎𝖛𝖊 𝖆𝖑𝖙 𝖙𝖊𝖝𝖙 𝖋𝖔𝖗 𝖆𝖑𝖑 𝖎𝖒𝖆𝖌𝖊𝖘. 𝕿𝖍𝖎𝖘 𝖊𝖓𝖘𝖚𝖗𝖊𝖘 𝖚𝖘𝖊𝖗𝖘 𝖜𝖎𝖙𝖍 𝖛𝖎𝖘𝖚𝖆𝖑 𝖎𝖒𝖕𝖆𝖎𝖗𝖒𝖊𝖓𝖙𝖘 𝖚𝖓𝖉𝖊𝖗𝖘𝖙𝖆𝖓𝖉 𝖙𝖍𝖊 𝖛𝖎𝖘𝖚𝖆𝖑 𝖈𝖔𝖓𝖙𝖊𝖝𝖙.&lt;/p&gt;

&lt;p&gt;𝕽𝖊𝖘𝖕𝖔𝖓𝖘𝖎𝖛𝖊 𝕯𝖊𝖘𝖎𝖌𝖓: 𝕭𝖚𝖎𝖑𝖉 𝖗𝖊𝖘𝖕𝖔𝖓𝖘𝖎𝖛𝖊 𝖜𝖊𝖇𝖘𝖎𝖙𝖊𝖘 𝖙𝖍𝖆𝖙 𝖆𝖉𝖆𝖕𝖙 𝖘𝖊𝖆𝖒𝖑𝖊𝖘𝖘𝖑𝖞 𝖙𝖔 𝖉𝖎𝖋𝖋𝖊𝖗𝖊𝖓𝖙 𝖉𝖊𝖛𝖎𝖈𝖊𝖘 𝖆𝖓𝖉 𝖘𝖈𝖗𝖊𝖊𝖓 𝖘𝖎𝖟𝖊𝖘.&lt;/p&gt;

&lt;p&gt;𝙏𝙤𝙤𝙡𝙨 𝙞𝙣 𝙧𝙚𝙨𝙘𝙪𝙚:&lt;/p&gt;

&lt;p&gt;𝗮𝘅𝗲-𝗰𝗼𝗿𝗲: It is a robust JavaScript library designed to help developers test and improve the accessibility of their web applications.&lt;/p&gt;

&lt;p&gt;𝗙𝗲𝗮𝘁𝘂𝗿𝗲𝘀: &lt;br&gt;
Automated Testing&lt;/p&gt;

&lt;p&gt;Detailed Reporting&lt;/p&gt;

&lt;p&gt;Customizable Rules&lt;/p&gt;

&lt;p&gt;𝙇𝙚𝙩'𝙨 𝙗𝙪𝙞𝙡𝙙 𝙖𝙣 𝙖𝙘𝙘𝙚𝙨𝙨𝙞𝙗𝙡𝙚 𝙖𝙣𝙙 𝙞𝙣𝙘𝙡𝙪𝙨𝙞𝙫𝙚 𝙬𝙤𝙧𝙡𝙙 𝙩𝙤𝙜𝙚𝙩𝙝𝙚𝙧&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>a11y</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>React Fiber</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Wed, 31 Jul 2024 15:47:10 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/react-fiber-3lic</link>
      <guid>https://dev.to/tanoy_basak/react-fiber-3lic</guid>
      <description>&lt;p&gt;&lt;strong&gt;Exploring React Fiber: Enhancing Performance and Responsiveness&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React Fiber represents a complete overhaul of the React core algorithm, focusing on improving performance and responsiveness. Its primary objective is to enable incremental rendering, allowing React to divide rendering tasks into smaller chunks and pause or resume work as needed. This approach prioritizes updates, resulting in a smoother user experience, especially in large applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of React Fiber
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Incremental Rendering:&lt;/strong&gt; Fiber breaks down rendering tasks into smaller units, allowing React to yield control back to the browser when necessary, enhancing the application's responsiveness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Concurrency:&lt;/strong&gt; Fiber introduces the ability to manage multiple tasks concurrently, enabling efficient prioritization of updates and rendering management.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Boundaries:&lt;/strong&gt; Fiber introduces Error Boundaries, a new error-handling mechanism that allows developers to catch errors in the component tree and display fallback UI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scheduling:&lt;/strong&gt; Fiber's scheduling mechanism prioritizes and manages updates efficiently, ensuring high-priority updates are processed before lower-priority ones.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Fiber Lifecycle
&lt;/h3&gt;

&lt;p&gt;React Fiber introduces a new lifecycle for processing updates and rendering components, consisting of three main phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Render Phase:&lt;/strong&gt; In this phase, React calculates the new component tree based on updates (e.g., new state or props). Also known as the "reconciliation phase," React can pause and resume work during this phase, yielding control back to the browser to maintain responsiveness.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Commit Phase:&lt;/strong&gt; After the render phase, React enters the commit phase, where it applies the calculated changes to the DOM. Known as the "flush phase," this phase cannot be interrupted as it involves making actual changes to the DOM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cleanup Phase:&lt;/strong&gt; Following the commit phase, React performs necessary cleanup, such as unmounting unneeded components and running side effects like &lt;code&gt;componentDidUpdate&lt;/code&gt; or &lt;code&gt;componentWillUnmount&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Understanding Fiber in Action
&lt;/h3&gt;

&lt;p&gt;Consider an application with two components: Parent and Child. The Parent component includes a button that updates its state and triggers a re-render of both the Parent and Child components when clicked.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F25hl1z59pnxvgueppgrj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F25hl1z59pnxvgueppgrj.png" alt="Image description" width="800" height="710"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With React Fiber, when the button is clicked and the state is updated, React creates a work-in-progress tree based on the new state. It then calculates the necessary DOM updates and schedules them. Fiber's incremental rendering and prioritization mechanisms ensure that updates are processed efficiently without blocking the main thread.&lt;/p&gt;

&lt;p&gt;React Fiber’s advanced capabilities significantly enhance performance and responsiveness, making it a powerful tool for developers building complex, dynamic applications.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>reactfiber</category>
    </item>
    <item>
      <title>Proxy Pattern</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Tue, 30 Jul 2024 14:13:18 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/proxy-pattern-2f47</link>
      <guid>https://dev.to/tanoy_basak/proxy-pattern-2f47</guid>
      <description>&lt;p&gt;Proxy is a structural design pattern that lets you provide a substitute or placeholder for another object. A proxy controls access to the original object, allowing you to perform something either before or after the request gets through to the original object.&lt;/p&gt;

&lt;p&gt;Let’s create a person object, that represents John Doe.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fscmua5ywbz8ioxs5r67g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fscmua5ywbz8ioxs5r67g.png" alt="Image description" width="800" height="759"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now lets analyze an interview question : &lt;/p&gt;

&lt;p&gt;𝗛𝗼𝘄 𝗰𝗮𝗻 𝗶 𝘀𝘁𝗼𝗽 𝘀𝗼𝗺𝗲𝗼𝗻𝗲 𝘁𝗼 𝗰𝗵𝗮𝗻𝗴𝗲 𝘁𝗵𝗲 𝗶𝗱 𝗶𝗻 𝘁𝗵𝗲 𝘂𝘀𝗲𝗿 𝗼𝗯𝗷𝗲𝗰𝘁 ?&lt;/p&gt;

&lt;p&gt;To freeze the id property in a JavaScript object using a Proxy, you can define a Proxy handler that prevents the id property from being modified. Here's how you can do it :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkgonekael2imd9pexkn5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkgonekael2imd9pexkn5.png" alt="Image description" width="800" height="1127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep Exploring JS ❤&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>jspatterns</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Composability</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Mon, 29 Jul 2024 05:30:50 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/composability-4n5b</link>
      <guid>https://dev.to/tanoy_basak/composability-4n5b</guid>
      <description>&lt;p&gt;Composability in JavaScript refers to the ability to combine smaller, reusable functions, components, or modules to build more complex and larger functionalities. It allows developers to write cleaner, more maintainable, and modular code.&lt;/p&gt;

&lt;p&gt;In functional programming emphasizes composing functions to create more complex behaviors. &lt;/p&gt;

&lt;p&gt;Key concepts include:&lt;/p&gt;

&lt;p&gt;Higher-order functions: Functions that take other functions as arguments or return them.&lt;/p&gt;

&lt;p&gt;Pure functions: Functions that have no side effects and return the same output given the same input.&lt;/p&gt;

&lt;p&gt;Function composition: Combining two or more functions to produce a new function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtqj4doygmx8gum3jwxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtqj4doygmx8gum3jwxx.png" alt="Image description" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Working of CDN</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Sun, 28 Jul 2024 12:40:54 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/working-of-cdn-145d</link>
      <guid>https://dev.to/tanoy_basak/working-of-cdn-145d</guid>
      <description>&lt;p&gt;A CDN is a geographically distributed network of servers that work together to deliver content to end users with high availability and performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4nnjqfuj2aessqlkwet.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4nnjqfuj2aessqlkwet.jpg" alt="Image description" width="800" height="876"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CDNs reduce latency by caching content closer to the end users.&lt;/p&gt;

&lt;p&gt;When a user requests content from a website or application that utilizes a CDN, the request is redirected to the nearest CDN server instead of the origin server.&lt;/p&gt;

&lt;p&gt;If the requested content is already cached on the CDN server, it is served directly from the cache, eliminating the need to retrieve it from the origin server. This reduces the distance the data has to travel and minimizes the response time.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Enhancing User Experience with Web Vitals in Create React App</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Sun, 28 Jul 2024 04:05:41 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/enhancing-user-experience-with-web-vitals-in-create-react-app-2ep0</link>
      <guid>https://dev.to/tanoy_basak/enhancing-user-experience-with-web-vitals-in-create-react-app-2ep0</guid>
      <description>&lt;p&gt;Ensuring top-notch user experience is paramount. One powerful tool that comes bundled with Create React App is the &lt;strong&gt;web-vitals&lt;/strong&gt; library. This third-party library captures and measures user experience metrics to help you deliver smooth, responsive, and user-friendly web applications.&lt;/p&gt;

&lt;p&gt;🔍&lt;strong&gt;What Are Web Vitals?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web Vitals are crucial metrics for evaluating the quality of the user experience on the web. They are divided into two categories:&lt;/p&gt;

&lt;h3&gt;
  
  
  🔍 &lt;strong&gt;Core Web Vitals&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cumulative Layout Shift (CLS):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📏 &lt;strong&gt;Definition:&lt;/strong&gt; Measures the visual stability of a web page by tracking unexpected layout shifts.&lt;/li&gt;
&lt;li&gt;🌟 &lt;strong&gt;Importance:&lt;/strong&gt; Ensures elements don't move unexpectedly, providing a stable layout as the content loads.&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Recommended Score:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;✅ Good: ≤ 0.1&lt;/li&gt;
&lt;li&gt;⚠️ Needs Improvement: &amp;gt; 0.1 and ≤ 0.25&lt;/li&gt;
&lt;li&gt;❌ Poor: &amp;gt; 0.25&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;First Input Delay (FID):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🕒 &lt;strong&gt;Definition:&lt;/strong&gt; Measures the time from a user's first interaction to when the browser can begin processing that interaction.&lt;/li&gt;
&lt;li&gt;🌟 &lt;strong&gt;Importance:&lt;/strong&gt; Reflects the page's responsiveness and interactivity, crucial for user experience.&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Recommended Score:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;✅ Good: ≤ 100 ms&lt;/li&gt;
&lt;li&gt;⚠️ Needs Improvement: &amp;gt; 100 ms and ≤ 300 ms&lt;/li&gt;
&lt;li&gt;❌ Poor: &amp;gt; 300 ms&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Largest Contentful Paint (LCP):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🖼️ &lt;strong&gt;Definition:&lt;/strong&gt; Measures the loading performance by tracking the render time of the largest visible content element.&lt;/li&gt;
&lt;li&gt;🌟 &lt;strong&gt;Importance:&lt;/strong&gt; Ensures users can quickly see and interact with the main content.&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Recommended Score:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;✅ Good: ≤ 2.5 seconds&lt;/li&gt;
&lt;li&gt;⚠️ Needs Improvement: &amp;gt; 2.5 seconds and ≤ 4.0 seconds&lt;/li&gt;
&lt;li&gt;❌ Poor: &amp;gt; 4.0 seconds&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  🔍 &lt;strong&gt;Other Web Vitals&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;First Contentful Paint (FCP):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;📏 &lt;strong&gt;Definition:&lt;/strong&gt; Measures the time for the first piece of DOM content to be rendered.&lt;/li&gt;
&lt;li&gt;🌟 &lt;strong&gt;Importance:&lt;/strong&gt; Provides visual feedback that the page is loading, reducing perceived loading time.&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Recommended Score:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;✅ Good: ≤ 1.8 seconds&lt;/li&gt;
&lt;li&gt;⚠️ Needs Improvement: &amp;gt; 1.8 seconds and ≤ 3.0 seconds&lt;/li&gt;
&lt;li&gt;❌ Poor: &amp;gt; 3.0 seconds&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Time to First Byte (TTFB):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🕒 &lt;strong&gt;Definition:&lt;/strong&gt; Measures the time for the browser to receive the first byte of page content from the server.&lt;/li&gt;
&lt;li&gt;🌟 &lt;strong&gt;Importance:&lt;/strong&gt; Reflects server responsiveness and efficiency, impacting initial load time.&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Recommended Score:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;✅ Good: ≤ 800 ms&lt;/li&gt;
&lt;li&gt;⚠️ Needs Improvement: &amp;gt; 800 ms and ≤ 1.5 seconds&lt;/li&gt;
&lt;li&gt;❌ Poor: &amp;gt; 1.5 seconds&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lastly, don't neglect performance! 🚀💻&lt;/p&gt;




&lt;h1&gt;
  
  
  WebDevelopment #JavaScript #CreateReactApp #WebVitals #UserExperience #FrontendDevelopment
&lt;/h1&gt;




&lt;p&gt;Feel free to adjust further as needed!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building Design Systems</title>
      <dc:creator>Tanoy Basak</dc:creator>
      <pubDate>Thu, 25 Jul 2024 06:16:22 +0000</pubDate>
      <link>https://dev.to/tanoy_basak/building-design-systems-n2i</link>
      <guid>https://dev.to/tanoy_basak/building-design-systems-n2i</guid>
      <description>&lt;p&gt;&lt;strong&gt;Building Design Systems&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The design system is a collection of patterns and guidelines that are used to design and develop a digital product and that allows designers and developers to deliver consistent experiences, regardless of the device or technology used.&lt;br&gt;
It is adopted by many companies as a design tool around which a product is built in its various components, sharing the language, the objectives and the procedures, ultimately creating its own identity for the product that is consistent with all the company’s communication channels.&lt;br&gt;
Building design systems using Atomic Design pattern&lt;/p&gt;

&lt;p&gt;Atomic design provides a clear methodology for crafting design systems. It is a mental model, and not a linear process, based on ‘’ do one thing and do it well ‘’, a scalable methodology, oriented towards problem solving and which favors usability.&lt;br&gt;
Atomic design gives us the ability to traverse from abstract to concrete. Because of this, we can create systems that promote consistency and scalability while simultaneously showing things in their final context. And by assembling rather than deconstructing, we’re crafting a system right out of the gate instead of cherry-picking patterns after the fact.&lt;/p&gt;

&lt;p&gt;Here’s a brief overview of the different levels in atomic design:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Atoms: These are the basic building blocks of the design system. Atoms include fundamental HTML elements such as buttons, inputs, labels, and more. They represent the smallest, indivisible parts of the user interface.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Molecules: Molecules are groups of atoms bonded together and act as a unit. For example, a form label, input, and button can combine to create a search form molecule. Molecules start to take on their own distinct properties and serve a particular function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Organisms: Organisms are relatively complex components composed of groups of molecules and/or atoms. They form distinct sections of an interface, such as a navigation bar, a footer, or a card component. Organisms can consist of similar or different types of molecules.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Templates: Templates are page-level objects that place components into a layout and articulate the design’s underlying content structure. They are essentially a skeleton of the final page, containing placeholders for the actual content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pages: Pages are specific instances of templates that include real content. They provide a snapshot of the final user interface, showing how all the components come together to form a complete, working design.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Creating Ui components using Lit web components&lt;/p&gt;

&lt;p&gt;Lit is a simple library for building fast, lightweight web components that work in any framework, or with no framework at all. With Lit you can build shareable components, applications, design systems, and more.&lt;br&gt;
Lit provides APIs to simplify common Web Components tasks like managing properties, attributes, and rendering.&lt;/p&gt;

&lt;p&gt;Why Lit?&lt;br&gt;
Here are some key reasons to use Lit for building design systems:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Web Standards Compliance: Lit builds on Web Components, ensuring compatibility with modern browsers and frameworks. Lit components are based on standard Web Components, they can be used alongside any JavaScript framework or library, such as React, Angular, or Vue. This interoperability allows developers to integrate Lit components into existing projects seamlessly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Lightweight and Performant: Lit's emphasis on minimalism, efficient rendering strategies, and leveraging native browser features makes it well-suited for building high-performance web applications and design systems. These characteristics contribute to faster initial load times, smoother interactions, and a better user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reactive Properties: Lit simplifies state management by offering a reactive programming model that automatically updates the user interface (UI) in response to changes in component properties.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scoped Styles: Lit leverages Shadow DOM to provide scoped styles within components, thereby preventing global CSS conflicts. This approach enhances maintainability, encourages component-based design practices, and ensures a consistent user interface across complex web applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>designsystem</category>
      <category>ui</category>
      <category>webcomponents</category>
    </item>
  </channel>
</rss>
