Building for the Edge - Crafting a Next-Gen Framework

Rate this content
Bookmark

Creating a new Vue-based meta-framework from scratch with live coding.

FAQ

NUXT is a framework built on top of Vue for creating web applications. It integrates best practices and allows for customization. NUXT provides a composable approach, enabling features to be included as needed, and supports server optimization for serverless environments. It's designed to enhance both developer experience and application performance.

Nitro is the new server architecture introduced in NUXT for building web applications. It is designed for the serverless world and edge computing, focusing on high efficiency and low resource utilization. Nitro allows developers to build and deploy applications rapidly with its streamlined framework.

Yes, NUXT is suitable for both server-rendered and static applications. It provides a rich set of features that enhance development even if server-side rendering is not required, such as automatic component imports, type safety, and comprehensive utilities for routing and state management.

NUXT 3 introduces significant changes including a transition from Vue 2 to Vue 3, updates to accommodate breaking changes in dependencies like PostCSS and Webpack, and the adoption of Vite over Webpack. It also features a shift from a singleton design pattern to a more modular and composable architecture.

Pinia is recommended as the state management solution for NUXT in the Vue 3 ecosystem, succeeding VueX. It offers a modern API, improved devtools integration, and is designed to work seamlessly with Vue 3's composition API.

Vite provides a fast development setup with features like instant server start and hot module replacement. Most NUXT developers choose Vite due to its efficiency and the active development of plugins within the ecosystem, enhancing the overall developer experience and application performance.

NUXT supports legacy Vue 2 projects by allowing integration through its architecture, but transitioning to NUXT 3 with Vue 3 is recommended to take full advantage of the latest features and improvements in performance and scalability.

NUXT has collaborated with the Chrome team to improve web performance, particularly focusing on source mapping and script loading optimizations. These efforts aim to enhance debugging capabilities and ensure that best practices are applied in performance-critical areas.

Daniel Roe
Daniel Roe
32 min
12 May, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

NUXT is a framework for building web apps that has undergone significant changes with the introduction of Nitro, a new server. The Talk covers topics such as building a framework with Nitro, rendering a view app, configuring Nitro and Vite, and integrating Nuxt with an existing Vue 2 project. The collaboration between Nuxt and Chrome has resulted in performance improvements, and the future of Nuxt and Nitro looks promising with new ideas and extensions being developed.

1. Introduction to NUXT and Nitro

Short description:

I am a member of the NUXT Core Team and have worked on projects like Magic Regex and Fontane. I helped build Nuxt, a framework for building web apps. We had an opportunity to rethink Nuxt and made significant changes. I want to show off Nitro, our new server, and demonstrate building Nuxt from scratch on top of it.

♪♪ Can move on. So I am a member of the NUXT Core Team, along with a number of other folk here. You've already heard from Lucy. Sebastien's going to speak in a moment, Alex as well. I'm also involved in a number of other projects like Magic Regex, Fontane, which makes your layout shift disappear if you have custom web fonts. Elk, which is a client for Mastodon, and I have a website as well. So feel free to check out any of those that may interest you.

This is my milieu. If you ever message me on Twitter or Discord or whatever, I'm probably sitting at this desk. One of my three cats is probably stopping me from working. I don't know if you've ever experienced that you have changed your priorities for the day based on what your pet is doing, because I 100% have. Like, there are times when I just cannot code because I actually have a cat here. So, the only thing I can do is read through GitHub issues or something like that, but sorry, I'm losing track.

So I helped build Nuxt, which is a framework for building web apps, and it's built on top of Vue, of course. Can I have a show of hands, who here has used Nuxt? Okay. Well, that will skip the next ten slides. So, recently, we had a – well, a couple of years ago. We had a significant opportunity to rethink what Nuxt was about, what we would do with it. I mean, the core philosophy, the idea that you would be able to get started with best practice built in and customize as you went, that was still there, but a lot of things were changing.

