<?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: Nour Wael</title>
    <description>The latest articles on DEV Community by Nour Wael (@nourwaell).</description>
    <link>https://dev.to/nourwaell</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%2F898590%2Fb50fc1b6-569e-4346-83a7-db24a021e07d.jpg</url>
      <title>DEV Community: Nour Wael</title>
      <link>https://dev.to/nourwaell</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nourwaell"/>
    <language>en</language>
    <item>
      <title>Images Optimization: decoding attribute</title>
      <dc:creator>Nour Wael</dc:creator>
      <pubDate>Thu, 11 Apr 2024 12:45:17 +0000</pubDate>
      <link>https://dev.to/nourwaell/images-optimization-decoding-attribute-5362</link>
      <guid>https://dev.to/nourwaell/images-optimization-decoding-attribute-5362</guid>
      <description>&lt;p&gt;When you are programmatically optimizing images on your website, the decoding attribute can be a helpful tool, depending on your use case, in addition to other optimization techniques.&lt;/p&gt;

&lt;p&gt;Simply, you add this attribute to the image and it can have 3 values:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;decoding="sync" :&lt;br&gt;
When the website loads, the main thread loads everything in order. When it encounters the image, it waits for the image to load and decode before continuing. This can be useful if images are essential to your use case, and it is better to wait for them to load. However, this will result in a longer loading time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;decoding="async" :&lt;br&gt;
In this case, the main thread loads the image, but then continues to load the rest of the page and displays it. The image is displayed later, when it has loaded. This is suitable if images are not essential and will make the page load faster. However, it can cause layout shifting, which can affect your CLS performance metric. Therefore, if you know the dimensions of the image, it is a good idea to leave a blank space or skeleton for the image until it loads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;decoding="auto" :&lt;br&gt;
Here, the browser is left to choose one of the other two options. This varies from browser to browser and is the default option if you do not specify it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>html</category>
      <category>performance</category>
    </item>
    <item>
      <title>Next.js Intercepting Routes 101</title>
      <dc:creator>Nour Wael</dc:creator>
      <pubDate>Wed, 10 Apr 2024 18:31:57 +0000</pubDate>
      <link>https://dev.to/nourwaell/nextjs-intercepting-routes-101-32ld</link>
      <guid>https://dev.to/nourwaell/nextjs-intercepting-routes-101-32ld</guid>
      <description>&lt;p&gt;Recently, I was working on a side project where I encountered a problem that piqued my interest.&lt;/p&gt;

&lt;p&gt;I wanted to create a modal with the same content as the authentication page without opening the page itself and displaying it inside the home page when I clicked on the sign-in button.&lt;/p&gt;

&lt;p&gt;This is where I came across Intercepting Routes in Next.js 14.&lt;/p&gt;

&lt;p&gt;In short, it does what I wanted it to do. It helps you display specific content that is normally under a different route, and when you refresh, it takes you to the route of the displayed content and loads its page.&lt;/p&gt;

&lt;p&gt;The syntax may seem a bit strange, but it is as follows (the example I will explain is in the images):&lt;/p&gt;

&lt;p&gt;Create a folder prefixed with @, which we call a slot. Like dynamic routes, the slot does not appear in the params.&lt;/p&gt;

&lt;p&gt;Here, to display the content of the page under the sign-in route, I create a folder prefixed with (.) and named the route with the same name as the targeted route. Under the folder, you create your UI as usual and call the same functionality to perform the same task.&lt;/p&gt;

&lt;p&gt;Finally, you create a default file to act as a fallback if the route does not exist or if an error occurs.&lt;br&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%2F2wdiez8l37ym8d9oo9it.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%2F2wdiez8l37ym8d9oo9it.png" alt="Image description" width="189" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>javascript</category>
      <category>react</category>
    </item>
  </channel>
</rss>
