The Nuxt big thing in web development?

Fireship · Beginner ·🌐 Frontend Engineering ·4y ago

Key Takeaways

Nuxt3, a server-side rendering framework for Vue, has reached release candidate with features like Auto Imports, Nitro server engine, and built-in data fetching capabilities, making it a strong competitor to Next.js and Remix.

Full Transcript

it is April 25th 2022 and you're watching the code report after 16 months of hard work nujs version 3 has finally hit release candidate it's been 84 years and it was well worth the wait it's kind of like the nextjs for the view ecosystem and at first glance the only real difference is just one valve but the truth is that n has implemented some really unique features that are about to blow your mind if you've never used it imagine a world where every file has access to every component in your project so you never have to write an import statement ever again I never thought I'd see it in my lifetime but njs figured out a way to handle Auto Imports in a way that makes total sense we'll look at that along with a bunch of other features over the next few minutes first we need to talk about its documentation when you generate a new project you get this extremely minimal starting point and you're left wondering what do I do next well just like view itself this is a progressive framework that can do a lot of different things like build a single page app a static site a server rendered site a rest API or all of these things together at once what stands out in the documentation is that there's a page that corresponds to every directory in your project many of these directories do some magic like Pages handles all of your routing like nextjs and I really like how the documentation explains what every file in a project will do on top of that it has traditional API documentation as well as a ton of examples with interactive demos now the big core feature of Nu that makes everything else possible is a server engine they built from the ground up called Nitro it supports SSR and static site generation but most importantly it allows you to deploy on the edge like on cloudflare workers for example that means you're not limited to node.js and you can literally run serers side code all over the world as close as possible to the end user making your site extremely fast but the one thing it doesn't do yet is hybrid rendering where you have some routes that are static and others that are server rendered although this will be supported in the future now the most important aspect of rendering is how you fetch data on the server if we go into a component you'll notice we have a setup script which contains code that will run on the server now we can fetch data from our API or a database with composes like use async data or more conveniently use fetch it makes a request then returns a data value that we can then use directly in the template below and did you notice I'm using top level of weight that makes things incredibly simple but we're not going to stop there one problem you might encounter with server rendering is sending too much data over the wire you can easily filter the properties you need from the object using the pick option or you can use transform to change the format of the data entirely but what if we want to refresh this data later it also returns a refresh function that we can simply call from the client side template it also has pending and error objects that we can use in the UI as well so really awesome data fetching capabilities out of the box another thing we might want to do while we're here is add some Dynamic data to the head of the document one way to do it is with the head component in the template or we can go to our server side script and Define it in the use head composable that's useful but one weird thing you may have noticed here is that I'm using these components without importing them from anywhere one of the most mind-blowing features is Auto Imports everything in the framework is automatically available to you in any file without an es import on top of that any code that you define in the composes or components directory is made available on every page automatically the only thing I don't like about this is that it makes me wonder how many hours of my life I wasted trying to organize my imports and exports in other projects and one other potential issue is name collisions but it will give you a warning when that occurs you might also be wondering if this produces a massive JavaScript bundle but the answer is no because it will automatically perform code splitting based on the components that you use on each individual page now let's switch gears to another awesome feature layouts a complex application might have multiple different types of pages like a Blog and an admin area every page can be assigned a layout which will wrap it with an entirely different UI and that layout can also have slots where specific pieces of UI can be inserted it's just a really practical way to compose a complex UI in addition n also supports nested routing very similar to the remix framework for react and that's really cool because it means you can transition different parts of the UI while changing the route without needing to Reen under the entire page and that can be really useful for a dashboard Style app yet another challenge you'll face when building a multi-page application is State Management like sharing data across multiple Pages Nu provides a US state composable that allows you to Define state with a shared key its value is preserved after being rendered on the server and then can be shared across multiple components on the client side another thing we need to talk about is server routes like Pages the file system corresponds to a certain route you can add a suffix like git post or patch to any of these files to to change the HTTP method that is used but what's really awesome is that instead of sending a response you just return a value and by doing that it allows n to automatically create typings for all of your API routes which means you get a strongly typed API with almost no effort there's tons of awesome stuff here and I could keep going but let me know if you want to see a full next tutorial in the comments this has been the code report thanks for watching and I will see you in the next one

Original Description

