<?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: Elise Patrikainen</title>
    <description>The latest articles on DEV Community by Elise Patrikainen (@elisepatrikain1).</description>
    <link>https://dev.to/elisepatrikain1</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%2F546470%2Faf8427e5-e854-435e-85db-bd2ac002098a.jpg</url>
      <title>DEV Community: Elise Patrikainen</title>
      <link>https://dev.to/elisepatrikain1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/elisepatrikain1"/>
    <language>en</language>
    <item>
      <title>What’s new in Nuxt 3?</title>
      <dc:creator>Elise Patrikainen</dc:creator>
      <pubDate>Sun, 03 Oct 2021 16:31:04 +0000</pubDate>
      <link>https://dev.to/playfulprogramming/what-s-new-in-nuxt-3-37lg</link>
      <guid>https://dev.to/playfulprogramming/what-s-new-in-nuxt-3-37lg</guid>
      <description>&lt;p&gt;&lt;em&gt;Photo by &lt;a href="https://unsplash.com/@alexxingplus?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Alex Sherstnev&lt;/a&gt; on Unsplash.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Directly inspired by Sebastien Chopin’s talks on Nuxt Nations (which shall be soon available on Youtube) and &lt;a href="https://www.youtube.com/watch?v=ApUPE8b-m04" rel="noopener noreferrer"&gt;Daniel Roe’s talk at Vue.js Amsterdam 2021&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Nuxt 3 is going to be released very soon and brings a lot of entirely new things. It is not a simple upgrade to Vue 3, but &lt;strong&gt;a complete rewrite&lt;/strong&gt; of Nuxt 2, with a &lt;strong&gt;new rendering server&lt;/strong&gt; and, I believe, a &lt;strong&gt;new philosophy&lt;/strong&gt;. The definition of Nuxt itself has changed (cf &lt;a href="//nuxtjs.org"&gt;the official Nuxt website&lt;/a&gt;), it is not “a progressive meta-framework based on Vue.js” anymore but “an open-source framework making web development simple and powerful”.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: this is an article written right after the NuxtNation conference, where Nuxt 3 updates have been announced, and before the Nuxt 3 official release (on the 12th of October), so I apologize in advance for the lack of details on each point. The goal here is really to give a view at the macro-scale of Nuxt evolution. I will of course add more information as details are made available.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  A bit of context
&lt;/h1&gt;

&lt;p&gt;Before diving into the changes, let’s have a quick overview of the context in which these evolutions are made. And, on this point, I found the introduction of &lt;a href="https://www.youtube.com/watch?v=ApUPE8b-m04" rel="noopener noreferrer"&gt;Daniel Roe’s talk&lt;/a&gt; extremely enlightening. He points out that some new trends are emerging in the JavaScript scene (and, more widely, in web development): &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;serverless architecture&lt;/strong&gt; and &lt;strong&gt;JAMstack:&lt;/strong&gt; 
which enhance faster, more secure, and loosely coupled web applications. Indeed, the serverless architecture enables abstracting some part of logic from an application to a distant infrastructure. On the other hand, Jamstack fosters pre-rendering of front-end clients and the use of microservice APIs.&lt;/li&gt;
&lt;li&gt;the apparition of &lt;strong&gt;new targets&lt;/strong&gt;:
&lt;strong&gt;Deno&lt;/strong&gt;, and &lt;strong&gt;‘workers’&lt;/strong&gt;, especially in serverless architecture (in that sense, this point is a consequence of the previous point).&lt;/li&gt;
&lt;li&gt;the &lt;strong&gt;transition&lt;/strong&gt; to &lt;strong&gt;TypeScript&lt;/strong&gt; and &lt;strong&gt;ES modules&lt;/strong&gt; (enhanced by the apparition of new generation dev tools bases on ES modules, such as Snowpack or Vite)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, as far as I understand, Nuxt 3 primarily aims to adapt to these global trends.&lt;/p&gt;

&lt;h1&gt;
  
  
  What's in Nuxt 3?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. The support
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Enhanced TypeScript: Nuxt 3 has been rewritten in TypeScript, and, apparently, the support seems outstanding, with more information and links to documentation than in a standard TypeScript project&lt;/li&gt;
&lt;li&gt;Vue 3 (obviously): including composables and the experimental Suspense API&lt;/li&gt;
&lt;li&gt;Webpack 5 support&lt;/li&gt;
&lt;li&gt;Vite.js: for development and production&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. The very &lt;strong&gt;new&lt;/strong&gt; and &lt;strong&gt;exciting&lt;/strong&gt; things
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The brand-new rendering engine, &lt;strong&gt;Nitro&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Build for &lt;strong&gt;serverless&lt;/strong&gt; (see below):

