How Vite Changes the Game for Vue and Web Developers

Rate this content
Bookmark

In this talk you will learn what Vite is, why it is so great, and why you want to use it ASAP. You will also learn how to use Vite with Vue.js or React, and what Vitepress is and how to use it.

Alex Kyriakidis, founder of Vue School, will also answer the most frequently asked questions around Vite, including production use, Vite and test runners, what it means for Nuxt, and many more.

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

FAQ

Vue School is the first training platform for Vue.js, founded in 2016. It provides over 500 video lessons, many of which are available for free, including all fundamental courses.

Vue School offers video courses, tutorials, and workshops, which are available both in person and online. Workshops are designed to be intensive, hands-on, and can typically be completed in a day or two.

Vue School provides consulting and development services for companies, specializing in improving performance and fixing bugs.

Vite is a front-end build tool designed to improve the development experience by making it faster. It consists of a dev server and a build command, leveraging modern technologies like ESBuild and Rollup to enhance speed and efficiency.

Vite's dev server uses the browser's native ES modules feature, allowing code to be served directly without bundling. This setup starts the server in less than 300 milliseconds and supports hot module replacement in less than 100 milliseconds.

Yes, Vite is framework agnostic and can be used with various JavaScript frameworks like React, Preact, Svelte, and more. It provides a fast development environment regardless of the framework used.

VitePress is a static site generator built on top of Vite, designed for creating fast and lightweight documentation and blogs. It is not limited to Vite projects and can be integrated into any JavaScript project.

Yes, Vite is ready for production. The stable version, Vite 2.0, was released in February 2021 and includes features that support both modern and legacy browsers.

It is likely that Vite will be integrated into Vue CLI as its underlying build tool, replacing the current Webpack setup in the future.

Alex Kyriakidis
Alex Kyriakidis
22 min
21 Oct, 2021

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Vue School offers free training material, workshops, and consulting services. Vite is a game-changer for Vue and web development, significantly improving the development experience. It leverages the browser's native ES modules feature and uses ESBuild. Vite's dev server is much faster than other bundlers. Vite provides a blazing fast development environment for various frameworks and supports server-side rendering and static site generation. Vite is ready for production and likely to be used by Vue CLI in the future.

1. Introduction to Vue School and Vite

Short description:

Hello Vue London! I am Alex Kyriakides, the author of The Majesty of Vue.js. I have contributed to Vue.js and founded Vue School. We offer free training material, workshops, and consulting services to improve performance and fix bugs.

Hello Vue London! I hope you're enjoying the conference. I am Alex Kyriakides. I'm the author of the first book on Vue.js called The Majesty of Vue.js which I wrote when Vue.js was version 0.something. And over the years I have contributed to Vue.js and the ecosystem. And I'm the founder and teacher at Vue School. I'm based in Amsterdam and you can find me on Twitter and GitHub under the username of hoodlicks.

Vue School is the first training platform for Vue.js. We started back in 2016. And we have over 500 video lessons. And since we offer a lot of training material for free, we have all the fundamental courses for free. We have over 120,000 registered users. And these amazing people that you see here, they work with Vue School either as instructors and teachers or as contributors. At Vue School, besides video courses and tutorials, we do workshops, which are either in person or online in our virtual classroom. And workshops is a great form of training for learning something, a new technology or a new topic, very quickly, typically in a day or two. And all our workshops are live, intensive and hands-on. For companies, we help them by providing consulting and development services. And we are particularly good with helping improving performance and with fixing nasty bugs. So, if you need any help with that, feel free to let us know.

2. Vite: A Game-Changer for Vue and Web Development

Short description:

Today, I will talk about how Vite changes the game for Vue and web development. Vite is a new front-end build tool that significantly improves the development experience. It consists of a dev server that saves code directly in the browser, making it incredibly fast. Vite leverages the browser's native ES modules feature and uses ESBuild for features not yet supported by modern browsers.

Now, today, I am going to speak to you about how Vite changes the game for Vue and web development. In this talk, I will cover what is Vite, why Vite is so great and why all the fuzz, how to use Vite with Vue or even React, what is VitePress, and in the end of the talk, I will answer some of the frequently asked questions, like, for example, what's happening with Vite and Nuxt.js. If you are interested in the technical insights, check out this excellent talk by Evan Yu from Vue Toronto. Here he covers a lot of information on how Vite is built, why it is built this way, why they made it. It's a very interesting talk. I definitely recommend checking it out.