Nuxt3, an SSR framework for Vue, just hit release candidate last week. Let's take a first look at its most powerful features and compare it to other fullstack JavaScript frameworks like Next.js and Remix. #webdev #js #TheCodeReport 🔗 Resources - Nuxt3 Release https://nuxtjs.org/announcements/nuxt3-rc/ - Nuxt Docs https://v3.nuxtjs.org/getting-started/quick-start - Vue in 100 Seconds https://youtu.be/nhBVL41-_Cw - Next in 100 Seconds https://youtu.be/Sklc_fQBmcs 🔥 Get More Content - Upgrade to PRO Upgrade to Fireship PRO at https://fireship.io/pro Use code lORhwXd2 for 25% off your first payment. 🎨 My Editor Settings - Atom One Dark - vscode-icons - Fira Code Font 🔖 Topics Covered - Nuxt version 3 first look - Nuxt3 Review - Nuxt.js vs Next.js - Server side rendering with Vue.js - Nuxt.js features overview - Deploy vue to serverless edge functions
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Fireship · Fireship · 0 of 60

← Previous Next →
1 Angular 4 Development and Production Environments with Firebase
Angular 4 Development and Production Environments with Firebase
Fireship
2 OAuth with Angular and Firebase Tutorial
OAuth with Angular and Firebase Tutorial
Fireship
3 Anonymous Authentication with Angular and Firebase - Lazy Registration
Anonymous Authentication with Angular and Firebase - Lazy Registration
Fireship
4 Angular Router Guards for Firebase Users
Angular Router Guards for Firebase Users
Fireship
5 Angular Firebase CRUD App with NoSQL Database Tutorial
Angular Firebase CRUD App with NoSQL Database Tutorial
Fireship
6 Upload Files from Angular to Firebase Storage
Upload Files from Angular to Firebase Storage
Fireship
7 How to Deploy an Angular App to Firebase Hosting
How to Deploy an Angular App to Firebase Hosting
Fireship
8 Sharing Data between Components in Angular
Sharing Data between Components in Angular
Fireship
9 Loading Spinners for Asynchronous Firebase Data
Loading Spinners for Asynchronous Firebase Data
Fireship
10 Angular 4 Transactional Email with Google Firebase Cloud Functions
Angular 4 Transactional Email with Google Firebase Cloud Functions
Fireship
11 Firebase Database Rules Tutorial
Firebase Database Rules Tutorial
Fireship
12 Autocomplete Search with Angular4 and Firebase
Autocomplete Search with Angular4 and Firebase
Fireship
13 Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Fireship
14 Angular Drag-and-Drop File Uploads to Firebase Storage
Angular Drag-and-Drop File Uploads to Firebase Storage
Fireship
15 Text Translation with Firebase Cloud Functions onWrite and Angular 4
Text Translation with Firebase Cloud Functions onWrite and Angular 4
Fireship
16 Custom Usernames with Firebase Authentication
Custom Usernames with Firebase Authentication
Fireship
17 Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Fireship
18 Simple Pagination with Firebase and Angular 4
Simple Pagination with Firebase and Angular 4
Fireship
19 How to Connect Firebase Users to their Data - 3 Methods
How to Connect Firebase Users to their Data - 3 Methods
Fireship
20 Add Toast Message Notifications to your Angular App
Add Toast Message Notifications to your Angular App
Fireship
21 Facebook-Inspired Reactions System with Angular and Firebase
Facebook-Inspired Reactions System with Angular and Firebase
Fireship
22 Learn NgModule in Angular with Examples
Learn NgModule in Angular with Examples
Fireship
23 Lazy Loading Components in Angular 4
Lazy Loading Components in Angular 4
Fireship
24 Stripe Checkout Payments with Angular and Firebase - Part 1
Stripe Checkout Payments with Angular and Firebase - Part 1
Fireship
25 Process Stripe Payments with Firebase Cloud Functions - Part 2
Process Stripe Payments with Firebase Cloud Functions - Part 2
Fireship
26 Selling Digital Content in Angular with Stripe Payments - Part 3
Selling Digital Content in Angular with Stripe Payments - Part 3
Fireship
27 Angular 4 Full Text Search with Algolia - Part 1
Angular 4 Full Text Search with Algolia - Part 1
Fireship
28 Algolia with Firebase Cloud Functions - Part 2
Algolia with Firebase Cloud Functions - Part 2
Fireship
29 Firebase Phone Authentication in Angular 4
Firebase Phone Authentication in Angular 4
Fireship
30 Top 7 RxJS Concepts for Angular Developers
Top 7 RxJS Concepts for Angular Developers
Fireship
31 Learn Angular Animations with 5 Examples
Learn Angular Animations with 5 Examples
Fireship
32 Advanced Firebase Data Filtering (Multi-Property)
Advanced Firebase Data Filtering (Multi-Property)
Fireship
33 Realtime Maps with Mapbox + Firebase + Angular
Realtime Maps with Mapbox + Firebase + Angular
Fireship
34 Angular Reactive Forms with Firebase Database Backend
Angular Reactive Forms with Firebase Database Backend
Fireship
35 Send Push Notifications in Angular with Firebase Cloud Messaging
Send Push Notifications in Angular with Firebase Cloud Messaging
Fireship
36 Top 7 Ways to Debug Angular 4 Apps
Top 7 Ways to Debug Angular 4 Apps
Fireship
37 Infinite Scroll with Angular and Firebase
Infinite Scroll with Angular and Firebase
Fireship
38 Use TypeScript with Firebase Cloud Functions
Use TypeScript with Firebase Cloud Functions
Fireship
39 Realtime Graphs and Charts with Plotly and Firebase
Realtime Graphs and Charts with Plotly and Firebase
Fireship
40 Role-Based User Permissions in Firebase
Role-Based User Permissions in Firebase
Fireship
41 User Presence System in Realtime - Online, Offline, Away
User Presence System in Realtime - Online, Offline, Away
Fireship
42 Location-based Queries with GeoFire and Angular Google Maps
Location-based Queries with GeoFire and Angular Google Maps
Fireship
43 Angular ngrx Redux Quick Start Tutorial
Angular ngrx Redux Quick Start Tutorial
Fireship
44 Angular Ngrx Effects with Firebase Database
Angular Ngrx Effects with Firebase Database
Fireship
45 Progressive Web Apps with Angular
Progressive Web Apps with Angular
Fireship
46 Angular Ngrx with Firebase Google OAuth User Authentication
Angular Ngrx with Firebase Google OAuth User Authentication
Fireship
47 RxJS Quick Start with Practical Examples
RxJS Quick Start with Practical Examples
Fireship
48 Send SMS Text Messages with Twilio and Firebase
Send SMS Text Messages with Twilio and Firebase
Fireship
49 Firebase Database Performance Profiling
Firebase Database Performance Profiling
Fireship
50 Native Desktop Apps with Angular and Electron
Native Desktop Apps with Angular and Electron
Fireship
51 Subscription Payments with Stripe, Angular, and Firebase
Subscription Payments with Stripe, Angular, and Firebase
Fireship
52 Firestore with AngularFire5 Quick Start Tutorial
Firestore with AngularFire5 Quick Start Tutorial
Fireship
53 Angular HTTP Client Quick Start Tutorial
Angular HTTP Client Quick Start Tutorial
Fireship
54 Google Sign-In with Firestore Custom User Data
Google Sign-In with Firestore Custom User Data
Fireship
55 Star Review System from Scratch with Firestore + Angular
Star Review System from Scratch with Firestore + Angular
Fireship
56 Angular Chatbot with Dialogflow (API.ai)
Angular Chatbot with Dialogflow (API.ai)
Fireship
57 Learn @ngrx/entity and Feature Modules
Learn @ngrx/entity and Feature Modules
Fireship
58 Infinite Scroll Pagination with Firestore
Infinite Scroll Pagination with Firestore
Fireship
59 Faster Firestore via Data Aggregation
Faster Firestore via Data Aggregation
Fireship
60 Contentful - CMS for Angular Progressive Web Apps
Contentful - CMS for Angular Progressive Web Apps
Fireship

Nuxt3 is a powerful server-side rendering framework for Vue that offers features like Auto Imports, Nitro server engine, and built-in data fetching capabilities, making it a strong competitor to Next.js and Remix. This video provides an overview of Nuxt3's features and how to get started with it.

Key Takeaways
  1. Generate a new Nuxt3 project
  2. Explore the documentation and directory structure
  3. Use Auto Imports to access components and composables
  4. Set up server-side rendering with Nitro
  5. Fetch data on the server with useAsyncData or useFetch
  6. Use the head component or useHead composable to add dynamic data to the head of the document
  7. Use layouts to compose complex UIs
  8. Use nested routing to transition different parts of the UI
💡 Nuxt3's Auto Imports feature allows you to access components and composables without importing them, making it easier to build and maintain complex applications.

Related Reads

Up next
How To Build A Twitter Clone - React Next JS - Appwrite Crash Course
Adrian Twarog
Watch →