After last February Vue 3 officially became the new default version, Nuxt, the popular Vue-based framework, couldn't sit still and started a major migration.
It isn't just following the Vue trend. Nuxt 3 brings a huge set of new features that pamper developer experience (DX) and make our coding work much lighter.
This time we'll go through the Nuxt 3 release, the sharp features it carries, and whether you should start preparing to migrate. Let's get into it! ๐
Key takeaways
- Nuxt 3 is built on Vue 3, with the Composition API and TypeScript support included by default.
- It adopts Vite as the default bundler, which makes development far faster than Webpack did.
- A new server engine called Nitro produces a very light build output with no node_modules dependency.
Where Nuxt 3 Stands Right Now
At the time of writing, Nuxt 3 sits at its third Release Candidate (RC 3). That means this version won't take big changes anymore, and now focuses on minor fixes and stability ahead of the final release.
Peeking at the roadmap on their official site, the stable Nuxt 3 version is scheduled to land around June 2022.
Even as a 'candidate', Nuxt 3 is already very functional, stable enough, and genuinely fun to try. Just don't put it in production yet.
Alongside the new version, core modules like Content, Auth, and Image are being reworked too. Nuxt Content v2 even jumped the gun and shipped first, on May 24.
New Features Worth Drooling Over
The jump from Nuxt 2 to Nuxt 3 is enormous. So many fundamentals changed that the Nuxt team had to rewrite the entire codebase from scratch on new technology.
How big is the change? Here are the flagship features that arrive in Nuxt 3:
Vue 3 and TypeScript by Default
Since Nuxt 3 stands on Vue 3, as the 'framework's framework', it automatically carries every Vue 3 advantage. A few of them:
- Composition API: a more modular coding style that's easy to share through composables.
- TypeScript: static type support that's active out of the box, with no fiddly config.
- Faster Performance: page rendering is claimed up to 55% faster, bundle size cut by up to 41%, and RAM use down by up to 54%.
Since Vue 3 now leans on TypeScript by default, Nuxt adjusted to match. That adaptation was serious work, because the whole core of Nuxt 3 got rewritten in TypeScript. Unlike Nuxt 2, which was mostly plain JavaScript, the official repository is now almost entirely TypeScript.
๐ท Illustration: a chart comparing the programming language mix of the JavaScript-based Nuxt 2 and the TypeScript-based Nuxt 3.
TypeScript's static typing makes your Nuxt project easier to manage as it grows. Add editor support like auto-completion and IntelliSense, and coding feels smoother.
Vite as the Main Bundler
Like Vue 3, Nuxt 3 now fully supports Vite as its default module bundler, replacing Webpack from earlier versions.
The result? The build process and hot module replacement while coding run super fast, nearly instant! The final file size is also smaller than Webpack's output.
If you're loyal to Webpack or still need it, relax. Nuxt 3 keeps an option to use Webpack 5, with config that's just as easy.
Convenient Auto Import
Importing components or helper functions often fills the top lines of a file, especially in complex Nuxt projects.
To make coding more efficient, Nuxt 3 ships a smart Auto Import feature.
With it, you no longer write import lines by hand whenever you use a component or helper. Call the name, and Nuxt detects it behind the scenes.
This auto import covers helper functions, components, composables, plugins, and Vue's built-in API.
Better yet, it isn't like a plain global variable. Your editor still recognizes the component's type, so IntelliSense and code suggestions keep helping.
A New Server Engine Called Nitro
One of the biggest leaps in Nuxt 3 is the new server engine named Nitro.
Nitro is an open-source project under the UnJS ecosystem, developed alongside other libraries like h3.
Nitro lets your Nuxt server run on its own, with no node_modules folder in production. That's a far cry from earlier versions, which leaned heavily on those dependencies.
All program code, third-party libraries, and compiled output get packed neatly into a .output folder. That folder runs directly on Node.js or on service worker platforms like Cloudflare Workers, with no npm install needed.
So, isn't that new architecture sharp? ๐
Ready to Try Nuxt 3?
Those are the revolutionary features Nuxt 3 carries. We just have to wait for the official launch, and it's close.
How about you? Any plans to build something new with Nuxt 3? Or already preparing to migrate an old project?
For fuller information and the official docs, visit the Nuxt 3 site.
Happy coding ๐