OK, so let's get started with what is Vite. Vite is a new front-end build tool that significantly improves the front-end development experience. And what is Vite's goal? It is to make developers more productive. And how do you make developers more productive? By making developers happier. And how do you make developers happier? By making their tools faster. That is a quote from Evan Hugh, the creator of Vite. But, OK, what is Vite exactly? Vite is a command line tool that consists of two parts, a dev server and a build command that bundles your code with Rollup for production. The dev server is the tool that you use while you're developing your application. And as you understand, the build command is what you run when you are ready to ship it.

Let's learn more about Vite's dev server. Now, while you develop with Vite, your code is saved in your browser directly without being bundled. And that's what makes the Vite dev server so fast. It is like opening your local files from your computer in your browser. To understand how Vite's dev server look like, think of it as UCLI, but way faster. When we say way faster, we really mean it. The Vite dev server starts in less than 300 milliseconds, and the hot module replacement takes place in less than 100 milliseconds. And Vite achieves that by leveraging the browser's native ES modules feature. In this image, you can see that all the major browsers, here, they support ES modules in their latest version. And this is also one of the reasons that we get an awesome tool like Vite today and not like a few years back, because we needed to wait for modern browsers to evolve and support features like this one in order to make our developer experience faster and nicer. Now, for features that Vite needs, but modern browsers don't support yet, Vite uses a tool called ESBuild. And it uses ESBuild for supporting bare imports, for implementing the hot module replacement, and for having support for tools like Typescript or JSX. I didn't know of ESBuild before I look into the Vite Dev server, and I figured that it is written in Go and it compiles to native code. And that it uses parallelism heavily. And I found this benchmark very interesting, and you can see here that ESBuild is able to bundle or to compile a large JavaScript code base in 0.3 minutes, a JavaScript code base in 0.37 seconds.

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

Vite: Rethinking Frontend Tooling
JSNation Live 2021JSNation Live 2021
31 min
Vite: Rethinking Frontend Tooling
Top Content
Vite is a next-generation build tool that leverages native ES modules for improved performance. It eliminates the need for bundling and improves hot module replacement. Vite provides an opinionated default configuration while still allowing advanced customization through plugins. It is framework agnostic and can be used for React and other applications. Vite is being adopted by Next.js and Create React App, and integration with Nuxt 3 offers significant speed improvements.
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.
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.
Utilising Rust from Vue with WebAssembly
Vue.js London Live 2021Vue.js London Live 2021
8 min
Utilising Rust from Vue with WebAssembly
Top Content
In this Talk, the speaker demonstrates how to use Rust with WebAssembly in a Vue.js project. They explain that WebAssembly is a binary format that allows for high-performance code and less memory usage in the browser. The speaker shows how to build a Rust example using the WasmPack tool and integrate it into a Vue template. They also demonstrate how to call Rust code from a Vue component and deploy the resulting package to npm for easy sharing and consumption.
Vue: Feature Updates
Vue.js London 2023Vue.js London 2023
44 min
Vue: Feature Updates
Top Content
Watch video: Vue: Feature Updates
The Talk discusses the recent feature updates in Vue 3.3, focusing on script setup and TypeScript support. It covers improvements in defining props using imported types and complex types support. The introduction of generic components and reworked signatures for defined components provides more flexibility and better type support. Other features include automatic inference of runtime props, improved define emits and defined slots, and experimental features like reactive props destructure and define model. The Talk also mentions future plans for Vue, including stabilizing suspense and enhancing computer invalidations.

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 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
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.
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
Building Vue forms with VeeValidate
Vue.js London Live 2021Vue.js London Live 2021
176 min
Building Vue forms with VeeValidate
Workshop
Abdelrahman Awad
Abdelrahman Awad
In this workshop, you will learn how to use vee-validate to handle form validation, manage form values and handle submissions effectively. We will start from the basics with a simple login form all the way to using the composition API and building repeatable and multistep forms.

Table of contents:
- Introduction to vee-validate
- Building a basic form with vee-validate components
- Handling validation and form submissions
- Building validatable input components with the composition API
- Field Arrays and repeatable inputs
- Building a multistep form
Prerequisites:
VSCode setup and an empty Vite + Vue project.