<?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>Forem: Shahrukh Khan</title>
    <description>The latest articles on Forem by Shahrukh Khan (@sktanwar2014).</description>
    <link>https://forem.com/sktanwar2014</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%2F479136%2Fd7b846f0-f51c-4a69-9a18-aa8d2e6c2919.jpeg</url>
      <title>Forem: Shahrukh Khan</title>
      <link>https://forem.com/sktanwar2014</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/sktanwar2014"/>
    <language>en</language>
    <item>
      <title>Next.js or Vite.js: Which Framework is Better, and When?</title>
      <dc:creator>Shahrukh Khan</dc:creator>
      <pubDate>Mon, 11 Dec 2023 13:46:15 +0000</pubDate>
      <link>https://forem.com/sktanwar2014/nextjs-or-vitejs-which-framework-is-better-and-when-2dmi</link>
      <guid>https://forem.com/sktanwar2014/nextjs-or-vitejs-which-framework-is-better-and-when-2dmi</guid>
      <description>&lt;p&gt;Two names that have been making waves with their distinct approaches to building web apps are Next.js and Vite.js.&lt;/p&gt;

&lt;p&gt;Next.js is a React framework specialized in server-side rendering (SSR), static site generation (SSG), and hybrid applications. It provides features like file-based routing, image optimization, and is particularly suited for projects where SEO and fast initial load times are priorities.&lt;/p&gt;

&lt;p&gt;Vite.js, in contrast, is a build tool that supports various frameworks including React, Vue, and Svelte. It focuses on client-side rendering, offering fast development setup and hot module replacement. Vite.js is ideal for projects where rapid development and reduced server load are key considerations.&lt;/p&gt;

&lt;p&gt;As we dissect these frameworks, we’ll compare their strengths, weaknesses, and the unique flavor they bring to web development - and how choosing between them can profoundly influence the outcome of your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What makes Next.js remarkable?
&lt;/h2&gt;

&lt;p&gt;Next.js offers many features that enhance the development experience and the performance of web apps, such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;File-system-based Routing:&lt;/strong&gt; Next.js automatically creates routes based on the files in the pages directory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Image Optimization:&lt;/strong&gt; Next.js provides an image component that automatically optimizes images for faster loading. It supports features like lazy loading, resizing, cropping, and quality adjustment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Internationalization:&lt;/strong&gt; Next.js supports built-in internationalization and localization features that allow you to create multilingual web apps with ease.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Routes and Endpoints:&lt;/strong&gt; Next.js allows you to create API endpoints in the pages/api directory. These endpoints can be used to handle requests from your web app or external sources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Incremental Static Regeneration:&lt;/strong&gt; Next.js supports incremental static regeneration (ISR), which allows you to update static pages without rebuilding the entire webpage. It enables the best of both worlds: static site generation and server-side rendering.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What makes Vite.js remarkable?
&lt;/h2&gt;

&lt;p&gt;Vite.js is a build tool that provides a fast and lean development experience for web apps. Vite.js uses the native ES modules to serve files without bundling them during development; this in turn results in faster startup and reload times compared to traditional bundlers like Rollup and Webpack. Vite.js offers many features that improve the overall performance and development experience of web apps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hot Module Replacement:&lt;/strong&gt; Vite supports hot module replacement (HMR), which allows you to see the changes in your code in real time without refreshing the pages. Vite’s HMR is faster than other bundlers because it only updates the modules that are changed, not the entire webpage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code Splitting:&lt;/strong&gt; Vite supports code splitting, which allows you to split your code into smaller parts that can be loaded on-demand. This improves performance by reducing the initial load time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Plugin Support:&lt;/strong&gt; Vite has a plugin system that allows you to extend its functionality and integrate it with other tools like TypeScript, React, Vue, Svelte, CSS preprocessors, GraphQL, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Production Bundler:&lt;/strong&gt; Vite uses Rollup as its production bundler, which optimizes the code for performance and compatibility.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next.js vs. Vite.js Performance Comparison
&lt;/h2&gt;

&lt;h2&gt;
  
  
  1. Server-side rendering vs. client-side rendering
&lt;/h2&gt;

