Native code build tools now dominate for TypeScript or JavaScript projects
Vite 8.0 has been released, and it uses Rust-built Rolldown as its single bundler, replacing both esbuild and Rollup, to enable faster builds.
Vite is both a development server and a build tool for TypeScript and JavaScript applications, with support for hot module replacement (HMR), which updates code without a full page reload, and plugins to add functionality such as framework-specific features.
Vite can be used with many frameworks and, according to the introductory post for version 8.0, is currently downloaded 65 million times a week.
Rolldown is intended to be compatible with existing plugins since it supports the same plugin API.
Although it is included with Vite 8, the Rolldown project still has release candidate status, and its minification feature – where source code is reduced to a small size with strategies such as the smallest possible variable names – is in alpha.
Rolldown is built on top of Oxc, also coded with Rust.
Oxc is a utility whose features include linting, formatting, parsing, transpiling TypeScript and JSX (code to define React elements), module resolution, and minification.
The Vite team claims that Rolldown is "10-30x faster than Rollup," and matches the performance of esbuild, which is also native code, though written in Go.
Additional new features in Vite 8.0 include new DevTools for build analysis and debugging (provided that Rolldown is used), Wasm support in SSR (server-side rendering) environments, and forwarding of browser console logs to the dev server terminal.
Future plans include a full bundle mode, where modules are bundled during development as well as for production.
Fast build times make this more practical.
"Preliminary results show 3x faster dev server startup, 40 percent faster full reloads, and 10x fewer network requests," said the team.
Early reaction to Vite 8.0 is positive, mainly because of faster build times.
"We saw 12m -> 2m on one of our biggest projects," said one user.
The TypeScript project is also turning to native code for its compiler (tsc) in the forthcoming TypeScript 7.0, using the Go language, with Microsoft's Anders Hejlsberg, the inventor of TypeScript, claiming more than 10x performance gains.
The awkward question: if the use of native code tools brings such a big benefit to TypeScript and JavaScript projects, should developers also reconsider using an interpreted language for the project code itself if running outside the browser?
Visual Studio Code, the most popular IDE, is written in TypeScript and uses the Electron framework, but is slower and uses more memory than native code editors such as Zed or Notepad++.
®
Related Stories
Source: This article was originally published by The Register
Read Full Original Article →
Comments (0)
No comments yet. Be the first to comment!
Leave a Comment