<?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: rosa-rzi</title>
    <description>The latest articles on DEV Community by rosa-rzi (@rosa-rzi).</description>
    <link>https://dev.to/rosa-rzi</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%2F1176339%2Feddb1304-016c-4aec-aeff-a1d6a2b9b8f7.jpeg</url>
      <title>DEV Community: rosa-rzi</title>
      <link>https://dev.to/rosa-rzi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rosa-rzi"/>
    <language>en</language>
    <item>
      <title>How to manage node versions across projects</title>
      <dc:creator>rosa-rzi</dc:creator>
      <pubDate>Wed, 15 Nov 2023 22:59:47 +0000</pubDate>
      <link>https://dev.to/rosa-rzi/how-to-manage-node-versions-across-projects-470k</link>
      <guid>https://dev.to/rosa-rzi/how-to-manage-node-versions-across-projects-470k</guid>
      <description>&lt;p&gt;If you're currently utilizing Docker container projects, there's no need to worry about your existing Node version.  But that’s another different topic from this one that I’ll probably share with you in the future. For now, I'd like to share my story with using nvm across all my Node.js projects on my macOS system.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: If you have a pre-existing Node.js version on your machine, it will remain accessible as the default version. This allows you to continue using and installing nvm.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;1) Get nvm installed in your macOS terminal console&lt;/p&gt;

&lt;p&gt;Option 1:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;brew install nvm&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Option 2:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Option 3:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;wget -q0- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;2) Indicated nodejs version required in my project folder in a git-tracked .nvmrc file:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo v18.14.1 &amp;gt; .nvmrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;install it&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install v18.14.1&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;3) This does not take effect automatically on cd, the user must do it:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nvm use&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Now you can see all the node versions you have installed with&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;nvm list&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;.nvmrc is documented at: &lt;a href="https://github.com/creationix/nvm/tree/02997b0753f66c9790c6016ed022ed2072c22603#nvmrc"&gt;https://github.com/creationix/nvm/tree/02997b0753f66c9790c6016ed022ed2072c22603#nvmrc&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>webdev</category>
      <category>nvm</category>
    </item>
    <item>
      <title>Choosing the Right Rendering Method in Next.js: A Quick Guide</title>
      <dc:creator>rosa-rzi</dc:creator>
      <pubDate>Fri, 27 Oct 2023 05:05:16 +0000</pubDate>
      <link>https://dev.to/rosa-rzi/choosing-the-right-rendering-method-in-nextjs-a-quick-guide-940</link>
      <guid>https://dev.to/rosa-rzi/choosing-the-right-rendering-method-in-nextjs-a-quick-guide-940</guid>
      <description>&lt;p&gt;In my previous post, I talked about the different types of rendering in Next.js (SSR, SSG and CSR), and in this post we'll go over deciding which rendering method to use. &lt;/p&gt;

&lt;p&gt;Your choice will depend on your project's specific requirements and objectives. Let's break down how to make this decision:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Data Dependency
&lt;/h2&gt;

&lt;p&gt;If your page relies on &lt;em&gt;dynamic data&lt;/em&gt; that changes with each request, go for &lt;strong&gt;SSR&lt;/strong&gt;. It generates the page on the server, ensuring up-to-date data.&lt;/p&gt;

&lt;p&gt;For content that can be &lt;em&gt;pre-generated&lt;/em&gt; with data at build time and doesn't change frequently, &lt;strong&gt;SSG&lt;/strong&gt; is a good choice.&lt;/p&gt;

&lt;p&gt;If your page needs &lt;em&gt;real-time data&lt;/em&gt; updates, consider &lt;strong&gt;CSR&lt;/strong&gt; with client-side data fetching libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Performance Requirements
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SSR&lt;/strong&gt; offers good initial load performance but might be &lt;em&gt;slower&lt;/em&gt; for frequently updated or high-traffic pages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSG&lt;/strong&gt; provides &lt;em&gt;excellent performance&lt;/em&gt;, as pages are pre-generated and served as static files, reducing server load and load times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSR&lt;/strong&gt; can offer fast page transitions and interactivity but may have &lt;em&gt;slower&lt;/em&gt; initial page load times.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. SEO
&lt;/h2&gt;