So, the move from Vue 2 to Vue 3, there was a breaking change in PostCSS, huge breaking changes in Webpack, at the same time, just as we were about to be all ready to go with Webpack, Evan, for goodness' sake, releases Vite. What was that about? But I'm a big fan, but lots of opportunities to rethink. And alongside those, we had philosophical changes, like moving from a sort of singleton approach where you sort of have everything defined centrally and available to you, to a composable approach where you can actually pull in features that you want and need and actually only those get included in the bundle, an idea that you can actually share logic between components, lots of stuff that really made us think about what we wanted Nuxt to do. And I'm not going to talk about a lot of that, actually. I'm going to focus on the next piece, which we did, which was actually, we think, the server and how it was that we could write a server that would be designed for the serverless world, for a world of edge computing, for a world where you don't necessarily have a Docker container just always on or a server that's just constantly ready to return responses, but maybe you might need to fire something up. We moved, by the way, in Nuxt 2 from 300 milliseconds called Start to five in Nuxt 3, and we moved from 52 meg of bundle size to three in server node modules in Nuxt 2 to Nuxt 3. So there are huge changes we made, but in particular what I want to talk about today is I want to show off Nitro, which is the name we've given to our new server. We've released it so anyone can build on it, and I want to show you what it would look like to build Nuxt from scratch in a few minutes. I want to really very much try and do this, and I apologize as possible I might go into my cue. I'm going to build Nuxt from scratch on top of Nitro, powered by lots and lots of tools, which I'll show you as we go. So here we go.

2. Building a Framework with Nitro

Short description:

Let's dive in and build a framework powered by Nitro. We install Nitro and H3, a server framework like Express. We create a web server that returns a JSON response. We provide type safety on fetches across the app and make it performant. In NUX, the fetch call works isomorphically.

Let's dive in and build a framework powered by Nitro. So the first thing to do, this is an empty repository, basically, nothing much there. I'm going to install Nitro and H3, which is the server framework, a little bit like Express that we built on top of that, and start it.

Okay, so off the top of our head we have a web server that's running. Let's go to local host 3000, nothing there. Let's create a root, foo. Nitro and Nuxt, we have very much the idea that we want to be as minimal as possible and as intuitive as possible. So we can do something like this. And actually, if we hit that endpoint, I'll hit it actually just in this terminal here, which seems to be tiny. If I hit local host, what was that, foo, I get back a JSON response. I've just returned an object. We also as much as possible try and auto-import things, and we do that in a pattern that we started with Nuxt. We provide our own TS config to let your editor know, your IDE know what's available both in terms of, well, in terms of everything that we make available, whether that's type aliases, buffer paths, or making your editor know about what is auto-importable and what isn't. We can also do really cool things like this. Say I, let's see, duplicate this, as another, another handler. I can actually get type safety on fetches across my app, so it knows the routes that exist, it knows the return types for that data, and so I could do something like this and actually get full type safety, and it's quite fun. And what you'll also notice, might not, is that this dollar sign fetch thing, when used in a server context, actually doesn't hit the network layer, it just makes a function call. So it's as much as possible, we're trying to make it as performant as we can. In NUX, as it happens, when you run that fetch call, it will make a request to the server, so it works isomorphically.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a new web framework from the creators of React Router that helps you build better, faster websites through a solid understanding of web fundamentals. Remix takes care of the heavy lifting like server rendering, code splitting, prefetching, and navigation and leaves you with the fun part: building something awesome!
Everything Beyond State Management in Stores with Pinia
Vue.js London Live 2021Vue.js London Live 2021
34 min
Everything Beyond State Management in Stores with Pinia
Top Content
When we think about Vuex, Pinia, or stores in general we often think about state management and the Flux patterns but not only do stores not always follow the Flux pattern, there is so much more about stores that make them worth using! Plugins, Devtools, server-side rendering, TypeScript integrations... Let's dive into everything beyond state management with Pinia with practical examples about plugins and Devtools to get the most out of your stores.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Too much JavaScript is getting you down? New frameworks promising no JavaScript look interesting, but you have an existing React application to maintain. What if Qwik React is your answer for faster applications startup and better user experience? Qwik React allows you to easily turn your React application into a collection of islands, which can be SSRed and delayed hydrated, and in some instances, hydration skipped altogether. And all of this in an incremental way without a rewrite.
Full Stack Documentation
JSNation 2022JSNation 2022
28 min
Full Stack Documentation
Top Content
Interactive web-based tutorials have become a staple of front end frameworks, and it's easy to see why — developers love being able to try out new tools without the hassle of installing packages or cloning repos.But in the age of full stack meta-frameworks like Next, Remix and SvelteKit, these tutorials only go so far. In this talk, we'll look at how we on the Svelte team are using cutting edge web technology to rethink how we teach each other the tools of our trade.
Welcome to Nuxt 3
Vue.js London Live 2021Vue.js London Live 2021
29 min
Welcome to Nuxt 3
Top Content
Explain about NuxtJS codebase refactor and challenges facing to implement Vue 3, Vite and other packages.
One Year Into Vue 3
Vue.js London Live 2021Vue.js London Live 2021
20 min
One Year Into Vue 3
Top Content
Vue 3 may still sound new to many users, but it's actually been released for over a year already. How did Vue 3 evolve during this period? Why did it take so long for the ecosystem to catch up? What did we learn from this process? What's coming next? We will discuss these questions in this talk!

