Nuxt 3 Modules and Open-Source

Rate this content
Bookmark
Nuxt modules are powerful tools that extend Nuxt.js core functionalities, providing endless integrations. They can be used for various purposes, such as creating a PWA or connecting to a CMS. The video discusses how to create custom modules using Nuxt3 CLI, which simplifies the process of initializing a module, installing dependencies, and setting up the project. The runtime directory is highlighted as a convention for injecting assets like stylesheets and components. The talk also emphasizes the benefits of learning Nuxt modules, including a deeper understanding of Nuxt internals and easier troubleshooting. The Nuxt community is welcoming to newcomers and encourages contributions. Key points include the importance of abstracting code for large projects, the ease of creating modules with Nuxt3, and the significant role of modules in the Nuxt ecosystem. The speaker shares their favorite module, Nuxt Prismic, and discusses the community's focus on avoiding breaking changes. The video mentions that Nuxt is compatible with Vue 2 in Nuxt 2 and Vue 3 in Nuxt 3.

From Author:

Nuxt modules are the de-facto way of extending our Nuxt applications with new behaviors and functionalities. Have you ever built your own? Why would you bother with hundreds of modules already out there? Let's answer those questions together and see why making your own modules in Nuxt 3 can both help you have a deeper understanding of how Nuxt works while also paving the way for you to get into open source!

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

FAQ

Nuxt.js had 2 million downloads over the last 30 days.

Vue.js had 16 million downloads over the last 30 days.

14 million represents the total number of downloads of Nuxt.js modules over the last 30 days.

A Nuxt module is an extension for Nuxt.js that can extend its core functionality and provide endless integrations. It can be used to add features like making a Nuxt website a PWA or integrating with a CMS.

Nuxt modules are registered inside the Nuxt config file. They can be a package name you have installed, a local module, or the module code directly. Options can be provided using direct syntax or specific config keys.

Creating your own Nuxt module allows you to abstract code from different projects and share it. This is useful for agencies making websites for others or enterprises managing different internal applications. It also facilitates integration with specific tools you use.

Nuxt modules are commonly used for making websites PWA, integrating with CMS, managing meta headers, transforming Nuxt in a particular way, or outputting statistics throughout a project.

The best way to get started with creating a Nuxt 3 module is to use the Nuxt3 CLI. You can bootstrap a Nuxt module, install dependencies with your preferred package manager, and start developing your module.

The runtime directory is a convention for providing any kind of assets that a Nuxt module might inject, such as stylesheets, view components, composables, or 3D modules.

Learning how to create Nuxt modules gives you a deeper understanding of Nuxt internals and behaviors, allows you to troubleshoot issues more easily, and empowers you to contribute to the ecosystem. It also helps you understand the modules you use better.

Lucie Haberer
Lucie Haberer
31 min
12 May, 2023

Comments

Sign in or register to post your comment.

Video Transcription

Available in Español: Módulos Nuxt 3 y Código Abierto

1. Introduction to Nuxt.js Modules

Short description:

Let's start with some numbers. Nuxt.js had 2 million downloads in the last 30 days, while Vue.js had 16 million. Nuxt.js modules had a total of 14 million downloads. Nuxt.js modules are a central part of Nuxt and I will talk about them today.

Hi, Vue JS Live, thank you for having me. And let's start with some numbers, shall we? So what do you think 2 million refers to? Well, I gave you that one, that's the number of downloads Nuxt.js had over the last 30 days. What can 16 million be, then? Well, you probably saw that one coming, that's the number of downloads Vue.js itself had over the last 30 days. So all right, Vue is 16 million, Nuxt is 2 million. What can 14 million be in that story? Must be something big. Well, turns out that's the number of downloads Nuxt.js modules all together had over the last 30 days. Interesting stat, huh? Well, this can only mean two things. First of all, like maybe one person installed 14 million modules over the last 30 days, or that on average, every Nuxt.js project uses 7 modules. Math cannot figure out which one is true. But, well, to me, this definitely means that Nuxt.js modules are a central part of Nuxt. And I'd like to talk to you about them today. So let's talk about Nuxt.js modules. We'll see what they are about, how you can make some, but also more importantly, why you'd like to make some. And finally, we'll see how they can help you to get involved and get started with open source thanks to Nuxt.js modules. So let's talk about that.

2. Introduction and Interactive Element

Short description:

I'm Lucie Aberer, a developer experience engineer at Prismic. I'm also a proud Nuxt contributor and core team member. In this talk, I want to make it interactive by prompting you about writing Nuxt modules. Let's see if you've ever written one!

But, well, first of all, I'm Lucie Aberer, I'm from France, as you probably guessed from my accent. I started my developer journey working with MediaWiki, the software Wikipedia run on. But nowadays, I'm working at Prismic as a developer experience engineer. I'm having fun at Prismic managing its company, open source ecosystem, and Prismic is a CMS and page builder.

Finally, I'm a proud Nuxt contributor and core team member. I've been working with Nuxt for almost six years now, so you start to see the link with this talk. But anyway, enough with chatting, let's get to the talk.

And I want to try something a bit with this talk to make it interactive. Just a bit, don't worry. So I built this thing that works like a cart, except there's not music, but basically it allows me to prompt you about something. And the first thing I like to prompt you about is have you ever written a Nuxt module? So please grab your smartphone and scan one of the QR codes to submit your answer, alternatively you can just follow the links if you're on a laptop, and, well, let's see what it's about.

