BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Rspack Releases Version 1.7: Final 1.x Update Before 2.0 Transition

Rspack Releases Version 1.7: Final 1.x Update Before 2.0 Transition

Listen to this article -  0:00

Rspack, the Rust-based web bundler designed as a high-performance alternative to webpack, has released version 1.7, marking the final minor release in the 1.x series before the project transitions to version 2.0. The release focuses on stabilizing existing features and improving plugin compatibility.

Rspack 1.7 introduces several stabilizing improvements, including enhanced SWC plugin compatibility, native support for importing assets as bytes, and the solidifying of multiple experimental features. The release also brings lazy compilation enabled by default for dynamically imported modules in web applications.

A new feature in Rspack 1.7 is improved SWC plugin compatibility. In previous versions, SWC Wasm plugins faced high upgrade costs due to the evolving AST structure, causing existing plugins to break after SWC upgrades. To address this, the Rspack team contributed compatibility improvements to the SWC community, including adopting the cbor serialization scheme to replace the version-sensitive rkyv, and introducing an Unknown variant for enum types in the AST to improve fault tolerance. From Rspack 1.7 onwards, SWC upgrades are unlikely to break existing plugins built with older SWC versions.

Rspack now natively supports the Import Bytes proposal for importing assets as bytes. Developers can import assets as Uint8Array and decode them with TextDecoder. The syntax follows the standard import with attributes pattern:

import fileBytes from './file.bin' with { type: 'bytes' };
const decoder = new TextDecoder('utf-8');
const text = decoder.decode(fileBytes);

Starting from Rspack 1.7, the Rspack CLI enables lazy compilation by default for dynamically imported modules when building web applications. This change reduces the number of modules in the initial build, thereby speeding up dev server startup. Developers with special requirements can explicitly disable this feature by setting lazyCompilation to false.

Several experimental features have been stabilized in this release. Constant inlining optimization is now stable and enabled by default in production builds, with the original experiments.inlineConst option deprecated in favor of optimization.inlineExports. TypeScript enum inlining optimization and type re-export checks have also moved to stable status, with their respective experimental flags deprecated.

Migrating to Rspack 1.7 requires attention to SWC plugin versions. Projects using SWC Wasm plugins must upgrade plugins to be compatible with swc_core version 54 or above, to avoid build failures. The Rspack team provides guidance in their FAQ documentation for handling SWC plugin version mismatches.

Rspack positions itself as a webpack-compatible alternative with significantly faster build times. A user on Medium documented achieving a 70% reduction in build time after migrating from webpack to Rspack, with local builds dropping from 1.7 minutes to 30 seconds. Another team at Mews reported cutting startup time from three minutes to ten seconds, representing an 80% improvement. However, benchmarks from the Rolldown project show that while Rspack outperforms webpack, it remains slower than tools like esbuild and Rolldown.

The release also brings updates to the broader Rstack ecosystem, with Rsbuild 1.7 introducing runtime error overlays and asset size diff reporting, Rsdoctor 1.4 adding a new treemap view for bundle analysis, and Rslib 0.19 stabilizing ESM output in bundle mode.

Rspack is an open-source project developed by ByteDance. The tool aims to provide webpack-level API compatibility while delivering Rust-powered performance improvements, making it suitable for teams seeking faster builds without abandoning the webpack ecosystem.

About the Author

Rate this Article

Adoption
Style

BT