Vite 5.0 Deprecates CJS and Announces Rolldown

Vite 5.0 Deprecates CJS and Announces Rolldown

Newsletter

The release of Vite 5.0 includes Rollup 4 upgrade, CJS deprecation, and preparations for the new Rust port of Rollup called Rolldown.


JSJam Live, Wednesday at 12pm PT

  • Next week on JSJam Live, we'll be having another open mic discussing the JavaScript news on the week. In addition to JS news, we'll likely spend a bit of time explaining the still ongoing historic meltdown at OpenAI.
  • Last time on JSJam Live, Dev Agrawal and Rishi Raj Jain joined us to give a debrief on all the news announced during Next.js Conf. The conversation included a deep dive on the new experimental Partial Prerendering feature.

Story of the Week - Vite 5.0 Release

Vite, the popular JavaScript build tool and development server for web applications recently released their 5th major version a year after the release Vite 4.

The project has been seeing increasingly more npm downloads and overall growth in the ecosystem. The list of frameworks that have adopted Vite now includes Astro, Nuxt, SvelteKit, Solid Start, Qwik City, RedwoodJS, and Remix.

Rolldown Ports Rollup to Rust

Evan You's presentation at ViteConf introduced the long-term plan to work on Rolldown, a Rust-port of Rollup with compatible APIs. This initiative aims to enhance build performance and reduce inconsistencies between development and production environments. Rolldown is currently in the early stages of development, with plans to open source the codebase.

Migration Guide

Some of the key changes in Vite 5 that are highlighted in the Migration Guide include:

  • Node.js Support: Vite 5 drops support for Node.js versions below 18, requiring Node.js 18 or higher.
  • Performance: Vite 5 brings build performance improvements through the upgrade to Rollup 4. There is also a new server.warmup option to improve dev server startup time by pre-transforming commonly used modules.
  • Migration: Most projects should have a smooth migration path to Vite 5. But the article advises reviewing the migration guide as there are some breaking changes like the removal of deprecated APIs.
  • Rollup 4 Upgrade: The upgrade brings breaking changes from Rollup 4 itself like import assertions rename and removal of support for Acorn plugins.
  • Deprecation of CJS Node API: The CommonJS API to import Vite is now deprecated in favor of ESM syntax. Projects will have to update to use ESM imports.

Join the Vite Community

In the release announcement, users are encouraged to get involved in the Vite community, contribute to the project, and provides resources for contributing, such as:

Podcasts of the Week

One More Thing

Dylan Pierce from Pipedream (who previously dropped in as a guest on JSJam Live) joined the show to explain how to use Pipedream's AI plugin to scrape and analyze web data:

JavaScript Jam on the Web

Find us online at the following links: