Nuxt on the Edge

Rate this content
Bookmark

Learn how to build a Vue application deployed to the edge to bring a blazing fast experience to your end users.

This talk has been presented at Vue.js London 2023, check out the latest edition of this JavaScript Conference.

FAQ

Nuxt Labs specializes in consulting, audits, and migrating projects from Nuxt 2 to Nuxt 3. They also developed Volta, a project management tool built on top of GitHub.

Alternatives to Cloudflare workers for Edge deployment include Vercel Edge functions, Netlify Edge functions, Edge.io, and StackPath.

Edge refers to deploying code to a limited environment running on CDN nodes, such as Cloudflare workers. It offers benefits like zero millisecond cold starts, automatic scaling, and cost efficiency.

Sebastian Chopin, also known as Inoox, is the CEO of Nuxt Labs.

The roadmap for full-stack Nuxt 3 aims to prioritize an edge-first experience, with a promising update expected by the end of the year.

Nuxt allows for easy integration of authentication, including SSO with GitHub, by providing utilities for creating custom API routes.

The Edge Runtime has limitations such as a total size limit of 5 megabytes and restrictions on using certain Node and browser features.

Nuxt is a web framework designed to create full-stack Vue applications, offering features like server-side rendering, client-side rendering, static site generation, and more.

Nuxt offers server-side rendering, client-side rendering, static site generation, edge site rendering, hooks system, file system router, auto-import, data fetching, middleware, plugins, layouts, transitions, server API, TypeScript, state management, and the experimental island component.

Database options for Edge deployment include Cloudflare D1, Torso, Postgre with Neon, Vercel on Neon, Superbase, Plan Scale for MySQL, HyperDB, and KV with Redis and Cloudflare storage.

Sebastien Chopin
Sebastien Chopin
30 min
12 May, 2023

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Nuxt is a web framework with many features including server-side rendering, client-side rendering, static site generation, edge site rendering, and more. The Edge is a limited environment running on CDN nodes, such as Cloudflare network. Database options on the Edge include Postgre with Neon, Versel on Neon, Superbase, MySQL with plan scale, HyperDB, and KV with redis and Cloudflare storage. The speaker demonstrates creating a demo with a votes table, handling API requests, adding authentication, saving votes, and displaying results. The roadmap to a full stack Nuxt 3 with an edge-first experience is in progress. Copilot is a helpful tool for developers. Integrating SSO with GitHub and improving the developer experience are important considerations for Nuxt 3.
Available in Español: Nuxt en el Edge

1. Introduction to Nuxt and the Edge

Short description:

Hello, everyone. I'm going to talk about Nuxt to the edge and what it means. Nuxt is a web framework with many features including server-side rendering, client-side rendering, static site generation, edge site rendering, hooks system, file system router, auto-import, data fetching, middleware, plugins, layouts, transitions, server API, TypeScript, state management, the island component, the layer system, preprocessor for stylus and SAS, the module ecosystem, testing, processors, and more. The Edge is a limited environment running on CDN nodes, such as Cloudflare network with about 200 nodes. It's quick, cheap, scalable, and affordable compared to serverless Lambda. Another option is dnodeploy.legon.app, which is open source.

Hello, everyone. I'm very glad to be here. I won't have so much time, so I will dive directly. I'm going to talk about Nuxt to the edge and what it means.

I'm at Inoox, also known as Sebastian Chopin, which is my real name. I am CEO at Nuxt Labs, and we do meet things, such as consulting and audits. It's also good if you want to migrate from Nuxt 2 to Nuxt 3. We also developed Volta, which is a project management built on top of GitHub and helped us develop Nuxt 3 and make it a stable version. And recently, Nuxt Studio is using Nuxt and Nuxt Content with Live Edition.

Nuxt is a web framework to create full stack view application. So, the question you asked to Daniel about the full stack experience is definitely on our roadmap, but we had to stabilize the framework, make it a good framework for front-end development before diving into the full stack experience. We also have many features. In case you don't know Nuxt, we have server-side rendering, client-side rendering, static site generation, edge site rendering, hooks system, file system router, auto-import, if you're lazy like me. Data fetching, middleware, plugins, layouts, transitions, server API, TypeScript, state management. We have a default state management, but obviously, you can use PNU of UX. We have the island component which is experimental but very promising regarding the server components. The layer system, I don't know if some of you have used layers internally. A few people, basically it's a Nuxt app that you can push on NPM and you can extend. We have preprocessor for stylus, SAS, the module ecosystem, as you have heard, testing, processors and many other features that I won't show you today.

The Edge, who already deployed to the Edge? One, two, okay. Five people out of 10 people. It's a limited environment and it's running on CDN nodes. It's been pushed by Cloudflare workers a few years ago and, basically, when you deploy your code, it's replicated on the network. Here, it's Cloudflare network and there are about 200 nodes. It renders quickly your code and it's very cheap to host. It runs in miniseconds from your end user whenever they are in the world. You have zero minisecond call starts, no server to maintain, it's scale automatically, and it's affordable compared to, it's not a scam, but the serverless Lambda which can cost you a lot of money. Here, we're talking about 50 cents per million of requests and they have a free tier for 100,000 requests per month. But Cloudflare worker is not the only one. Today, we have dnodeploy.legon.app, which is open source as well.

2. Introduction to Edge Functions

Short description:

Vercel Edge function, Netlify Edge function, Edge.io, StackPath, and more are recommended for checking out. It has limitations and is different from Node and browser. It mostly uses the V8 engine to analyze JavaScript code. Plugins were challenging in the past, but now people are more familiar with creating universal JavaScript plugins. The Edge Runtime has limitations but also advantages, making it a tradeoff.