&lt;p&gt;Next.js by default supports server-side rendering (SSR), which means that it renders the HTML content on the server before sending it to the browser. This improves the initial loading time and the SEO of your web application. However, SSR increases the load on the server, leading to latency. Next.js uses a special function called getServerSideProps() to fetch data on the server side.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export async function getServerSideProps(context) {
  const res = await fetch('https://example.com');
  const data = await res.json();

  if (!data) {
    return {
      notFound: true,
    };
  }

  return {
    props: { data }, // this will be passed to the page component as a prop
  };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the other hand, Vite.js by default focuses on client-side rendering (CSR), which means that it renders the HTML content on the browser after receiving it from the server. This reduces the server load and complexity but increases the initial load time. Vite uses the native ES Modules import syntax, which runs directly in the browser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createApp } from 'vue';
import App from './App.vue';

createApp(App).mount('#app');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Dynamic importing in Vite.js
&lt;/h2&gt;

&lt;p&gt;Vite supports dynamic imports out of the box, which allows you to load modules on demand. This can significantly improve the performance of your web app by reducing the initial bundle size and loading time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import a module on demand
import('./myModule.js')
  .then((module) =&amp;gt; {
    // Use the module...
  })
  .catch((err) =&amp;gt; {
    // Handle the error...
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3. Static site Generation(SSG) in Next.js
&lt;/h2&gt;

&lt;p&gt;Next.js also supports static site generation (SSG), which allows for pre-rendering of pages at build time, resulting in fast loading times and improved SEO. However, SSG limits dynamic content since the pages are generated at build time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export async function getStaticProps() {
  const res = await fetch('https://example.com');
  const data = await res.json();

  return {
    props: { data },
  };
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Development Speed
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Next.js:&lt;/strong&gt; While it offers a great developer experience, it is primarily focused on the back end and may not match Vite's development speed for front-end projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vite.js:&lt;/strong&gt; Known for its fast development setup and HMR, Vite significantly speeds up front-end development.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Choose
&lt;/h2&gt;

&lt;p&gt;To sum up, Next.js and Vite.js are both strong web app development frameworks. Next.js is an excellent option for projects where SEO is a top concern or when it's imperative to present the user with a meaningful page as soon as possible due to its server-side rendering and static site generation features. It's also a fantastic fit for websites with often updated material or projects with dynamic content that adjusts based on user activities.&lt;/p&gt;

&lt;p&gt;On the other hand, Vite.js is a great option for projects where you want to maintain a modest server load and a quick development workflow because of its emphasis on client-side rendering and dynamic imports. Use Vite.js for Single-page applications (SPAs) and projects where a large portion of the website's content is static.&lt;/p&gt;

&lt;p&gt;The decision between Next.js and Vite.js will ultimately come down to the particular requirements and limitations of your project.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>All Online Tools in “One Box”</title>
      <dc:creator>Shahrukh Khan</dc:creator>
      <pubDate>Sun, 12 Jun 2022 04:43:29 +0000</pubDate>
      <link>https://forem.com/sktanwar2014/all-online-tools-in-one-box-16m4</link>
      <guid>https://forem.com/sktanwar2014/all-online-tools-in-one-box-16m4</guid>
      <description>&lt;h2&gt;
  
  
  What?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://10015.io/"&gt;10015.io&lt;/a&gt; is an online tool factory where you can get all tools you needed in one place. While serving different type of tools in different categories, it aims to perform this with a clean and beautiful user interface. Every tool is designed to solve a problem with minimum number of steps to save time of the users and decrease the complexity of the operation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://10015.io/"&gt;10015.io&lt;/a&gt; has started to operate in 2020 and it will continue to grow with time by adding new tools each day.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Tool Categories&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://10015.io/tools/case-converter"&gt;Text Tools&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2WfXTCWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5px7h9kldnivnubpq2gv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2WfXTCWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5px7h9kldnivnubpq2gv.jpg" alt="Image description" width="880" height="777"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://10015.io/tools/image-cropper"&gt;Image Tools&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zr0-LNXi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxeoqmww7eriawwa63i0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zr0-LNXi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxeoqmww7eriawwa63i0.jpg" alt="Image description" width="880" height="521"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SB_VNmg_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdjq2trpp7f5ac0z0wc2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SB_VNmg_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdjq2trpp7f5ac0z0wc2.jpg" alt="Image description" width="880" height="535"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://10015.io/tools/css-clip-path-generator"&gt;CSS Tools&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rIny9rX---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmudhm8y2bjooc80jh72.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rIny9rX---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmudhm8y2bjooc80jh72.jpg" alt="Image description" width="880" height="796"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://10015.io/tools/code-to-image-converter"&gt;Coding Tools&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kpNPWm62--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ef7fr83l5je83b56t98t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kpNPWm62--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ef7fr83l5je83b56t98t.jpg" alt="Image description" width="880" height="553"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qb4wPshw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/scoyspxr2y97x157r584.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qb4wPshw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/scoyspxr2y97x157r584.jpg" alt="Image description" width="880" height="559"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IEr255vY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5hdbt5ykcltvr6ncwao.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IEr255vY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5hdbt5ykcltvr6ncwao.jpg" alt="Image description" width="880" height="532"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NacWmw_g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/edgwi40ktnn76gx0bqnf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NacWmw_g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/edgwi40ktnn76gx0bqnf.jpg" alt="Image description" width="880" height="300"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://10015.io/tools/hex-to-rgba-converter"&gt;Color Tools&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m3uf7zMb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/871lib75r8serk1o6ubz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m3uf7zMb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/871lib75r8serk1o6ubz.jpg" alt="Image description" width="880" height="544"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://10015.io/tools/instagram-filters"&gt;Social Media Tools &lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p4Kv2PKl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ee5fvp48fr6i11vg2pt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p4Kv2PKl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1ee5fvp48fr6i11vg2pt.jpg" alt="Image description" width="880" height="805"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://10015.io/tools/strong-random-password-generator"&gt;Miscellaneous Tools&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hy5T_TvI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3uiif4brfia6xan87s6p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hy5T_TvI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3uiif4brfia6xan87s6p.jpg" alt="Image description" width="880" height="573"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Get the extension and access all tools with just one click&lt;br&gt;
&lt;a href="https://chrome.google.com/webstore/detail/online-tools-by-10015io/afbphoagjpegnkpeiliacmiiggojdabo"&gt;Add to Chrome&lt;/a&gt;&lt;br&gt;
&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/online-tools-by-10015-io/"&gt;Add to Firefox&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why?
&lt;/h2&gt;

&lt;p&gt;There are lots of sites on web which offers you online tools. Most of them focus on specific topics and they mostly have outdated designs which makes you think "Am I in 90's?". When you start to bookmark the tools you needed, the list becomes larger and larger in some point.&lt;/p&gt;

&lt;p&gt;10015 Tools solves all these problems. So, bookmark it and forget about all other tool sites.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://10015.io/"&gt;10015.io&lt;/a&gt; is designed and coded by Fatih Telis (me) as a side project. I am a frontend developer based in Istanbul, Turkey. I started this project to build a platform which will work as an all-in-one toolbox while I'm challenging myself to create tools which does many different things. Even though I'm not a professional designer, I'm doing my best to construct a simple, aesthetic and easy-to-use UI system. You can contact me via email or Twitter about anything.&lt;/p&gt;

&lt;h1&gt;
  
  
  webdesigner #designer #javascript #tools #css #utils #convertor #html #webdeveloper #all
&lt;/h1&gt;

</description>
    </item>
    <item>
      <title>What's New In Microsoft Edge Devtools?</title>
      <dc:creator>Shahrukh Khan</dc:creator>
      <pubDate>Wed, 26 Jan 2022 05:53:43 +0000</pubDate>
      <link>https://forem.com/sktanwar2014/whats-new-in-microsoft-edge-devtools-2g2e</link>
      <guid>https://forem.com/sktanwar2014/whats-new-in-microsoft-edge-devtools-2g2e</guid>
      <description>&lt;p&gt;As you all guys seen, my last post was about new updates in chrome's devtools. Here i'm going to writing about the new updates in Edge Devtools.&lt;/p&gt;

&lt;p&gt;While Microsoft’s browser team continues to be an active contributor to the Chromium project, they’re also spending more time on new and unique features that only Edge has. Let’s review two of them here.&lt;/p&gt;

&lt;h2&gt;
  
  
  DEBUG DOM MEMORY LEAKS WITH THE DETACHED ELEMENTS PANEL
&lt;/h2&gt;

&lt;p&gt;Edge just launched a memory leak investigation tool, the Detached Elements tools, which can be very useful to investigate leaks in long-running apps.&lt;/p&gt;

&lt;p&gt;One of the multiple reasons why web pages leak memory is detached DOM elements: elements that might have been needed at some point, but got removed from the DOM, and never re-attached. When a code base grows in complexity, it’s easier to make mistakes and forget to clean those detached elements up.&lt;/p&gt;

&lt;p&gt;If you find that your app keeps on needing more and more memory over time as you use it, give the Detached Elements a try. It can very quickly point you in the right direction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dZb-tfUs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4angaftpwx1jngynaoo4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dZb-tfUs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4angaftpwx1jngynaoo4.png" alt="Image description" width="740" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Learn more about it on the &lt;a href="https://blogs.windows.com/msedgedev/2021/12/09/debug-memory-leaks-detached-elements-tool-devtools/"&gt;announcement blog post&lt;/a&gt;, and the &lt;a href="https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/memory-problems/dom-leaks"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  A BRAND NEW USER INTERFACE FOR DEVTOOLS WITH FOCUS MODE
&lt;/h2&gt;

&lt;p&gt;Our DevTools have looked the way they do ever since the early Firebug days. Sure, the user interface has evolved over time a little bit, with more tools added, and things re-arranged, but at a high level, it’s still mostly the same.&lt;/p&gt;

&lt;p&gt;The Edge team has conducted experiments and user studies that indicate that DevTools can be very overwhelming (did I say DevTools had more than 30 panels already?). While new web developers don’t have a clear idea of where to start and how to explore and use the tools, more experienced developers tend to find themselves in just one or two familiar workflows.&lt;/p&gt;

&lt;p&gt;Based on this, the Edge team released a new experimental feature that makes it easier to learn and use DevTools: &lt;code&gt;Focus Mode&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KV509VOn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h384sa0v9jllkyi35ioj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KV509VOn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h384sa0v9jllkyi35ioj.png" alt="Image description" width="638" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Focus Mode&lt;/code&gt; has a new activity bar, an easy way to add and remove tools, a quick view drawer, and re-designed menus.&lt;/p&gt;

&lt;p&gt;To give &lt;code&gt;Focus Mode&lt;/code&gt; a try, enable it first by going to &lt;code&gt;Settings &amp;gt; Experiments &amp;gt; Focus Mode&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You can learn more about &lt;code&gt;Focus Mode&lt;/code&gt; in this &lt;a href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DevTools/FocusMode/explainer.md"&gt;Edge explainer document&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I hope you enjoyed these updates, and that they’ll turn out useful when doing web development.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>programmer</category>
      <category>webdev</category>
      <category>css</category>
      <category>devops</category>
    </item>
    <item>
      <title>What’s New In Chrome's DevTools?</title>
      <dc:creator>Shahrukh Khan</dc:creator>
      <pubDate>Wed, 26 Jan 2022 05:36:17 +0000</pubDate>
      <link>https://forem.com/sktanwar2014/whats-new-in-chromes-devtools-4pg</link>
      <guid>https://forem.com/sktanwar2014/whats-new-in-chromes-devtools-4pg</guid>
      <description>&lt;p&gt;The different teams working on DevTools have been busy to built a lot of new things for us to use. From &lt;strong&gt;powerful productivity&lt;/strong&gt; improvements to entire new panels, they’ve been continuing to close the parity gap and innovate with new means of debugging and improving our web experiences.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Chrome team just released a new panel that makes it very straightforward to record and replay user flows: the Recorder panel.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That means it’s high time for another Chrome's DevTool update, so let’s jump right in!&lt;/p&gt;

&lt;h2&gt;
  
  
  RECORD, REPLAY AND MEASURE USER FLOWS
&lt;/h2&gt;

&lt;p&gt;If you’ve ever found yourself having to repeat the same navigation steps over and over again in a web app in order to investigate a bug, then this might change your life!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8Q_Y0uc0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/be29ydwgfmp447emqs4t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8Q_Y0uc0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/be29ydwgfmp447emqs4t.png" alt="Image description" width="695" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But there’s more! Once the steps are recorded, you can replay them while measuring performance. This way, you can work on optimizing your code, while being sure to always run the same scenario every time you test.&lt;/p&gt;

&lt;p&gt;You can &lt;a href="https://developer.chrome.com/docs/devtools/recorder/"&gt;learn more about the Recorder here&lt;/a&gt;. And if you have feedback about this tool, the team will be very happy to hear your thoughts on this &lt;a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1257499"&gt;chromium issue&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  NAVIGATE THE ACCESSIBILITY TREE
&lt;/h2&gt;

&lt;p&gt;Rendering pages to the screen isn’t the only thing that browsers do. They also use the DOM tree they build in the process to create another tree: the [accessibility tree]&lt;a href="https://developer.mozilla.org/en-US/docs/Glossary/Accessibility_tree"&gt;https://developer.mozilla.org/en-US/docs/Glossary/Accessibility_tree&lt;/a&gt;). The accessibility tree is another representation of the current page that can be used by assistive technologies, like screen readers.&lt;/p&gt;

&lt;p&gt;As a web developer, it is very useful to have access to this accessibility tree. It helps understand how the markup you choose influences the way screen readers interpret the page.&lt;/p&gt;

&lt;p&gt;Chrome DevTools has had an Accessibility panel for some time in the sidebar of the Elements panel which contains the accessibility tree. Recently though, the team has been experimenting with displaying both the accessibility and the DOM tree in the same place, allowing developers to go back and forth between the two.&lt;/p&gt;

&lt;p&gt;To enable this experiment, go to the Accessibility sidebar panel, and check the “Enable full-page accessibility tree”. You will then have a new button displayed in the top-right corner of the DOM tree that lets you switch between the DOM and accessibility trees.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.chrome.com/blog/full-accessibility-tree/"&gt;Find out more here&lt;/a&gt;, and let the team know your &lt;a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1275891"&gt;feedback&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--73WDi5Hw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3ezekvmp9gm3z9iwy22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--73WDi5Hw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3ezekvmp9gm3z9iwy22.png" alt="Image description" width="741" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS OVERVIEW IS NOW ON BY DEFAULT
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://developer.chrome.com/docs/devtools/css-overview/"&gt;CSS overview&lt;/a&gt; panel isn’t new, but with so many panels to choose from, you might have never used it. It has been an experiment for a very long time, which means you needed to go into DevTools settings to enable it before being able to use it.&lt;/p&gt;

&lt;p&gt;This is no longer necessary. The CSS Overview panel is just a regular feature now, and you can open it by going into &lt;code&gt;… &amp;gt; More tools &amp;gt; CSS Overview&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you’ve never used it, give it a try as it is a very useful tool to identify potential CSS improvements like contrast issues or unused CSS declarations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ur4BpkMZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkzocd2iybuov2dtaif0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ur4BpkMZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkzocd2iybuov2dtaif0.png" alt="Image description" width="741" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While you’re in the &lt;code&gt;More tools&lt;/code&gt; menu, take a look around. Chrome DevTools has more than 30 individual panels! That’s a lot, but keep in mind they’re all here for a specific reason. There might be aspects of your web app that certain panels could help you with. Be curious, and if you have no idea what a thing does, remember there are &lt;a href="https://devtoolstips.org/tips/en/find-devtools-documentation/"&gt;docs you can read&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That’s It For Now!&lt;/strong&gt;&lt;br&gt;
I hope you enjoyed these updates, and that they’ll turn out useful when doing web development. As always, if you have feedback, bugs to report, or new feature ideas for DevTools, make yourself heard! It’s impressive to see how far the web platform debugging capabilities have come, and we all can help make it even better!&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>chrom</category>
      <category>webdeveloper</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Load or set environment variables in Node.js without dotenv or any third package.
</title>
      <dc:creator>Shahrukh Khan</dc:creator>
      <pubDate>Tue, 25 Jan 2022 12:56:20 +0000</pubDate>
      <link>https://forem.com/sktanwar2014/load-or-set-environment-variables-in-nodejs-without-dotenv-or-any-third-package-6io</link>
      <guid>https://forem.com/sktanwar2014/load-or-set-environment-variables-in-nodejs-without-dotenv-or-any-third-package-6io</guid>
      <description>&lt;p&gt;Hello guys, If you are also trapped in the use of dotenv variables then this is for you a &lt;a href="https://youtu.be/u1BO25YUeRc"&gt;&lt;strong&gt;complete solution to load/set/manage environment variables&lt;/strong&gt;&lt;/a&gt; in Node.js with the use of javascript &amp;amp; without the burdon of dotenv or any third package.&lt;br&gt;
&lt;strong&gt;You can use it in Dev, Prod, UAT or any other environment without any issue.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: create a server&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;index.js&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const http =require('http');
    const { port, environment } = require('./config').getEnv();

    http.createServer().listen(port, async () =&amp;gt; {
      console.log(`env: ${environment}`);
      console.log(`server is running on ${port} port`);
    }).on('error', (e) =&amp;gt; console.log(e));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: configuration of environement variables&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;config.js&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require('fs');
    const path = require('path');
    const { parseBuffer } = require('./helpers/parse');

    const getEnv = () =&amp;gt; {
      const envFilePath = path.join(__dirname, '.env');
      const bufferEnv = fs.readFileSync(envFilePath);
      const envObject = parseBuffer(bufferEnv);

      Object.keys((envObject || {})).map(key =&amp;gt; {
        if(!process.env[key] &amp;amp;&amp;amp; process.env[key] !== envObject[key]){
          process.env[key] = envObject[key];
        }
      });

      const version = process.env.VERSION;
      const environment = process.env.ENVIRONMENT;
      const port = process.env.PORT;

      return {
        version,
        environment,
        port,
      }
    }

    module.exports = {
      getEnv
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: create .env file &amp;amp; define your variables&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;.env&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VERSION=v1.0.0
ENVIRONMENT=local
PORT=3001
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: A function to parse buffer data into object&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;parse.js&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const NEWLINES_MATCH = /\r\n|\n|\r/
    const NEWLINE = '\n'
    const RE_INI_KEY_VAL = /^\s*([\w.-]+)\s*=\s*(.*)?\s*$/
    const RE_NEWLINES = /\\n/g

    const parseBuffer = (src) =&amp;gt; {
      const obj = {};
      src.toString().split(NEWLINES_MATCH).forEach((line, idx) =&amp;gt; {
        // matching "KEY" and "VAL" in "KEY=VAL"
        const keyValueArr = line.match(RE_INI_KEY_VAL);
        // matched?
        if(keyValueArr != null){
          const key = keyValueArr[1];

          // default undefined or missing values to empty string

          let val = (keyValueArr[2] || '');
          const end = val.length -1;
          const isDoubleQuoted = val[0] === '"' &amp;amp;&amp;amp; val[end] === '"';
          const isSingleQuoted = val[0] === "'" &amp;amp;&amp;amp; val[end] === "'";

          // if single or double quoted, remove quotes 
          if(isSingleQuoted || isDoubleQuoted) {
            val = val.substring(1, end);

            // if double quoted, expand newlines
            if(isDoubleQuoted){
              val = val.replace(RE_NEWLINES, NEWLINE);
            }        
          } else {
            //  remove surrounding whitespace
            val = val.trim();
          }
          obj[key] = val;
        }
      });
      return obj;
    }

    module.exports = {
      parseBuffer
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Try this to overcome the burdon of dotenv &amp;amp; manage everything on yourbehafe.&lt;br&gt;
If you got any issue during implementation of this code &lt;a href="https://www.youtube.com/watch?v=u1BO25YUeRc"&gt;just Click to watch the video of solution&lt;/a&gt; &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>tutorial</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
