<?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: Prince Gupta</title>
    <description>The latest articles on DEV Community by Prince Gupta (@princegupta).</description>
    <link>https://dev.to/princegupta</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%2F1089126%2Fd1038f12-073e-43eb-bc8b-680b1992e5b3.jpg</url>
      <title>DEV Community: Prince Gupta</title>
      <link>https://dev.to/princegupta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/princegupta"/>
    <language>en</language>
    <item>
      <title>How to Make a Progressive Web App</title>
      <dc:creator>Prince Gupta</dc:creator>
      <pubDate>Wed, 13 Mar 2024 14:47:04 +0000</pubDate>
      <link>https://dev.to/princegupta/how-to-make-a-progressive-web-app-179i</link>
      <guid>https://dev.to/princegupta/how-to-make-a-progressive-web-app-179i</guid>
      <description>&lt;p&gt;No matter if you’re a pro developer or just starting, you might have heard about this topic. If not, don’t worry! After reading this blog, you’ll know all you need to make a PWA. Even if you’re just curious, get ready to learn a lot about PWAs. So, let’s start this fun learning journey!&lt;/p&gt;

&lt;p&gt;the quickest definition for the people who are absolute beginners&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fmu9rbfc8xstkocwgyrbi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmu9rbfc8xstkocwgyrbi.png" alt="How to identify if the website is a pwa" width="629" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you must have saw this install option for the web apps on your computers and phones, the websites which have this option available is simply a PWA.&lt;/p&gt;

&lt;p&gt;First, let’s take a quick trip down memory lane. The term “Progressive Web Apps” or PWAs was first used in 2015 by Frances Berriman and Alex Russell from Google. They used it to describe apps that could use new features from modern browsers. This meant that web apps could be upgraded to PWAs on your device, just like regular apps.&lt;/p&gt;




&lt;p&gt;Now, let’s talk about why you’d want to make your web app a PWA. Here are some cool things about PWAs:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feels Like a Regular App:&lt;/strong&gt; PWAs feel just like the apps you’re used to on your device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to Install:&lt;/strong&gt; You can add PWAs to your device’s home screen, just like a regular app. No need to go to an app store, and it saves space.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Fast and Smooth:&lt;/strong&gt; PWAs are known for being quick and working well, better than traditional web apps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Works Everywhere:&lt;/strong&gt; PWAs are made with standard web technologies, so they can work on many different devices from one set of code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Works Offline:&lt;/strong&gt; PWAs can work even when your device is not connected to the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Always Up-to-Date:&lt;/strong&gt; PWAs update in the background, so you always have the latest version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Can Send Notifications:&lt;/strong&gt; Just like regular apps, PWAs can send you notifications to keep you updated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No Need for App Stores:&lt;/strong&gt; You can access PWAs directly from the web, no need to go through an app store.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Safe and Secure:&lt;/strong&gt; PWAs use secure web protocols to keep your data safe.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Saves Time and Money:&lt;/strong&gt; With PWAs, you don’t need to make separate apps for different platforms, which saves time and money.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;




&lt;p&gt;The &lt;em&gt;&lt;strong&gt;only thing is, your users have to click the Install button on their browser to add the PWA to their device.&lt;/strong&gt;&lt;/em&gt; But don’t worry, you can also put your PWA on the Google Play Store, App Store, or Windows Store. So, if your user isn’t tech-savvy, they won’t even know it’s a website.&lt;/p&gt;

&lt;p&gt;You have to learn more to enable it uploadable on the platforms&lt;/p&gt;

&lt;p&gt;Watch this video on &lt;em&gt;&lt;a href="https://www.youtube.com/watch?v=TCgT8dzSiU8" rel="noopener noreferrer"&gt;Trusted Web Activity ( TWA ) by Chrome for Developers&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  How to make your Website / Web App a PWA ??
&lt;/h3&gt;

&lt;p&gt;So, to make the process buttery smooth. I will recommend you to install this extension on VSCode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fnyz485mueopnsb4sfjae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fnyz485mueopnsb4sfjae.png" alt="It is a very good extension ( trust me.. )" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;&lt;code&gt;Manifest.json&lt;/code&gt;&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;make a &lt;code&gt;manifest.json&lt;/code&gt; on the public folder of your app. Please see the image to see the illustration to see how to do it via the extension.&lt;/p&gt;

&lt;p&gt;Open the extension you’ll see this pane on your screen&lt;/p&gt;