QnA

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

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.
Making Magic: Building a TypeScript-First Framework
TypeScript Congress 2023TypeScript Congress 2023
31 min
Making Magic: Building a TypeScript-First Framework
Top Content
Daniel Rowe discusses building a TypeScript-first framework at TypeScript Congress and shares his involvement in various projects. Nuxt is a progressive framework built on Vue.js, aiming to reduce friction and distraction for developers. It leverages TypeScript for inference and aims to be the source of truth for projects. Nuxt provides type safety and extensibility through integration with TypeScript. Migrating to TypeScript offers long-term maintenance benefits and can uncover hidden bugs. Nuxt focuses on improving existing tools and finds inspiration in frameworks like TRPC.
Building a Better Hammer - The Story of Nuxt 4
Vue.js Live 2024Vue.js Live 2024
28 min
Building a Better Hammer - The Story of Nuxt 4
Nuxt is a framework for building web apps using Vue and Nitro, driven by a vibrant open source community. Nuxt 4 aims to make the framework more usable and extensible, while focusing on collaboration rather than competition. The modules ecosystem and pluggable architecture enhance Nuxt's functionality and customization options. Nuxt prioritizes user choice and aims for stability and reliability. Nuxt 4 introduces thoughtful breaking changes and is eagerly anticipated by the community.
How to Build Your Own Open Source Project
React Advanced Conference 2022React Advanced Conference 2022
16 min
How to Build Your Own Open Source Project
Hello my friend, in this talk, I wanna share with you how to build your own open source project. Building an open source software project can be challenging. I receive a lot of things randomly in a day, like thank you messages for making my life easier, which motivates me. To choose an open source project to work on, pick one you use every day. Your software is being used when people report issues and send pull requests.
Image Optimization - Quick Win for Improving Performance in Vue & Nuxt Apps
Vue.js London 2023Vue.js London 2023
31 min
Image Optimization - Quick Win for Improving Performance in Vue & Nuxt Apps
Top Content
Image optimization is crucial for website performance and user experience. Services like IPX and Cloudinary can help optimize images on the fly. Cloudinary offers additional functionalities and transformations for image management. Lazy loading and the lazy pattern can improve website performance by deferring image loading. Optimized images deliver a better user experience. Fallbacks can mitigate the impact of service failures.
Lessons from Maintaining TypeScript Libraries
TypeScript Congress 2022TypeScript Congress 2022
30 min
Lessons from Maintaining TypeScript Libraries
Top Content
Mark Erickson, a Senior Frontend Engineer at Replay, discusses JavaScript libraries and their support for TypeScript, including migration, versioning, and debugging. He also explores the challenges of supporting multiple TypeScript versions and designing APIs for use with TypeScript. Additionally, he shares advanced Redux type tricks and insights into maintaining a TypeScript library. The poll results reveal the widespread usage of TypeScript among developers, with many gradually migrating their codebases. Lastly, he provides tips for upgrading TypeScript and verifying functionality.

Workshops on related topic

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.
Node.js: Landing your first Open Source contribution & how the Node.js project works
Node Congress 2023Node Congress 2023
85 min
Node.js: Landing your first Open Source contribution & how the Node.js project works
Workshop
 Claudio Wunder
Claudio Wunder
This workshop aims to give you an introductory module on the general aspects of Open Source. Follow Claudio Wunder from the OpenJS Foundation to guide you on how the governance model of Node.js work, how high-level decisions are made, and how to land your very first contribution. At the end of the workshop, you'll have a general understanding of all the kinds of work that the Node.js project does (From Bug triage to deciding the Next-10 years of Node.js) and how you can be part of the bigger picture of the JavaScript ecosystem.

The following technologies and soft skills might be needed):
  - Basic understanding of Git & GitHub interface
  - Professional/Intermediate English knowledge for communication and for allowing you to contribute to the Node.js org (As all contributions require communication within GitHub Issues/PRs)
  - The workshop requires you to have a computer (Otherwise, it becomes difficult to collaborate, but tablets are also OK) with an IDE setup, and we recommend VS Code and we recommend the GitHub Pull Requests & Issues Extension for collaborating with Issues and Pull Requests straight from the IDE.

The following themes will be covered during the workshop:
- A recap of some of GitHub UI features, such as GitHub projects and GitHub Issues
- We will cover the basics of Open Source and go through Open Source Guide
- We will recap Markdown
- We will cover Open Source governance and how the Node.js project works and talk about the OpenJS Foundation
  - Including all the ways one might contribute to the Node.js project and how their contributions can be valued
- During this Workshop, we will cover Issues from the nodejs/nodejs.dev as most of them are entry-level and do not require C++ or deep technical knowledge of Node.js.
  - Having that said, we still recommend enthusiast attendees that want to challenge themselves to "Good First Issues" from the nodejs/node (core repository) if they wish.
  - We're going to allow each attendee to choose an issue or to sit together with other attendees and tackle issues together with Pair Programming through VS Code Live Share feature
    - We can also do Zoom breakrooms for people that want to collaborate together
  - Claudio will be there to give support to all attendees and, of course, answer any questions regarding Issues and technical challenges they might face
  - The technologies used within nodejs/nodejs.dev are React/JSX, Markdown, MDX and Gatsby. (No need any knowledge of Gatsby, as most of the issues are platform agnostic)
- By the end of the Workshop, we'll collect all (make a list) the contributors who successfully opened a Pull Request (even if it's a draft) and recognise their participation on Social media.