BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Rspack 1.0 Released, 23x Faster than Webpack, Compatible with Top 50 Webpack Plugins

Rspack 1.0 Released, 23x Faster than Webpack, Compatible with Top 50 Webpack Plugins

Rspack, a new JavaScript bundler that strives to be fully compatible with Webpack, is now production-ready. Rspack 1.0 is compatible with 40+ of the top 50 Webpack plugins. 

Rspack credits Rust for its performance and touts a 23x build time improvement over Webpack. The company behind Rspack, ByteDance, mentions saving millions in CI costs.

ByteDance released Rspack 1.0 18 months after its first public version. ByteDance uses Rspack in applications like TikTok, Douyin, Lark, and Coze. ByteDance claims enterprise users like Microsoft, Amazon, and Discord are adopting it, although the number of their products using it hasn’t yet been revealed.

The Rspack name reveals two primary design decisions: it’s written in Rust and is compatible with Webpack. The migration guide shows how Rspack shares the configuration with Webpack, simplifying the migration process.

Rspack claims to be compatible with 80% of the top 50 most downloaded Webpack plugins. The Module Federation plugin, used by many firms in the enterprise segment as part of the micro-front-end architecture, has been detached from Webpack. Module Federation 2.0 is backwards compatible and supported by Rspack 1.0. 

When running the Turbopack's bench cases (of 1,000 React components), Rspack finishes a production build in 282 ms, while Webpack 5 with Babel does it in 6523 ms (23x slower). The Rspack team also credits Rust for achieving lower start-up time. One Reddit developper mentions the ability of Rust to tap into multi-core CPUs as an additional source of performance improvement:

Highly parallelized architecture: webpack is limited by JavaScript's weak support for multithreading. By contrast, Rspack's native code takes full advantage of modern multi-core CPUs.

Some developers independently claimed to do a production build in 8.1s, while Webpack took 19.1s (2.35x slower). In a later update, they refer to the known Rspack performance bottlenecks in the documentation, explaining that plugins such as postcss-loader or html-webpack-plugin can affect Rspack performance.

Rust-based bundlers improve the performance and speed of JavaScript development, allowing for faster releases and reduced CI costs. Zackary Jackson, creator of the Module Federation plugin, Module Federation 2.0, and now an infrastructure architect in the Web Infrastructure Team from Bytedance, claims that using Rspack saves a huge amount of money in infrastructure costs.

We will NEVER monetise rspack or its family of tools. They are free and open. For all time, always. The ROI of just using them for ourselves is in the hundreds of millions.

Rust's impact on cost reduction is not exclusive to the JavaScript ecosystem. AWS uses it in multiple projects, helping the company improve efficiency and achieve its sustainability goals. 

The experiments sections of the Rspack website provide a glimpse of what’s next. Features include compatibility with Top Level Await, the stage 4 TC39 feature, or compilation improvement by only building the accessed entry points. The Rspack team has other elements in the roadmap, such as faster hot module reloading (HMR), TypeScript-based optimisation, or support for React Server Components.

Rspack 1.0 is one of the products created by the ByteDance Web Infra team, alongside Rsbuild, Rspress, Rsdoctor, and Rslib. This release also introduced a brand-new website and improved the existing documentation. 
 

About the Author

Rate this Article

Adoption
Style

BT