&lt;p&gt;![pwa studio builder home page(&lt;a href="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9f5uiipltadpixa8kel.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9f5uiipltadpixa8kel.png&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Now just click on the Generate a Web manifest and it will generate one for you.&lt;/p&gt;

&lt;p&gt;Now save the file into the public folder of your code and edit the fields ( you will get the directions on the file itself )&lt;/p&gt;

&lt;p&gt;for example :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fi9nan0lf5pjuw4z0eese.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fi9nan0lf5pjuw4z0eese.png" alt="example of mainfest.json file" width="800" height="581"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you will go the the browser dev tools and check, you can see this on the your manifest section ( You can go to the Application section by inspecting ).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fwoy4f7o4yawv821oa90e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fwoy4f7o4yawv821oa90e.png" alt="Application Manifest" width="481" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Service Worker
&lt;/h4&gt;

&lt;p&gt;Now It is the time to generate a service worker. You can choose to generate a basic and a advanced one via the extension. ( Save it in the root directory of your app ).&lt;/p&gt;

&lt;p&gt;The basic one looks like this 👇&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;HOSTNAME_WHITELIST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fonts.gstatic.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fonts.googleapis.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cdn.jsdelivr.net&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="c1"&gt;// The Util Function to hack URLs of intercepted requests&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getFixedUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;// 1. fixed http URL&lt;/span&gt;
        &lt;span class="c1"&gt;// Just keep syncing with location.protocol&lt;/span&gt;
        &lt;span class="c1"&gt;// fetch(httpURL) belongs to active mixed content.&lt;/span&gt;
        &lt;span class="c1"&gt;// And fetch(httpRequest) is not supported yet.&lt;/span&gt;
        &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;protocol&lt;/span&gt;

        &lt;span class="c1"&gt;// 2. add query for caching-busting.&lt;/span&gt;
        &lt;span class="c1"&gt;// Github Pages served with Cache-Control: max-age=600&lt;/span&gt;
        &lt;span class="c1"&gt;// max-age on mutable content is error-prone, with SW life of bugs can even extend.&lt;/span&gt;
        &lt;span class="c1"&gt;// Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.&lt;/span&gt;
        &lt;span class="c1"&gt;// Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190&lt;/span&gt;
        &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hostname&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;amp;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;?&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cache-bust=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;now&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cm"&gt;/**
     *  @Lifecycle Activate
     *  New one activated when old isnt being used.
     *
     *  waitUntil(): activating ====&amp;gt; activated
     */&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;activate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;waitUntil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;clients&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;claim&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="cm"&gt;/**
     *  @Functional Fetch
     *  All network requests are being intercepted here.
     *
     *  void respondWith(Promise&amp;lt;Response&amp;gt; r)
     */&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Skip some of cross-origin requests, like those for Google Analytics.&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;HOSTNAME_WHITELIST&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Stale-while-revalidate&lt;/span&gt;
        &lt;span class="c1"&gt;// similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale&lt;/span&gt;
        &lt;span class="c1"&gt;// Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cached&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;caches&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fixedUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getFixedUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetched&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fixedUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;no-store&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchedCopy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fetched&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clone&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

        &lt;span class="c1"&gt;// Call respondWith() with whatever we get first.&lt;/span&gt;
        &lt;span class="c1"&gt;// If the fetch fails (e.g disconnected), wait for the cache.&lt;/span&gt;
        &lt;span class="c1"&gt;// If there’s nothing in cache, wait for the fetch.&lt;/span&gt;
        &lt;span class="c1"&gt;// If neither yields a response, return offline pages.&lt;/span&gt;
        &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;respondWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;race&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;fetched&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;cached&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;fetched&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* eat any errors */&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;// Update the cache with the version we fetched (only for ok status)&lt;/span&gt;
        &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;waitUntil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;fetchedCopy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;caches&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pwa-cache&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)])&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(([&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* eat any errors */&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;What this code is doing ??&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;HOSTNAME_WHITELIST: This is a list of hostnames that the service worker should manage. If a network request is made to a hostname not in this list, the service worker will not intercept the request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;getFixedUrl: This function takes a request as input and returns a URL with the same protocol as the current location and a cache-busting query parameter.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;activate event listener: This code listens for the ‘activate’ event, which is fired when the service worker starts. The self.clients.claim() line makes this service worker take control of all pages in its scope as soon as it’s activated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;fetch event listener: This code listens for the ‘fetch’ event, which is fired every time a network request is made. If the request’s hostname is in the whitelist, the service worker will try to respond with a cached response, fetch a new response from the network, or return an offline page if both fail.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, moving to the advanced one 🏃&lt;/p&gt;

&lt;p&gt;The extension will install a package &lt;em&gt;workbox-precaching&lt;/em&gt; for you&lt;/p&gt;

&lt;p&gt;If you want learn more about the workbox and the things you can achieve with it. consider visiting the chrome’s developer docs on workbox by &lt;strong&gt;&lt;em&gt;&lt;a href="https://developer.chrome.com/docs/workbox/" rel="noopener noreferrer"&gt;clicking here&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Code of the file 👇&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;precacheAndRoute&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;workbox-precaching/precacheAndRoute&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;precacheAndRoute&lt;/span&gt;&lt;span class="p"&gt;([]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here’s what the code does:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';&lt;/code&gt;: This line imports the precacheAndRoute function from the workbox-precaching module.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;precacheAndRoute([]);&lt;/code&gt;: This function call sets up a service worker to precache resources. The array passed to precacheAndRoute would normally contain a list of URLs to precache, but it’s empty in this case.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;code&gt;precacheAndRoute&lt;/code&gt; function does two things:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Precaching: It ensures that files are downloaded and cached during the service worker’s install event. &lt;a href="https://developer.chrome.com/docs/workbox/precaching-with-workbox/" rel="noopener noreferrer"&gt;This means the files are available offline and can be served fast.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Routing: It sets up an implicit cache-first route for the precached assets. &lt;a href="https://developer.chrome.com/docs/workbox/precaching-with-workbox/" rel="noopener noreferrer"&gt;This means that whenever a request is made for a precached asset, the response will be served from the cache, without going to the network.&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt; : Whether you use the basic one or the advanced one you can tailor the code easily based on your needs. and you can do so much things with the service worker.**&lt;/p&gt;

&lt;p&gt;Now to check if the service-worker is running properly, go the application section of the dev tools click of the service worker, you’ll see something like this 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fptv5x9x6fmheztg0hgse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fptv5x9x6fmheztg0hgse.png" alt="I have used a random website for showing this" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;for testing it you can click on the offline tab on top to see whether the service workers are working or not.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqr46knrkie7ghup71gx1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqr46knrkie7ghup71gx1.png" alt="we made the website offline by revoking the internet access" width="761" height="160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So let’s see what guys are doing via service worker on this website&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;website when we are online&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.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%2F7e6t92cmj0ua8pznavq2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F7e6t92cmj0ua8pznavq2.png" alt="website when we are online" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;website when we are offline&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fvne9c5jtsk8axoml1j07.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fvne9c5jtsk8axoml1j07.png" alt="website when we are offline" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Here’s a quick reminder for you guys. Really sorry for interrupting the experience. if you are enjoying blog please consider clicking on the like button. ( pleaseeeee :) )&lt;/p&gt;



&lt;p&gt;Things OYO made better by making their website a PWA and Pushing it as OYO Lite as a TWA ( Now you have to learn more don’t worry it is more like a branch of PWA ).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TWA (Trusted Web Activity ):&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;TWAs are a way to open your PWA or web content in a full-screen mode from an Android app, without any browser UI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TWAs make it possible to distribute your PWA via the Google Play Store.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A TWA is essentially a Chrome browser window without its own graphic interface (like the URL bar and menu), operating in a trusted mode.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;TWAs are specific to Android devices.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;



&lt;p&gt;In summary, while PWAs and TWAs share some similarities, they are used for different purposes. A PWA is a web app that provides an app-like experience, while a TWA is a way to deliver your PWA or web content in a full-screen mode within an Android app.&lt;/p&gt;

&lt;p&gt;So back to &lt;strong&gt;How a TWA helped OYO meet the needs of its users :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By strategically storing the majority of their app assets in Chrome’s cache, the OYO team managed to slim down the initial download size of OYO Lite to a mere 850 KB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;That’s a whopping 93% smaller than their Android app!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This compact size, coupled with the convenience of being downloadable from the Google Play Store, resulted in a significant boost in user engagement.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;The conversion rate was triple that of the PWA’s rate, and on average, there were three times more logged-in users than the PWA. Plus, it earned a commendable 4.1 rating on the Google Play Store.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But the benefits weren’t just for the users. Opting for a TWA also meant that the team had to maintain only a single codebase. This allowed them to roll out updates seamlessly, without having to wait for users to download the latest version of the app.&lt;/p&gt;



&lt;p&gt;So let’s end this here, these were the benefits and the steps to make your web app a banger with PWA. You can do more with it. whether it is creating better experience for the users, reminding them to buy the products they added to the cart or anything else. It can turn out to be a plus for your business.&lt;/p&gt;



&lt;p&gt;I hope this blog has sparked your curiosity and equipped you with the knowledge to start your own PWA journey. Remember, the road to mastery is always under construction. Keep learning, keep experimenting, and most importantly, have fun along the way! 😊&lt;/p&gt;



&lt;p&gt;Didn’t liked something or want to give me the feedback on how can I improve, just fill out this form.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://www.typeform.com/explore?utm_source=typeform.com&amp;amp;utm_medium=typeform&amp;amp;utm_content=typeform-incorrectURL&amp;amp;utm_campaign=viral_expt%0A%20%20%20%20" rel="noopener noreferrer"&gt;
      typeform.com
    &lt;/a&gt;
&lt;/div&gt;



</description>
      <category>pwa</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>javascript</category>
    </item>
    <item>
      <title>10 Must have VS Code Extensions for Developers</title>
      <dc:creator>Prince Gupta</dc:creator>
      <pubDate>Mon, 13 Nov 2023 08:57:38 +0000</pubDate>
      <link>https://dev.to/princegupta/10-must-have-vs-code-extensions-for-developers-3a23</link>
      <guid>https://dev.to/princegupta/10-must-have-vs-code-extensions-for-developers-3a23</guid>
      <description>&lt;p&gt;Hey everyone! I’m here with another Blog Post aimed at making your coding experience more efficient. This time, I’ve gathered tips and tricks that will save you heaps of time while you’re knee-deep in coding projects. Whether you’re a seasoned developer or just starting out, these insights will help streamline your work and boost productivity. So, grab your coding tools and get ready to optimize your workflow with these time-saving hacks!&lt;/p&gt;

&lt;h2&gt;
  
  
  1) Better Comments
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F2fz1rs91kqbnxfl6taxv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F2fz1rs91kqbnxfl6taxv.png" alt="Image description" width="800" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example Image 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ftyzepkdyyyok5ebnprsb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftyzepkdyyyok5ebnprsb.png" alt="Image description" width="459" height="414"&gt;&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  2) Auto Rename Tag
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgqx0gj0wgfc2xr4r463g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgqx0gj0wgfc2xr4r463g.png" alt="Image description" width="800" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See the above given gif to see the working of the Extension. This is help you save some of your anger while you’re trying to change a tag’s name.&lt;/p&gt;



&lt;h2&gt;
  
  
  3) Bookmarks
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F8yjfezy6w8d0kln7ddrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8yjfezy6w8d0kln7ddrn.png" alt="Image description" width="749" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want to Mark a line to work on it later or just want to make changes after some days, use this tool to save your time finding the lines to edit or change.&lt;/p&gt;



&lt;h2&gt;
  
  
  4) Import Cost
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fhlmzvg9f28j4975y6qi4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhlmzvg9f28j4975y6qi4.png" alt="Image description" width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want to know how much space your imported module or package is taking then The “Import Cost” tool is your go-to solution. This feature ensures you’re aware of the space each addition consumes, helping you maintain a leaner, more efficient application. With Import Cost, you gain insight into the impact of your imports, allowing for better optimization and management of your app’s size.&lt;/p&gt;