&lt;p&gt;If &lt;em&gt;SEO&lt;/em&gt; is a priority, &lt;strong&gt;SSR&lt;/strong&gt; and &lt;strong&gt;SSG&lt;/strong&gt; are preferred because they make it easy for search engines to index your content.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Complexity
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SSR&lt;/strong&gt; and &lt;strong&gt;SSG&lt;/strong&gt; are &lt;em&gt;easier to set up&lt;/em&gt; as they generate HTML on the server. &lt;strong&gt;CSR&lt;/strong&gt; can be more &lt;em&gt;complex&lt;/em&gt;, especially when handling client-side data fetching and hydration.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Resource Consumption
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SSR&lt;/strong&gt; consumes &lt;em&gt;server resources&lt;/em&gt; as it generates pages on the server for each request. &lt;strong&gt;SSG&lt;/strong&gt; is &lt;em&gt;less resource-intensive&lt;/em&gt; as pages are pre-built. &lt;strong&gt;CSR&lt;/strong&gt; relies primarily on &lt;em&gt;client resources&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;You can &lt;em&gt;mix and match&lt;/em&gt; rendering methods within your application. For instance, you can use SSR or SSG for most of your site and CSR for specific interactive parts.&lt;/p&gt;

&lt;p&gt;Think about the &lt;em&gt;user experience&lt;/em&gt; you want to provide. If &lt;em&gt;speed&lt;/em&gt; and &lt;em&gt;interactivity&lt;/em&gt; are crucial, lean towards &lt;strong&gt;CSR&lt;/strong&gt;. If &lt;em&gt;consistency&lt;/em&gt; and &lt;em&gt;SEO&lt;/em&gt; are a priority, &lt;strong&gt;SSR&lt;/strong&gt; or &lt;strong&gt;SSG&lt;/strong&gt; might be a better choice.&lt;/p&gt;

&lt;p&gt;Summary&lt;/p&gt;

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

&lt;p&gt;In conclusion, choosing the right rendering method in Next.js is all about aligning your choice with your application's unique needs and goals. Carefully assess factors like data requirements, performance, SEO, complexity, and user experience to determine the most suitable approach. You can even use a mix of methods to strike the right balance between performance and interactivity for your web application.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Next.js Rendering</title>
      <dc:creator>rosa-rzi</dc:creator>
      <pubDate>Sat, 14 Oct 2023 15:38:00 +0000</pubDate>
      <link>https://dev.to/rosa-rzi/nextjs-rendering-44kh</link>
      <guid>https://dev.to/rosa-rzi/nextjs-rendering-44kh</guid>
      <description>&lt;p&gt;&lt;em&gt;Rendering = from code to HTML&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Next.js has three types of rendering:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Server-Side Rendering&lt;/li&gt;
&lt;li&gt;Client-Side Rendering&lt;/li&gt;
&lt;li&gt;Static Site Generation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These can be grouped into two categories: Pre-Rendering (Server-Side and Static site) and Client-Side Rendering.&lt;/p&gt;

&lt;p&gt;Pre-rendering fetches the data and transforms the React components before the result is sent to the client (i.e. generates it in advance on a server). Whereas Client-Side Rendering does the process on the user's device.&lt;/p&gt;

&lt;p&gt;Now what's the difference between the two types of Pre-rendering? Server-side rendering generates the HTML of the page &lt;strong&gt;on a server for each request&lt;/strong&gt; and then sends it to the client. Static site generation also generates the page on a server however, content is generated &lt;strong&gt;once and is stored then re-used for each request&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So how do we decide which rendering method to use with Nextjs? Stay tuned for my next post!&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br&gt;
Rosa&lt;/p&gt;

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