The Nuxt big thing in web development?
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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Angular 4 Development and Production Environments with Firebase
Fireship
OAuth with Angular and Firebase Tutorial
Fireship
Anonymous Authentication with Angular and Firebase - Lazy Registration
Fireship
Angular Router Guards for Firebase Users
Fireship
Angular Firebase CRUD App with NoSQL Database Tutorial
Fireship
Upload Files from Angular to Firebase Storage
Fireship
How to Deploy an Angular App to Firebase Hosting
Fireship
Sharing Data between Components in Angular
Fireship
Loading Spinners for Asynchronous Firebase Data
Fireship
Angular 4 Transactional Email with Google Firebase Cloud Functions
Fireship
Firebase Database Rules Tutorial
Fireship
Autocomplete Search with Angular4 and Firebase
Fireship
Reddit Inspired Upvoting System with Angular and Firebase NoSQL
Fireship
Angular Drag-and-Drop File Uploads to Firebase Storage
Fireship
Text Translation with Firebase Cloud Functions onWrite and Angular 4
Fireship
Custom Usernames with Firebase Authentication
Fireship
Twitter-Inspired Follow Unfollow Feature with Firebase and Angular 4
Fireship
Simple Pagination with Firebase and Angular 4
Fireship
How to Connect Firebase Users to their Data - 3 Methods
Fireship
Add Toast Message Notifications to your Angular App
Fireship
Facebook-Inspired Reactions System with Angular and Firebase
Fireship
Learn NgModule in Angular with Examples
Fireship
Lazy Loading Components in Angular 4
Fireship
Stripe Checkout Payments with Angular and Firebase - Part 1
Fireship
Process Stripe Payments with Firebase Cloud Functions - Part 2
Fireship
Selling Digital Content in Angular with Stripe Payments - Part 3
Fireship
Angular 4 Full Text Search with Algolia - Part 1
Fireship
Algolia with Firebase Cloud Functions - Part 2
Fireship
Firebase Phone Authentication in Angular 4
Fireship
Top 7 RxJS Concepts for Angular Developers
Fireship
Learn Angular Animations with 5 Examples
Fireship
Advanced Firebase Data Filtering (Multi-Property)
Fireship
Realtime Maps with Mapbox + Firebase + Angular
Fireship
Angular Reactive Forms with Firebase Database Backend
Fireship
Send Push Notifications in Angular with Firebase Cloud Messaging
Fireship
Top 7 Ways to Debug Angular 4 Apps
Fireship
Infinite Scroll with Angular and Firebase
Fireship
Use TypeScript with Firebase Cloud Functions
Fireship
Realtime Graphs and Charts with Plotly and Firebase
Fireship
Role-Based User Permissions in Firebase
Fireship
User Presence System in Realtime - Online, Offline, Away
Fireship
Location-based Queries with GeoFire and Angular Google Maps
Fireship
Angular ngrx Redux Quick Start Tutorial
Fireship
Angular Ngrx Effects with Firebase Database
Fireship
Progressive Web Apps with Angular
Fireship
Angular Ngrx with Firebase Google OAuth User Authentication
Fireship
RxJS Quick Start with Practical Examples
Fireship
Send SMS Text Messages with Twilio and Firebase
Fireship
Firebase Database Performance Profiling
Fireship
Native Desktop Apps with Angular and Electron
Fireship
Subscription Payments with Stripe, Angular, and Firebase
Fireship
Firestore with AngularFire5 Quick Start Tutorial
Fireship
Angular HTTP Client Quick Start Tutorial
Fireship
Google Sign-In with Firestore Custom User Data
Fireship
Star Review System from Scratch with Firestore + Angular
Fireship
Angular Chatbot with Dialogflow (API.ai)
Fireship
Learn @ngrx/entity and Feature Modules
Fireship
Infinite Scroll Pagination with Firestore
Fireship
Faster Firestore via Data Aggregation
Fireship
Contentful - CMS for Angular Progressive Web Apps
Fireship
More on: Frontend Performance
View skill →Related Reads
📰
📰
📰
📰
How to Create a Cursor Tail Using HTML, CSS, and JavaScript
Medium · JavaScript
I built a landing page with Three.js, vanilla JS, and zero frameworks — here's what I learned
Dev.to · Ayush Shekhar
Part 1: Why I Rarely Use useEffect Anymore (and what I use instead)
Dev.to · Alejandro
HTML Canvas Cheat Sheet for Pixel Art & Image Effects
Dev.to · lemon
🎓
Tutor Explanation
DeepCamp AI