&lt;h2&gt;
  
  
  5) Indent-Rainbow
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fanvbj4lkdmmsletuua2g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fanvbj4lkdmmsletuua2g.png" alt="Image description" width="525" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Indent-Rainbow is a visual aid tool designed to improve code readability by colorizing indents with different hues. Its usage involves enhancing code structure and easing comprehension by assigning various colors to different indentation levels. As you navigate through the code, each indent level gets a unique color, making it easier to identify block boundaries. This visual distinction streamlines code interpretation, making your programming experience more visually intuitive and less error-prone.&lt;/p&gt;



&lt;h2&gt;
  
  
  6) Prettier
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F21x8ns8ow4ci942vio6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F21x8ns8ow4ci942vio6i.png" alt="Image description" width="794" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fmcvxeczlx1nrydcrgege.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fmcvxeczlx1nrydcrgege.png" alt="Image description" width="594" height="748"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ahh!! I know that y’all know about Prettier but, This blog won’t be completed without it’s mention. Prettier is a popular code formatting tool used to automatically style your code. Its usage involves simplifying the process of formatting by enforcing a consistent style across your codebase. Prettier supports various programming languages and can be integrated into your workflow seamlessly. By analyzing your code and applying a standardized style, it eliminates the need for manual formatting, ensuring a clean, uniform appearance. Prettier streamlines collaboration and enhances readability by handling the formatting nuances, letting you focus on the actual code.&lt;/p&gt;