&lt;ul&gt;
&lt;li&gt;Cold start extremely fast (5 ms)&lt;/li&gt;
&lt;li&gt;Universal: it can run on Node.js, Deno, serverless platforms (including cloudflare workers), and experimentally on web workers &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Hybrid approach&lt;/strong&gt;: Nitro enables mixing SSR and SSG in the same application&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;API routes&lt;/strong&gt;: Nitro preconfigures the integration of API endpoints (with apparently a similar routing system with the one provided for pages)&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;Nuxt &lt;strong&gt;CLI&lt;/strong&gt;, which, bring many new possibilities&lt;/li&gt;

&lt;li&gt;Nuxt &lt;strong&gt;dev tools&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Global &lt;strong&gt;auto imports&lt;/strong&gt;: to avoid the local import of very common functions (for example, “toRef” from the composition API)&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. The tools to make &lt;strong&gt;migrations&lt;/strong&gt; and &lt;strong&gt;cross-version&lt;/strong&gt; developments easy
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Nuxt &lt;strong&gt;bridge&lt;/strong&gt; package, which gives support to most of Nuxt 3 features (excepted Vue 3) to Nuxt 2 projects&lt;/li&gt;
&lt;li&gt;Nuxt &lt;strong&gt;kit&lt;/strong&gt;, which takes care of &lt;strong&gt;modules compatibility&lt;/strong&gt; between Nuxt 2 and Nuxt 3&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Built for serverless
&lt;/h1&gt;

&lt;p&gt;To me, the most impressive breakthrough is &lt;strong&gt;Nitro&lt;/strong&gt;, the new server that powers Nuxt 3. This is a subjective feeling after the conference, though, and maybe my mind will change when the repo is open (apparently, the new CLI would also bring many exciting new possibilities).&lt;/p&gt;

&lt;h2&gt;
  
  
  Cold start
&lt;/h2&gt;

&lt;p&gt;Nitro is &lt;strong&gt;75 times faster on start&lt;/strong&gt; than Nuxt 2 engine, and only needs 5ms on cold start (and less in Cloudflare workers). &lt;br&gt;
To handle this, Nitro works differently from traditional servers. Common servers would, on start, enable all their functionalities, whereas Nitro only starts the functionalities which are relevant to the incoming request. For this, it &lt;strong&gt;tracks&lt;/strong&gt; which files are necessary for each request (with the &lt;a href="https://github.com/vercel/nft" rel="noopener noreferrer"&gt;nft&lt;/a&gt;, or Node File Trace, package from Vercel) and, according to that, &lt;strong&gt;cleverly code splits&lt;/strong&gt; the server bundle. Then, on the incoming request, a &lt;strong&gt;minimalist "orchestrator"&lt;/strong&gt; (which is based on the &lt;strong&gt;h3 framework&lt;/strong&gt;, "built for high performance and portability" by the Nuxt core team and available on &lt;a href="https://github.com/unjs" rel="noopener noreferrer"&gt;the unjs repo&lt;/a&gt;, cf below) decides which part of code to start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Universal
&lt;/h2&gt;

&lt;p&gt;Nitro can run on &lt;strong&gt;Deno&lt;/strong&gt; and on &lt;strong&gt;any JS environment&lt;/strong&gt; (Node.js and workers). In particular, the worker environment support enables Nitro to be run on &lt;strong&gt;serverless platforms&lt;/strong&gt; and, experimentally, on &lt;strong&gt;browser workers&lt;/strong&gt;. &lt;br&gt;
To achieve this, the Nuxt team built themselves the set of libraries on which Nitro is based, which are available on &lt;a href="https://github.com/unjs" rel="noopener noreferrer"&gt;the unjs repo&lt;/a&gt;. A key point of unjs (which stands for Universal JavaScript Solutions) is to provide libraries that can run on any environment of the JavaScript ecosystem. &lt;br&gt;
Therefore, Nitro can build &lt;strong&gt;cross-platform outputs&lt;/strong&gt; (for example, it auto-mocks Node.js builtins with polyfills in builds addressed to non-Node environments). Another interesting feature is that Nitro can &lt;strong&gt;auto-detect the platform&lt;/strong&gt; on which it is deployed (Vercel, Netlify, Firebase, Cloudfare…) and adapt its build accordingly. &lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Nuxt definitely seems to have taken a &lt;strong&gt;turning point&lt;/strong&gt; with this third version. I was personally &lt;strong&gt;astonished&lt;/strong&gt; by this release announcement by the amount of updates and evolutions it brings. I really felt that Nuxt aims to provide &lt;strong&gt;innovations&lt;/strong&gt; that exceed the goal of being “the Vue.js meta-framework”.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>nuxt</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