I highly recommend you to check out Vercel Edge function based on Cloudflare, Netlify Edge function, Edge.io, StackPath and many more are coming. But it has limitation. It's different than Node and browser. It's mostly using the V8 engine to analyze your JavaScript code. Like, six years ago, you could not use Window on Node. And you cannot use the file system in the browser. When you were working on plugins, it was a hard experience. But today, people are more used to creating universal JavaScript plugins. It's similar for the Edge Runtime. You have more limitation, but you have more advantage. It's a tradeoff.

QnA

Available in other languages:

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

A Guide to React Rendering Behavior
React Advanced 2022React Advanced 2022
25 min
A Guide to React Rendering Behavior
Top Content
This transcription provides a brief guide to React rendering behavior. It explains the process of rendering, comparing new and old elements, and the importance of pure rendering without side effects. It also covers topics such as batching and double rendering, optimizing rendering and using context and Redux in React. Overall, it offers valuable insights for developers looking to understand and optimize React rendering.
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
State management is not limited to complex applications and transitioning to a store offers significant benefits. Pinia is a centralized state management solution compatible with Vue 2 and Vue 3, providing advanced devtools support and extensibility with plugins. The core API of Pinia is similar to Vuex, but with a less verbose version of stores and powerful plugins. Pinia allows for easy state inspection, error handling, and testing. It is recommended to create one file per store for better organization and Pinia offers a more efficient performance compared to V-rex.
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced 2023React Advanced 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
Watch video: React Compiler - Understanding Idiomatic React (React Forget)
Joe Savona
Mofei Zhang
2 authors
The Talk discusses React Forget, a compiler built at Meta that aims to optimize client-side React development. It explores the use of memoization to improve performance and the vision of Forget to automatically determine dependencies at build time. Forget is named with an F-word pun and has the potential to optimize server builds and enable dead code elimination. The team plans to make Forget open-source and is focused on ensuring its quality before release.
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
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
Welcome to Nuxt 3
Vue.js London Live 2021Vue.js London Live 2021
29 min
Welcome to Nuxt 3
Top Content
Nux3 has made significant improvements in performance, output optimization, and serverless support. Nuxt Bridge brings the Nitro engine for enhanced performance and easier transition between Nuxt 2 and Nuxt Read. Nuxt 3 supports Webpack 5, Bytes, and Vue 3. NextLab has developed brand new websites using Docus technology. Nuxt.js is recommended for building apps faster and simpler, and Nuxt 2 should be used before migrating to Nuxt 3 for stability. DOCUS is a new project that combines Nuxt with additional features like content modules and an admin panel.
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 has seen significant adoption and improvements in performance, bundle size, architecture, and TypeScript integration. The ecosystem around Vue 3 is catching up, with new tools and frameworks being developed. The Vue.js.org documentation is undergoing a complete overhaul. PNIA is emerging as the go-to state management solution for Vue 3. The options API and composition API are both viable options in Vue 3, with the choice depending on factors such as complexity and familiarity with TypeScript. Vue 3 continues to support CDN installation and is recommended for new projects.

Workshops on related topic

React Performance Debugging Masterclass
React Summit 2023React Summit 2023
170 min
React Performance Debugging Masterclass
Top Content
Featured WorkshopFree
Ivan Akulov
Ivan Akulov
Ivan’s first attempts at performance debugging were chaotic. He would see a slow interaction, try a random optimization, see that it didn't help, and keep trying other optimizations until he found the right one (or gave up).
Back then, Ivan didn’t know how to use performance devtools well. He would do a recording in Chrome DevTools or React Profiler, poke around it, try clicking random things, and then close it in frustration a few minutes later. Now, Ivan knows exactly where and what to look for. And in this workshop, Ivan will teach you that too.
Here’s how this is going to work. We’ll take a slow app → debug it (using tools like Chrome DevTools, React Profiler, and why-did-you-render) → pinpoint the bottleneck → and then repeat, several times more. We won’t talk about the solutions (in 90% of the cases, it’s just the ol’ regular useMemo() or memo()). But we’ll talk about everything that comes before – and learn how to analyze any React performance problem, step by step.
(Note: This workshop is best suited for engineers who are already familiar with how useMemo() and memo() work – but want to get better at using the performance tools around React. Also, we’ll be covering interaction performance, not load speed, so you won’t hear a word about Lighthouse 🤐)
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 Kuznetsov
Mikhail Kuznetsov
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.
Next.js 13: Data Fetching Strategies
React Day Berlin 2022React Day Berlin 2022
53 min
Next.js 13: Data Fetching Strategies
Top Content
WorkshopFree
Alice De Mauro
Alice De Mauro
- Introduction- Prerequisites for the workshop- Fetching strategies: fundamentals- Fetching strategies – hands-on: fetch API, cache (static VS dynamic), revalidate, suspense (parallel data fetching)- Test your build and serve it on Vercel- Future: Server components VS Client components- Workshop easter egg (unrelated to the topic, calling out accessibility)- Wrapping up
Monitoring 101 for React Developers
React Summit US 2023React Summit US 2023
107 min
Monitoring 101 for React Developers
Top Content
WorkshopFree
Lazar Nikolov
Sarah Guthals
2 authors
If finding errors in your frontend project is like searching for a needle in a code haystack, then Sentry error monitoring can be your metal detector. Learn the basics of error monitoring with Sentry. Whether you are running a React, Angular, Vue, or just “vanilla” JavaScript, see how Sentry can help you find the who, what, when and where behind errors in your frontend project. 
Workshop level: Intermediate
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.