&lt;h2&gt;
  
  
  7) VSCode — Icons
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fkbmtbaeq3sws0zf6kpok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fkbmtbaeq3sws0zf6kpok.png" alt="Image description" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;VSCode-Icons is an extension that enriches your Visual Studio Code experience by providing a wide array of icons. Its usage involves enhancing visual navigation within your codebase by associating specific file types, directories, and folders with distinct, easily recognizable icons. By adding visual cues, it simplifies the identification of different file formats, making it easier to locate and work with specific files. This extension brings an element of visual appeal and practicality, streamlining your coding process within Visual Studio Code.&lt;/p&gt;



&lt;h2&gt;
  
  
  8) Thunder Client
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F0nr1kelx5zeyijxrse3f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F0nr1kelx5zeyijxrse3f.png" alt="Image description" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thunder Client is a powerful REST API client extension for VS Code, designed to simplify API testing and development directly within your coding environment. Its usage involves enabling quick and easy HTTP requests, allowing you to test APIs without leaving your editor. With features like environment variables, multiple tabs, and a user-friendly interface, Thunder Client streamlines the process of testing, debugging, and working with APIs. This extension optimizes your workflow by providing a seamless environment for API testing and development, enhancing productivity within Visual Studio Code.&lt;/p&gt;



&lt;h2&gt;
  
  
  9) GitHub CoPilot and CoPilot Chat
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fgdwz76vf2jemquy8xo6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fgdwz76vf2jemquy8xo6f.png" alt="Image description" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub CoPilot is an AI-powered code completion tool integrated into various code editors, offering suggestions and autocompletions based on the context of your code. CoPilot Chat is an additional feature in GitHub CoPilot, enabling users to interact with CoPilot via a chat-like interface to discuss code suggestions and provide feedback. These tools enhance coding productivity by generating code snippets, offering suggestions, and providing a conversational interface to collaborate with the AI for more tailored code assistance. Users can engage with CoPilot Chat to refine code suggestions and improve the accuracy and relevance of the generated code snippets.&lt;/p&gt;