Workshops on related topic

Vue3: Modern Frontend App Development
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Featured WorkshopFree
Mikhail Kuznetcov
Mikhail Kuznetcov
The Vue3 has been released in mid-2020. Besides many improvements and optimizations, the main feature of Vue3 brings is the Composition API – a new way to write and reuse reactive code. Let's learn more about how to use Composition API efficiently.

Besides core Vue3 features we'll explain examples of how to use popular libraries with Vue3.

Table of contents:
- Introduction to Vue3
- Composition API
- Core libraries
- Vue3 ecosystem

Prerequisites:
IDE of choice (Inellij or VSC) installed
Nodejs + NPM
Building WebApps That Light Up the Internet with QwikCity
JSNation 2023JSNation 2023
170 min
Building WebApps That Light Up the Internet with QwikCity
Featured WorkshopFree
Miško Hevery
Miško Hevery
Building instant-on web applications at scale have been elusive. Real-world sites need tracking, analytics, and complex user interfaces and interactions. We always start with the best intentions but end up with a less-than-ideal site.
QwikCity is a new meta-framework that allows you to build large-scale applications with constant startup-up performance. We will look at how to build a QwikCity application and what makes it unique. The workshop will show you how to set up a QwikCitp project. How routing works with layout. The demo application will fetch data and present it to the user in an editable form. And finally, how one can use authentication. All of the basic parts for any large-scale applications.
Along the way, we will also look at what makes Qwik unique, and how resumability enables constant startup performance no matter the application complexity.
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
Using Nitro – Building an App with the Latest Nuxt Rendering Engine
Vue.js London Live 2021Vue.js London Live 2021
117 min
Using Nitro – Building an App with the Latest Nuxt Rendering Engine
Top Content
Workshop
Daniel Roe
Daniel Roe
We'll build a Nuxt project together from scratch using Nitro, the new Nuxt rendering engine, and Nuxt Bridge. We'll explore some of the ways that you can use and deploy Nitro, whilst building a application together with some of the real-world constraints you'd face when deploying an app for your enterprise. Along the way, fire your questions at me and I'll do my best to answer them.
Going on an adventure with Nuxt 3, Motion UI and Azure
JSNation 2022JSNation 2022
141 min
Going on an adventure with Nuxt 3, Motion UI and Azure
WorkshopFree
Melanie de Leeuw
Melanie de Leeuw
We love easily created and deployed web applications! So, let’s see what a very current tech stack like Nuxt 3, Motion UI and Azure Static Web Apps can do for us. It could very well be a golden trio in modern day web development. Or it could be a fire pit of bugs and errors. Either way it will be a learning adventure for us all. Nuxt 3 has been released just a few months ago, and we cannot wait any longer to explore its new features like its acceptance of Vue 3 and the Nitro Engine. We add a bit of pizzazz to our application with the Sass library Motion UI, because static design is out, and animations are in again.Our driving power of the stack will be Azure. Azure static web apps are new, close to production and a nifty and quick way for developers to deploy their websites. So of course, we must try this out.With some sprinkled Azure Functions on top, we will explore what web development in 2022 can do.
TresJS create 3D experiences declaratively with Vue Components
Vue.js London 2023Vue.js London 2023
137 min
TresJS create 3D experiences declaratively with Vue Components
Workshop
Alvaro Saburido
Alvaro Saburido
- Intro 3D - Intro WebGL- ThreeJS- Why TresJS- Installation or Stackblitz setup - Core Basics- Setting up the Canvas- Scene- Camera- Adding an object- Geometries- Arguments- Props- Slots- The Loop- UseRenderLoop composable- Before and After rendering callbacks- Basic Animations- Materials- Basic Material- Normal Material- Toon Material- Lambert Material- Standard and Physical Material- Metalness, roughness - Lights- AmbientLight- DirectionalLight- PointLights- Shadows- Textures- Loading textures with useTextures- Tips and tricks- Misc- Orbit Controls- Loading models with Cientos- Debugging your scene- Performance