&lt;h2&gt;
  
  
  10) Source Control &amp;amp; Search (Not an Extension)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ftnp4w4drdfazvdbo4bop.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ftnp4w4drdfazvdbo4bop.png" alt="Image description" width="626" height="250"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I know they are not extensions but,&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In Visual Studio Code, the “Search” and “Source Control” functionalities play vital roles in enhancing productivity and managing code revisions.&lt;/p&gt;

&lt;p&gt;Search: This feature allows you to quickly find specific content within your project. By using keywords, regular expressions, or even file paths, you can efficiently locate and navigate through your codebase. The search tool provides options for case-sensitive searches, whole-word matches, and allows you to perform global searches across multiple files.&lt;/p&gt;

&lt;p&gt;Source Control: This is where you manage version control systems like Git. It enables you to track changes, review modifications, commit code, create branches, and handle merges, all within the VS Code interface. The source control view provides a clear overview of file changes and allows you to stage, commit, push, and pull changes to and from the repository.&lt;/p&gt;

&lt;p&gt;By utilizing these features, developers can seamlessly navigate, search, and manage code changes in their projects, streamlining their workflow directly within Visual Studio Code.&lt;/p&gt;



&lt;p&gt;In conclusion, these must-have VS Code extensions and integral features empower developers at all levels, enhancing efficiency and productivity. Whether it’s optimizing code readability with Indent-Rainbow, automating formatting through Prettier, or streamlining API testing with Thunder Client, each tool serves as a catalyst for smoother development.&lt;/p&gt;

&lt;p&gt;By leveraging these resources, developers can elevate their coding proficiency, saving time, reducing frustration, and fostering a more streamlined and effective coding environment within Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Happy coding, and may your programming endeavors be as efficient as they are rewarding!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;



&lt;p&gt;If you are still here and Reading this. Consider Following me &amp;amp; Subscribing to Email Notifications to Stay Updated with the crazy Content I will upload.&lt;/p&gt;

&lt;p&gt;For any Discussions, you can add a comment.&lt;/p&gt;

&lt;p&gt;&amp;amp;&amp;amp;&lt;/p&gt;

&lt;p&gt;For more content, you can follow me on Twitter : )&lt;/p&gt;

&lt;p&gt;Want to receive my newsletters! Just Fill this 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dub.sh/ProgrammingNewsletter" rel="noopener noreferrer"&gt;https://dub.sh/ProgrammingNewsletter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Love you &amp;amp; Bye Bye ❤️&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vscode</category>
      <category>extensions</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
