Skip to content
CAI
Software that uses CAICheck a score

web-infra-dev/rspack

58.3

Adequate · 29 September 2026

324.6k

lines of production code

Rust

with TypeScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Rspack is a high-performance JavaScript bundler written in Rust, designed to serve as a fast, webpack-compatible alternative for modern web development. It provides a comprehensive build pipeline that handles module resolution, code splitting, and asset management, while exposing a native plugin system and JavaScript bindings for deep customization. The system emphasizes incremental compilation and persistent caching to optimize rebuild speeds, supporting advanced features like React Fast Refresh, CSS extraction, and tree shaking.

How it got here

2022–2023 — Rust core implementation and plugin migration

89 changes.

This period focused on rewriting the Rspack bundler's core engine in Rust, replacing JavaScript-based components for the compiler, plugin system, and runtime with native implementations. It established the foundational architecture for incremental builds, caching, and dependency tracking while porting essential Webpack-compatible features like module federation, HMR, and various asset plugins.

2024–2025 — Incremental compilation and plugin infrastructure

120 changes.

This period focused on establishing the core infrastructure for incremental compilation and a robust plugin system, introducing the rspack\_hook and rspack\_cacheable crates to manage staged execution and persistent caching. Significant architectural shifts included rewriting the split-chunks algorithm, restructuring the JavaScript dependency parser, and implementing a comprehensive N-API binding layer to bridge Rust core logic with JavaScript. These changes were supported by the addition of numerous new plugins for features like CSS extraction, lazy compilation, and DLL support, alongside extensive end-to-end testing to validate the new build behaviors.

2026 — RSC plugin and persistent cache implementation

54 changes.

This period focused on introducing the React Server Components (RSC) plugin and a new persistent cache system with filesystem and memory layers. The work included implementing core RSC infrastructure, granular cache configuration options, and a new module resolution crate, alongside significant test coverage and internal performance optimizations.

Features

AMD parser plugin implementation

The AMD parser plugin has been implemented to support Asynchronous Module Definition syntax. This change introduces new parser plugins (\AMDDefineDependencyParserPlugin\, \AMDParserPlugin\, and \AMDRequireDependenciesBlockParserPlugin\) that handle \define\ and \require\ calls, including array-based dependencies, context resolution, and reserved parameter names like \require\, \module\, and \exports\. Users relying on AMD modules will now have their dependencies correctly parsed and bundled.

_crates/rspack\_plugin\_javascript/src/parser\_plugin/amd, crates/rspack\_plugin\_real\_content\hash · high confidence

Add AMD module dependency support

This change introduces the core dependency structures and code-generation templates for AMD (Asynchronous Module Definition) modules within the JavaScript plugin. It adds new dependency types including AMDDefineDependency, AMDRequireDependency, AMDRequireArrayDependency, AMDRequireItemDependency, and LocalModuleDependency, along with their corresponding templates. These components enable the bundler to parse, track, and emit code for AMD-style module definitions and require calls, laying the groundwork for full AMD module format support.

_crates/rspack\_plugin\javascript/src/dependency/amd · high confidence

Add AMD, System.js, and JSONP library output targets

This change introduces new library output targets for AMD, System.js, and JSONP formats. The AMD plugin now supports the \amd-require\ wrapper mode and correctly handles external dependencies. The System.js plugin implements the \System.register\ format, including proper handling of external modules and dynamic exports. The JSONP plugin wraps the output in a named function call, enabling JSONP-based library distribution. These additions expand the available output formats for library builds.

_crates/rspack\_plugin\library · high confidence

Add Hot Module Replacement dependency implementations for ESM and CommonJS

This change introduces the JavaScript-side dependency structures and code-generation templates required for Hot Module Replacement (HMR). It adds \ESMAcceptDependency\ to handle \module.hot.accept\ for ESM modules, including runtime condition checks and import statement generation, alongside \ImportMetaHotAcceptDependency\ and \ImportMetaHotDeclineDependency\ for \import.meta.hot\ support. It also provides \ModuleHotAcceptDependency\ and \ModuleHotDeclineDependency\ for CommonJS-style \module.hot\ APIs. These components enable the bundler to correctly track and update module dependencies during development.

_crates/rspack\_plugin\javascript/src/dependency/hmr · high confidence

Add IgnorePlugin to support module exclusion

Introduces the IgnorePlugin, allowing users to exclude specific modules from the build by matching resource and context paths against regular expressions. The plugin supports an optional \check\_resource\ callback for custom logic to determine whether a module should be ignored, and integrates with both the normal and context module factory before-resolve hooks to filter out matching requests.

_crates/rspack\_plugin\ignore · high confidence

Add Perfetto tracing support for Rspack

Introduces a new \rspack\_tracing\_perfetto\ crate that enables recording Rspack's internal tracing data in Perfetto's protobuf format. This allows users to export detailed build performance traces compatible with the Perfetto UI for visualization and analysis, replacing or supplementing previous tracing outputs.

_crates/rspack\_tracing\perfetto · high confidence

Add Preact Refresh loader for HMR support

This change introduces a new built-in loader (\builtin:preact-refresh-loader\) and its associated plugin to enable Hot Module Replacement (HMR) for Preact applications. The loader injects a runtime script that manages module exports and error recovery during updates, while the plugin handles the resolution of the loader when requested. This allows developers to use Preact with live reloading capabilities in rspack.

_crates/rspack\_loader\_preact\refresh · high confidence

Add Rspack performance optimization skill with local Valgrind measurement

Introduced the \rspack-perf-valgrind-goal\ skill, providing a structured workflow and tooling for optimizing Rspack benchmarks using local Docker-based Valgrind measurements. This includes a \SKILL.md\ defining the optimization loop and invariants, an \openai.yaml\ agent configuration, a pinned Rust/Valgrind Dockerfile, and a \run\_local\_valgrind.sh\ script to build images, prepare fixtures, and execute benchmarks. The skill enables reproducible, local performance validation without relying on CI or external services like CodSpeed.

.agents/skills/rspack-perf-valgrind-goal · high confidence

Add WorkerPlugin to support Web Workers

A new WorkerPlugin has been introduced in the rspack\_plugin\_worker crate. This plugin registers a compilation hook that configures the build to use the normal module factory for dependencies of type NewWorker, enabling the bundling of Web Workers.

_crates/rspack\_plugin\worker · high confidence

Add builder module and crate documentation

The \crates/rspack/src/lib.rs\ file now exposes the \builder\ module and includes comprehensive documentation for the crate. The documentation provides an overview of Rspack as a high-performance JavaScript bundler, usage examples demonstrating how to initialize a \Compiler\ via the \CompilerBuilder\ API with \tokio\, and a list of currently implemented and pending features. This change establishes the public API surface for constructing compilers and sets expectations regarding API stability.

crates/rspack/src · high confidence

Add built-in BannerPlugin for adding comments to output files

Introduces the BannerPlugin, which allows users to prepend or append comment banners to compilation assets. The plugin supports static string banners or dynamic functions that receive context (hash, chunk, filename) to generate content. It includes options to target only entry chunks, place banners at the end (footer), disable comment wrapping (raw), and filter assets using test/include/exclude conditions. The banner content supports filename placeholders like \[hash\], \[chunkhash\], and \[name\].

_crates/rspack\_plugin\banner · high confidence

Add cache serialization support for rspack\_sources::BoxSource

Users can now cache and restore \rspack\_sources::BoxSource\ objects within the rspack cacheable system. This change introduces a new preset (\AsPreset\) in \crates/rspack\_cacheable/src/with/as\_preset/rspack\_sources\ that implements the necessary rkyv serialization and deserialization logic, converting \BoxSource\ instances to and from a \CacheableSource\ format for efficient storage and recovery.

_crates/rspack\_cacheable/src/with/as\_preset/rspack\sources · high confidence

Add case-sensitive module and asset conflict warnings

A new plugin warns users when the build contains modules or output assets whose filenames differ only by letter casing. This helps prevent subtle runtime failures on case-insensitive file systems by detecting conflicts during the compilation seal and asset emission phases.

_crates/rspack\_plugin\_case\sensitive · high confidence

Add compact-hashed and deterministic chunk/module ID plugins

This change introduces new ID assignment strategies for chunks and modules. The \CompactHashedChunkIdsPlugin\ and \CompactHashedModuleIdsPlugin\ generate short, stable IDs based on content hashes, supporting a \minLength\ option to control ID length. Additionally, \DeterministicChunkIdsPlugin\ and \DeterministicModuleIdsPlugin\ provide deterministic ID generation using configurable salts, max lengths, and context, with the module plugin supporting a \test\ filter and conflict handling. These plugins are registered via the \optimization.chunkIds\ and \optimization.moduleIds\ configuration options.

_crates/rspack\ids/src · high confidence

Add portable serialization presets for rspack\_cacheable

The \rspack\_cacheable\ library now includes a new \as\_preset\ module that provides rkyv serialization implementations for various types, enabling portable caching. This includes support for file paths (\camino::Utf8PathBuf\) which are stored as relative paths to ensure cache portability across different machines, as well as string-like types (\SmolStr\, \Ustr\, \rspack\_intern::Atom\, \swc\_core::atoms::Atom\, \Wtf8Atom\) and JSON data (\serde\_json::Value\, \json::JsonValue\, \lightningcss::targets::Browsers\). These presets allow complex build artifacts and configuration data to be serialized into a format that is independent of the specific build environment's absolute paths.

_crates/rspack\_cacheable/src/with/as\preset · high confidence

Add rspack\_resolver crate with enhanced-resolve compatibility and TypeScript support

This change introduces the \rspack\_resolver\ crate, a Rust port of the \enhanced-resolve\ library, providing both synchronous and asynchronous module resolution APIs. It includes built-in support for TypeScript configuration, including \tsconfig\ path aliases, project references, and the \extends\ field, as well as support for Yarn Plug'n'Play, ESM/CJS conditional exports, and the \browser\ field. The crate also adds test fixtures mirroring the \enhanced-resolve\ test suite to ensure compatibility.

_crates/rspack\resolver · high confidence

Add rspack\_tools utility to compare persistent cache directories

A new \rspack\_tools\ binary is introduced to help developers debug and verify cache consistency across different environments or builds. It provides a \compare\ command that takes two cache directory paths and recursively validates that they contain identical data. The tool compares cache scopes including meta information, snapshot strategies, and the full module graph (make occasion), ensuring that module identifiers, dependency relationships, and build information match between the two inputs. This aids in diagnosing cache invalidation issues or verifying that different operating systems or build configurations produce equivalent cached results.

_crates/rspack\tools/src · high confidence

Add support for loading async WebAssembly modules

This change introduces the \rspack\_plugin\_wasm\ crate, which enables the bundling and runtime loading of async WebAssembly modules. It provides a parser and generator to handle \.wasm\ files, extracting exports and imports, and registers the \AsyncWasmPlugin\ to manage compilation and asset generation. The plugin supports multiple loading strategies via the \output.wasmLoading\ configuration: using \fetch\ for web environments, \readFile\ for Node.js (with support for both CommonJS and ES module imports), and a universal fallback that selects the appropriate method at runtime. Runtime modules are injected to handle the actual binary loading and instantiation, ensuring async WebAssembly works across different target environments.

_crates/rspack\_plugin\wasm/src · high confidence

Add testing harness for custom plugin bindings

The \rspack\_binding\_builder\testing\ crate now provides a JavaScript entry point (\binding.js\) that loads platform-specific native modules (e.g., \@rspack/binding-testing-\\) for Android, Windows, macOS, FreeBSD, and Linux (including musl/gnu variants). This enables developers to test custom plugin bindings by registering a test plugin (\BindingBuilderTestingPlugin\) that validates specific options (e.g., expecting \foo\ to equal \bar\) via the \register\_plugin!\ macro, with build scripts and ESM-based tooling (\scripts/build.mjs\) supporting the compilation of these bindings.

_crates/rspack\_binding\_builder\testing · high confidence

Added TypeScript enum and type export collection capabilities

The \swc\_plugin\_ts\_collector\ crate now includes new modules to analyze TypeScript source code for exported enums and type-only exports. The \ExportedEnumCollector\ evaluates enum member values (supporting numeric, string, and simple expression-based initialization) to determine which enums are fully resolvable, while the \TypeExportsCollector\ identifies and tracks type-only exports (such as \export type\, \export { type X }\, and default type exports) to assist in tree-shaking and bundling decisions. These collectors are exposed as public APIs and are validated by snapshot tests covering basic enum merging and various type export patterns.

_crates/swc\_plugin\_ts\collector · high confidence

Added basic React example with debugging output

The examples/basic location now includes a new React example structure. The entry point (src/index.js) imports a library module (src/lib.js), which logs a debugging message ('Debugging Rspack') to the console. This provides a minimal starting point for users to understand the basic setup and observe debugging output.

examples/basic · high confidence

Added export mangling and AST object extraction utilities

This change introduces new utility modules within the JavaScript plugin's utils directory to support export mangling and structured AST parsing. The \mangle\_exports.rs\ module provides algorithms for converting numeric identifiers into compact, minified strings (using lowercase, uppercase, and special characters), enabling smaller bundle sizes for exported names. Additionally, \object\_properties.rs\ adds a \FromAstExpr\ trait and helper functions that allow parser plugins to declaratively extract typed options from AST object literals via a derive macro, simplifying the handling of complex configuration objects during parsing.

_crates/rspack\_plugin\javascript/src/utils · high confidence

Added workspace version reporting for SWC and Rspack packages

The rspack\_workspace crate now exposes the versions of the underlying swc\_core (79.0.0) and @rspack/core (2.2.7) packages via generated constants and public macros. This allows consumers to programmatically determine which versions of these core dependencies are active in the current build environment.

_crates/rspack\workspace · high confidence

Implement eval and eval-source-map devtool modes in Rust

The devtool plugin logic has been rewritten in Rust, introducing new \EvalDevToolModulePlugin\ and \EvalSourceMapDevToolPlugin\ implementations. This adds support for the \eval\ and \eval-source-map\ devtool configurations, enabling inline source maps generated via \eval()\ calls. The implementation includes a \generate\_debug\_id\ utility for creating unique identifiers, \ModuleFilenameHelpers\ for resolving module paths and templates, and caching mechanisms to optimize performance during module rendering.

_crates/rspack\_plugin\devtool/src · high confidence

Introduce @rspack/binding as the internal Node.js native binding layer

The \crates/node\_binding\ directory now contains the internal \@rspack/binding\ package, which exposes the Rust core to JavaScript via NAPI-RS. This change adds the necessary JavaScript glue code (\binding.js\, \binding.d.ts\) to load platform-specific native binaries (\.node\) and WebAssembly modules (\.wasm\) for Node.js and browser environments. It also includes a \build.rs\ script for build-time setup and a \.gitignore\ to exclude generated artifacts, establishing the concrete interface through which the JavaScript compiler communicates with the Rust engine.

_crates/node\binding · high confidence

Introduce CopyRspackPlugin with pattern-based asset copying

Adds the CopyRspackPlugin, enabling users to copy files and directories into the output bundle using configurable patterns. The plugin supports glob matching, custom destination paths (including templates and functions), file permission preservation, content transformation via async functions, and caching for improved rebuild performance.

_crates/rspack\_plugin\copy · high confidence

Introduce ESM library plugin with CommonJS external and dynamic import handling

Adds the experimental EsmLibraryPlugin infrastructure in the ESM library crate, introducing new dependency templates for CommonJS externals and dynamic imports. This change enables the bundler to correctly render CommonJS external dependencies directly in modern ESM output and handles dynamic imports by generating fake namespace objects, ensuring that external CommonJS modules are properly resolved and wrapped when imported dynamically within an ESM library context.

_crates/rspack\_plugin\_esm\library/src/dependency · high confidence

Introduce EnsureChunkConditionsPlugin to manage module-chunk assignments

The new \EnsureChunkConditionsPlugin\ runs during the \optimize\_chunks\ stage to enforce chunk conditions for modules, particularly external modules. It identifies modules that do not meet their chunk conditions and moves them to appropriate chunks by traversing chunk groups, ensuring that modules are only included in chunks where their specific conditions are satisfied.

_crates/rspack\_plugin\_ensure\_chunk\conditions · high confidence

Introduce Lightning CSS Minimizer plugin

Adds the \LightningCssMinimizerRspackPlugin\ to enable CSS minification using the Lightning CSS library. This plugin processes CSS assets based on configurable \test\, \include\, and \exclude\ conditions, and supports advanced options such as browser target compatibility, error recovery during parsing, and handling of draft CSS features like custom media and deep selector combinators.

_crates/rspack\_plugin\_lightning\_css\_minimizer, crates/rspack\_plugin\_merge\_duplicate\chunks · high confidence

Introduce N-API binding crate for rspack

A new \crates/node\_binding\ crate has been added to provide N-API compatible bindings, allowing rspack to be used within Node.js environments. This crate acts as the entry point by re-exporting symbols from the \rspack\_binding\_api\ crate, establishing the bridge between the Rust core and the JavaScript runtime.

_crates/node\binding/src · high confidence

Introduce Node.js binding for module resolution

Added a new N-API module in \crates/rspack\_binding\_api/src/rspack\_resolver\ that exposes the \rspack\_resolver\ library to JavaScript. This binding provides both synchronous (\sync\) and asynchronous (\async\) resolution functions, along with a \ResolverFactory\ for creating and managing resolver instances with configurable options (such as aliases, extensions, and PnP settings). This allows external tooling or the Rspack runtime to perform module resolution directly from Node.js.

_crates/rspack\_binding\_api/src/rspack\resolver · high confidence

Introduce React Server Components (RSC) plugin

This change adds the \rspack\_plugin\_rsc\ crate, implementing the core infrastructure for React Server Components. It introduces a \Coordinator\ to manage the compilation sequence between the Server and Client compilers, ensuring server entries are built before client entries. The plugin includes \RscClientPlugin\ and \RscServerPlugin\ to handle module graph traversal, client reference dependency tracking, and server action entry loading. It also provides a manifest runtime module to generate the RSC manifest (mapping client modules, server actions, and CSS files) and supports configurable CSS link props and module loading prefixes.

_crates/rspack\_plugin\rsc · high confidence

Introduce RemoveDuplicateModulesPlugin to deduplicate shared modules across chunks

A new plugin, RemoveDuplicateModulesPlugin, has been added to the build process to identify and eliminate duplicate module instances across different chunks. The plugin analyzes the module graph to find modules shared by multiple chunks and attempts to reuse an existing chunk that already contains those modules, thereby reducing redundancy in the final output. It includes logic to preserve non-initial entrypoints and optimize chunk splitting to maximize reuse, contributing to smaller bundle sizes.

_crates/rspack\_plugin\_remove\_duplicate\modules · high confidence

Introduce Rslib native plugin for Rspack

Adds the \rspack\_plugin\_rslib\ crate, a native Rspack plugin that provides library-specific build capabilities. It introduces native handling of JavaScript hashbangs and React directives, intercepts specific CommonJS API expressions (like \require.cache\), and treats the \module\ identifier as a normal variable in \typeof\ checks. The plugin also manages external module rendering by cutting out star re-exports, dynamic imports, \new URL\, and Web Workers from the module graph when targeting ESM, and supports emitting isolated TypeScript declaration files (\.d.ts\) via SWC.

_crates/rspack\_plugin\rslib · high confidence

Introduce Rstest plugin for mocking and test-time module resolution

Adds the \rspack\_plugin\_rstest\ crate, implementing a new plugin and parser plugin that enable Rstest-style mocking and test utilities within Rspack. The plugin intercepts ESM imports, dynamic \import()\ calls, and \require.resolve()\ to inject runtime helpers for mocking (e.g., \importActual\, \importMock\, \mock\, \unmock\), hoist mock registrations to ensure correct execution order, and resolve manual mock targets. It also supports \import.meta.dirname\ and \import.meta.filename\ injection, preserves specific URL extensions, and patches runtime chunk loading to guard mock state during module loading.

_crates/rspack\_plugin\rstest/src · high confidence

Introduce SsoHashSet and Ustr-backed Identifier types for performance

The rspack\_collections crate now provides an SsoHashSet, a set implementation that stores up to four elements inline to avoid heap allocation for small collections, and a new Identifier type backed by Ustr (unique string) with precomputed hashes. These types are exposed via the crate's public API to optimize performance for module chunk memberships and identifier lookups by reducing memory allocations and hash computation overhead.

_crates/rspack\collections · high confidence

Introduce Subresource Integrity (SRI) plugin

Adds the \SubresourceIntegrityPlugin\ to automatically generate and apply SRI integrity hashes to JavaScript, CSS, and extracted CSS assets. The plugin computes SHA-256, SHA-384, or SHA-512 checksums, injects them into HTML tags via the HTML plugin integration, and provides runtime hash variables for dynamic script/link injection. It includes safeguards such as skipping external URLs not under the public path, warning when cross-origin loading is disabled, and ensuring compatibility with hot reloading and real content hashing.

_crates/rspack\_plugin\sri · high confidence

Introduce SwcJsMinimizerRspackPlugin for JavaScript minification

Adds the SwcJsMinimizerRspackPlugin, a new plugin that integrates the SWC JavaScript minifier into the build process. This plugin allows users to configure minification options such as ECMAScript version, compression, mangling, and format settings, and supports extracting comments into separate files with customizable banners. It handles JavaScript assets based on configurable test, include, and exclude conditions, and integrates with the caching system to optimize rebuild performance.

_crates/rspack\_plugin\_swc\_js\minimizer · high confidence

Introduce WasmImportDependency for WebAssembly import tracking

Added a new \WasmImportDependency\ struct to handle WebAssembly import dependencies. This dependency tracks the import name and request, implements the necessary \Dependency\ and \ModuleDependency\ traits, and provides referenced export information for the imported name, enabling the bundler to correctly analyze and process WebAssembly module imports.

_crates/rspack\_plugin\wasm/src/dependency · high confidence

Introduce asset module exports dependency for tree shaking

The asset plugin now includes an \AssetExportsDependency\ that explicitly declares a default export for asset modules. This change enables the module graph to correctly identify asset modules as having exports, which is a prerequisite for tree shaking and other optimization passes that rely on export information. Users importing assets will now have their usage tracked more accurately by the bundler's analysis, potentially allowing unused asset imports to be eliminated in future optimization cycles.

_crates/rspack\_plugin\asset/src · high confidence

Introduce built-in ProgressPlugin with customizable display and profiling

Adds a new built-in progress plugin that displays a real-time progress bar during compilation. Users can configure the plugin via \ProgressPluginOptions\, choosing between a default visual display (with customizable prefix, template, tick strings, and progress characters) or a custom handler function. The plugin also supports a \profile\ option to collect timing data for individual progress steps, providing visibility into build performance.

_crates/rspack\_plugin\progress/src · high confidence

Introduce built-in React Refresh loader

A new built-in loader (\builtin:react-refresh-loader\) and its associated plugin have been added to enable React Fast Refresh. The loader injects the necessary runtime hooks (\$RefreshSig$\, \$RefreshReg$\, and the refresh trigger) into module source code, with logic to support both arrow functions and standard function expressions based on the target environment. The plugin automatically resolves requests matching the built-in identifier to this new loader implementation.

_crates/rspack\_loader\_react\refresh · high confidence

Introduce builtin Lightning CSS loader

Adds a new builtin loader (\builtin:lightningcss-loader\) that processes CSS using the Lightning CSS engine. Users can configure the loader via JSON options to enable minification, set browser targets (via browserslist queries or direct values), control error recovery, and enable draft features such as custom media and deep selector combinators. The loader also supports source map generation and integrates with Rspack's caching system.

_crates/rspack\_loader\lightningcss · high confidence

Introduce builtin:swc-loader with React Server Components and TypeScript metadata support

The new \builtin:swc-loader\ replaces the legacy SWC loader, providing a unified compilation path that integrates React Server Components (RSC) transforms, TypeScript metadata collection, and isolated declaration (\.d.ts\) generation. Users benefit from stricter RSC validation (e.g., catching client-only API usage in server components), improved TypeScript enum and type export tracking, and better source map handling. The loader also introduces a \detectSyntax\ option to automatically infer parser settings for virtual modules and enforces that \jsc.target\ and \env\ cannot be used together.

_crates/rspack\_loader\swc · high confidence

Introduce compile-time JavaScript expression evaluation

This change introduces a new compile-time evaluation engine for JavaScript expressions within the JavaScript parser. It enables the bundler to statically analyze and resolve various expression types—including literals, binary operations, template strings, arrays, and unary operators—at build time. This capability allows for more aggressive dead code elimination and constant folding, improving bundle size and build performance by replacing runtime computations with their evaluated results where possible.

_crates/rspack\_plugin\javascript/src/utils/eval · high confidence

Introduce compiler builder with native browserslist target resolution

The compiler builder now supports using a \browserslist\ string as the build target. This change adds a native Rust implementation for parsing browserslist queries and resolving them into specific target properties (such as \web\, \node\, \es6\ features), replacing the previous dependency on external tooling. It also introduces a structured \BuilderContext\ for managing builtin plugin options and a \Devtool\ enum for source map configuration, providing a more robust and type-safe foundation for compiler configuration.

crates/rspack/src/builder · high confidence

Introduce dedicated HMR plugin and runtime module

The Hot Module Replacement functionality is now provided by a new \rspack\_plugin\_hmr\ crate containing a dedicated \HotModuleReplacementPlugin\ and \HotModuleReplacementRuntimeModule\. This plugin registers the necessary dependency factories for HMR accept/decline hooks, captures per-chunk CSS content hashes to enable precise CSS updates, and injects a new runtime template that manages module status, dependency tracking, and hot update application. This change centralizes HMR logic into its own location, separating it from the core runtime and other plugins.

_crates/rspack\_plugin\hmr · high confidence

Introduce dedicated rspack\_hash crate with webpack-compatible content hashing

Rspack now includes a new \rspack\_hash\ crate that provides a stable, webpack-aligned content hashing system for generating asset, chunk, module, and runtime hashes. The crate supports three hash algorithms (xxhash64, MD4, SHA-256) and multiple output digest formats (hex, base64, base64url, base62, base58, base52, base49, base36, base32, base26), along with optional hash salting. It introduces a separate \RspackHash\ trait to ensure hash inputs follow consistent serialization semantics rather than Rust's default \std::hash::Hash\ behavior, and provides implementations for common Rust types (strings, integers, paths, collections, options) as well as Rspack-specific types like \Atom\, \Identifier\, and \AssetCondition\. This change ensures that generated hashes remain consistent across builds and compatible with webpack's content-hash expectations.

_crates/rspack\hash · high confidence

Introduce experimental EsmLibraryPlugin for native ESM library output

Adds the \EsmLibraryPlugin\ crate, providing a new mechanism for bundling libraries as native ESM. This plugin introduces support for \preserveModules\ to maintain the original source file structure in the output, enables \splitChunks\ for library bundles, and handles complex linking scenarios such as top-level await (TLA) shared module extraction, dynamic import deconfliction, and CommonJS interop. It also includes runtime mode rendering (Webpack, Rspack Context, Rspack Export) and parser plugins to correctly identify and handle ESM compatibility and external bindings.

_crates/rspack\_plugin\_esm\library/src · high confidence

Introduce file usage tracking via FileCounter

Added a new FileCounter utility that tracks which modules and dependencies reference specific file paths. This component enables the build system to identify added, updated, and removed files, supporting more accurate incremental compilation and persistent caching by distinguishing between new and modified resources.

_crates/rspack\_core/src/utils/file\counter · high confidence

Introduce incremental rebuild capability for the compiler

The compiler now supports incremental rebuilds via a new \rebuild\ method in \crates/rspack\_core/src/compiler/rebuild.rs\. This change allows the build system to process only changed or deleted files, reusing module executors and leveraging incremental artifacts to optimize performance. The \Compiler\ struct has been expanded to include fields for managing incremental state, such as \IncrementalArtifacts\, \new\_cache\, and \last\_records\, while the legacy \compilation.rs\ file has been removed in favor of this new architecture.

_crates/rspack\core/src/compiler · high confidence

Introduce inner graph for JavaScript dependency analysis

This change introduces the inner graph parser plugin, a new mechanism for tracking symbol usage and dependencies within JavaScript modules. It enables more precise analysis of pure expressions, side effects, and export usage, allowing the bundler to better determine which code paths are active and which can be safely eliminated during optimization.

_crates/rspack\_plugin\_javascript/src/parser\_plugin/inner\graph · high confidence

Introduce isolated compiler context for parallel task execution

Added a new \rspack\_tasks\ crate that provides an implicit, isolated compiler context for parallel compilation tasks. This allows each compiler instance to maintain its own state, such as dependency ID generation and exports info artifacts, without interference from other concurrent tasks. The implementation uses Tokio's task-local storage to propagate this context across spawned tasks, ensuring thread-safe isolation of compiler state during parallel builds.

_crates/rspack\tasks · high confidence

Introduce lazy compilation plugin for deferred module compilation

Adds the \rspack\_plugin\_lazy\_compilation\ crate, which implements a new lazy compilation feature. This plugin introduces a \LazyCompilationPlugin\ that intercepts module creation for dynamic imports and entry points, replacing them with proxy modules (\LazyCompilationProxyModule\) that defer actual compilation until the module is needed at runtime. The implementation includes a \Backend\ trait for managing active modules, a \LazyCompilationDependency\ to track file and context dependencies, and a \LazyCompilationDependencyFactory\ to handle the deferred creation of the actual modules. Users can configure which modules to lazy-compile via regex or custom test functions, and the system supports reserved externals for specific library types like UMD and AMD.

_crates/rspack\_plugin\_lazy\compilation · high confidence

Introduce module info header plugin for export visualization

A new \ModuleInfoHeaderPlugin\ has been added to generate detailed module info headers in the compiled output. This plugin hooks into both JavaScript and CSS compilation processes to render comments that display export information, including export names, provided/used status, rename details, and target module mappings. This provides users with better visibility into module dependencies and export structures directly in the generated code.

_crates/rspack\_plugin\_module\_info\header · high confidence

Introduce new CSS extraction plugin

The \rspack\_plugin\_extract\_css\ crate has been added, implementing a new CSS extraction plugin (\CssExtractRspackPlugin\) that extracts CSS into separate files. This includes a dedicated \CssModule\ and \CssDependency\ type, a parser plugin to process CSS data, and a runtime module (\CssLoadingRuntimeModule\) that handles dynamic CSS chunk loading, Hot Module Replacement (HMR) updates, and supports prefetching and preloading of CSS assets.

_crates/rspack\_plugin\_extract\css · high confidence

Introduce new cache entry types and serialization codec

The cache module now includes specific cacheable entry structures for source map dev tool plugins, minimized assets, and extracted comments, along with a dedicated codec for serializing and deserializing cache data using portable project roots. This enables the system to persist and restore complex asset-related metadata and sources during rebuilds.

_crates/rspack\core/src/cache · high confidence

Introduce new circular dependency detection plugins

Added three new plugins to the \rspack\_plugin\_circular\_dependencies\ crate: \CircularModulesInfoPlugin\ to collect module information, \CircularDependencyRspackPlugin\ to detect cycles in the dependency graph (excluding asynchronous-only dependencies), and \CircularCheckRspackPlugin\ to report detected cycles as diagnostics or via a custom handler. This provides a new capability for identifying circular imports during the build process.

_crates/rspack\_plugin\_circular\dependencies · high confidence

Introduce new documentation UI components for the Rspack website

The documentation website now includes a set of new React components to enhance the user experience and content presentation. The \ApiMeta\ component displays versioning and stability tags (Added, Deprecated, Removed, Experimental) for configuration options and APIs. A \CommunityCompatibleTable\ provides a standardized, color-coded view of plugin compatibility status. Additional components include \BlogList\ for displaying release posts, \Attribution\ for handling CC BY 4.0 licensing credits, and utility components like \Collapse\ and \Columns\ to improve the layout and interactivity of the documentation pages.

website · high confidence

Introduce new persistent cache database backend

The new cache system now uses a dedicated database layer that persists cache data to disk. On non-WASM targets, this is implemented via \turbo\_persistence\ with parallel scheduling using Rayon, while WASM targets fall back to a no-op in-memory implementation. The database supports two families (Cache and Validator) and includes idle compaction logic to manage storage efficiently.

_crates/rspack\_core/src/new\cache/db · high confidence

Introduce new persistent cache system with memory and filesystem layers

Rspack now includes a new cache implementation in \crates/rspack\_core/src/new\_cache\ that replaces the legacy approach. This system introduces a two-tier storage strategy: an in-memory cache for fast access during a build session, and a persistent filesystem cache (backed by a database) for long-term storage. The new cache supports etag-based validation to ensure cached values remain valid, validates cache versions and build dependencies on startup, and manages idle compaction of the filesystem store in a background thread. It also provides a namespaced \CacheFacade\ API for compiler-scoped caching and includes a dedicated \ResolverCache\ to cache module resolution results based on filesystem snapshots.

_crates/rspack\_core/src/new\cache · high confidence

Introduce persistent cache storage with crash-safe transactions

Adds a new persistent cache storage implementation in \crates/rspack\_storage\ that organizes data into hot and cold packs for efficient access. The storage engine uses a two-phase commit protocol with lock files to ensure atomic writes and crash recovery, preventing cache corruption. It includes bloom filters for fast key lookups and content hashing for integrity verification, with automatic fallback to read-only mode if a save operation fails.

_crates/rspack\storage · high confidence

Introduce portable path and string utilities for cross-platform caching

The \rspack\_cacheable\ library now includes \PortablePath\ and \PortableString\ utilities that normalize file paths and path-containing strings for consistent serialization across different operating systems and project roots. \PortablePath\ converts absolute paths to relative ones during serialization and restores them using a provided project root, while \PortableString\ detects absolute paths within arbitrary strings, replacing them with a \\<project\_root\>\ placeholder to ensure cache keys and identifiers remain portable across environments like Windows and Linux.

_crates/rspack\cacheable/src/utils · high confidence

Introduce raw module rule options for the binding API

The \rspack\_binding\_api\ crate now exposes a new \raw\_options/raw\_module\ module that defines the Rust-side data structures for module rules, including \RawModuleRule\, \RawModuleRuleUse\, and \RawRuleSetCondition\. This change provides the foundational types required to pass module configuration (such as test conditions, include/exclude paths, and loader options) from the JavaScript side to the Rust core, enabling the binding layer to interpret and apply module-specific parsing and generation settings.

_crates/rspack\_binding\_api/src/raw\_options/raw\module · high confidence

Introduce raw\_options binding API for configuration serialization

The \rspack\_binding\_api\ crate now exposes a comprehensive \raw\_options\ module that defines the Rust-side data structures and N-API bindings for serializing rspack configuration options. This includes the main \RawOptions\ struct and specialized modules for cache, devtool, dynamic entry, external, mode, node, optimization, output, snapshot, and stats configurations. These bindings enable the JavaScript side to pass structured configuration data to the Rust core, handling type conversions, validation, and normalization (such as \WithFalse\ and \WithBool\ enums) before the data reaches the \CompilerOptions\.

_crates/rspack\_binding\_api/src/raw\options · high confidence

Introduce rsdoctor native plugin for build analysis

Adds a new native Rust plugin (\rspack\_plugin\_rsdoctor\) that integrates with the rsdoctor tooling ecosystem to provide detailed build analysis. The plugin hooks into the compilation lifecycle to collect and report on chunk graphs, module graphs, assets, and export usage. It exposes configuration options to selectively enable features such as module graph data, module IDs, module sources, chunk graph data, and asset information, allowing users to tailor the depth of the analysis report generated by rsdoctor.

_crates/rspack\_plugin\rsdoctor · high confidence

Introduce rspack\_binding\_builder crate for custom plugin development

Added the \rspack\_binding\_builder\ crate, which acts as a lightweight wrapper around \rspack\_binding\_api\ to simplify the creation of custom Rspack plugins and bindings. This new component re-exports key API elements like \CustomPluginBuilder\ and \register\_custom\_plugin\, providing a more accessible foundation for developers integrating custom logic with Rspack core functionality.

_crates/rspack\_binding\builder · high confidence

Introduce rspack\_cacheable library for serializing and deserializing cacheable data

The new \rspack\_cacheable\ crate provides a library for serializing and deserializing Rust structures using \rkyv\, with support for a \CacheableContext\ that allows passing project root information for portable path conversion. It includes a \noop\ feature that disables actual serialization/deserialization (panicking if used) to allow conditional compilation, and exposes macros from \rspack\_cacheable\_macros\ to mark types as cacheable.

_crates/rspack\cacheable/src · high confidence

Introduce rspack\_fs crate with unified file system abstractions

The new \rspack\_fs\ crate provides a unified file system abstraction for Rspack, defining \ReadableFileSystem\ and \WritableFileSystem\ traits along with an \IntermediateFileSystem\ for streaming operations. It includes concrete implementations: \NativeFileSystem\ for real disk I/O (with optional Yarn PnP support), \MemoryFileSystem\ for in-memory operations, and \NoopFileSystem\ as a stub. The crate also introduces target-agnostic \FileMetadata\ and \FilePermissions\ types to standardize file attribute handling across platforms.

_crates/rspack\fs · high confidence

Introduce rspack\_location crate for source position and dependency location tracking

This change introduces the new \rspack\_location\ crate, which defines the core data structures for tracking source positions (\SourcePosition\) and dependency locations (\DependencyLocation\). It provides \RealDependencyLocation\ for mapping byte-based offsets to 1-based, UTF-16 column-aware line/column positions compatible with V8 error stack semantics, and \SyntheticDependencyLocation\ for generated dependencies. This standardizes how location information is stored and displayed in diagnostics.

_crates/rspack\location · high confidence

Introduce runtime chunk plugin to centralize runtime code

Added the \RuntimeChunkPlugin\ which allows users to configure a shared runtime chunk for all entries. By setting the \runtime\ option to \Single\, \Multiple\, a specific string, or a function, the plugin ensures that runtime code is extracted into a dedicated chunk rather than being duplicated in each entry bundle, improving caching and reducing overall bundle size.

_crates/rspack\_plugin\_runtime\chunk · high confidence

Introduce size limit plugin with configurable asset and entrypoint warnings

Added a new \SizeLimitsPlugin\ that checks compiled assets and entrypoints against configurable size thresholds (\max\_asset\_size\, \max\_entrypoint\_size\). The plugin parallelizes size calculations for assets and emits diagnostics (warnings or errors based on the \hints\ option) when limits are exceeded, helping users identify performance-impacting bundle sizes.

_crates/rspack\_plugin\_size\limits · high confidence

Introduce standalone JavaScript compiler crate

A new \rspack\_javascript\_compiler\ crate has been added, providing a standalone \JavaScriptCompiler\ API for parsing, transforming, minifying, and stringifying JavaScript code. This component exposes dedicated methods for minification and transformation, supports isolated TypeScript declaration generation via \emit\_isolated\_dts\, and includes example scripts to demonstrate usage. It also implements error handling that deduplicates and converts SWC diagnostics into Rspack-compatible errors.

_crates/rspack\_javascript\compiler · high confidence

Introduce structured error and diagnostic types

The \rspack\_error\ crate now provides a structured error system with \Error\ and \Diagnostic\ types that support severity levels (errors and warnings), source code labels, and colored rendering. This enables more detailed and visually clear error reporting for users, including better context for syntax and resolution issues.

_crates/rspack\error/src · high confidence

Introduce structured tracing with Perfetto and JSON stdout support

The \rspack\_tracing\ crate now provides a unified tracing interface with two concrete implementations: \PerfettoTracer\, which writes trace data in Perfetto proto format for performance profiling, and \StdoutTracer\, which outputs structured JSON logs to stdout, stderr, or a file. This change replaces previous ad-hoc logging with a consistent \Tracer\ trait that supports synchronous trace events, enabling better observability and debugging of build processes through standardized trace formats.

_crates/rspack\tracing/src · high confidence

Introduce virtual file system support for in-memory file operations

Users can now interact with a virtual file system layer that allows files to be stored and retrieved from memory rather than the real disk. This change adds a \VirtualFileSystem\ implementation that checks an in-memory store (backed by a trie data structure) before falling back to the real file system for reads, metadata, and directory listings. It also exposes a \VirtualFileStore\ interface via the binding API, enabling external code to write virtual files synchronously or in batches, which facilitates scenarios like testing or bundling where file content needs to be managed in-memory.

_crates/rspack\_binding\_api/src/virtual\modules · high confidence

Introduces dynamic trait object serialization support in rspack\_cacheable

The \rspack\_cacheable\ library now supports serializing and deserializing dynamic trait objects (trait objects) via the new \dyn\ module. This adds \SerializeDyn\ and \DeserializeDyn\ traits, along with \ArchivedDynMetadata\ for storing type metadata, enabling the caching of values where the concrete type is only known at runtime. The implementation uses the \inventory\ crate to automatically register type-specific vtables and validation functions into global registries (\DYN\_REGISTRY\ and \CHECK\_BYTES\_REGISTRY\), allowing the cache to look up the correct serialization logic for any registered dynamic type without explicit manual registration by users.

_crates/rspack\cacheable/src/dyn · high confidence

Introduces opt-in per-loader caching with filesystem snapshot validation

Rspack now supports per-loader caching, allowing individual loaders to opt into caching their execution results. This feature introduces a new caching infrastructure in the loader runner that generates cache keys based on module identifier, loader name, content, and dependencies. It validates cache entries against filesystem snapshots to ensure stale data is not used, and restores file/build dependencies from snapshots upon cache hits. The implementation includes an \extractSourceMap\ option that can extract source maps from resource content while tracking the associated file dependencies for cache invalidation. This enables significant performance improvements for loaders that produce deterministic outputs, as their results can be reused across rebuilds without re-execution.

_crates/rspack\core/src/loader · high confidence

Introduction of incremental compilation infrastructure

The build system now includes a new incremental compilation framework within \rspack\_core\. This change introduces a \Incremental\ state manager that tracks compilation progress through specific stages (such as module graph building, chunk graph sealing, and asset emission) and records granular mutations (like module additions, updates, or removals) during rebuilds. This infrastructure enables the bundler to skip unnecessary work in subsequent builds by identifying exactly which parts of the module and chunk graphs have changed, thereby improving rebuild performance.

_crates/rspack\core/src/incremental · high confidence

Introduction of rspack\_binding\_api crate with build and licensing scaffolding

A new \rspack\_binding\_api\ crate has been added to the project, establishing the core binding layer that exposes Rspack's Rust core functionality to JavaScript/Node.js environments. This change introduces the initial project structure, including a MIT license file, a README detailing the crate's role as a C dynamic library bridge (with warnings against direct external dependency), and a \build.rs\ script. The build script ensures that TypeScript definition files (\napi-binding.d.ts\) are correctly regenerated on subsequent builds by handling environment variables and rerun conditions, preventing empty output issues. Additionally, a \.gitignore\ file is added to exclude generated \.node\ and \.wasm\ artifacts.

_crates/rspack\_binding\api · high confidence

Introduction of the EntryPlugin for managing compilation entries

The rspack\_plugin\_entry crate now provides the EntryPlugin, which registers itself with the compiler's compilation and make hooks. This plugin is responsible for setting up the normal module factory for entry dependencies and adding the entry to the compilation, effectively handling the initialization and processing of entry points in the build pipeline.

_crates/rspack\_plugin\entry · high confidence

Introduction of the new Rust-based loader runner

This change introduces a new loader runner implementation in Rust (\crates/rspack\_loader\_runner\), replacing the previous JavaScript-based execution model. The new runner manages the loader lifecycle (pitching, resource processing, and normal execution) natively, supporting both native Rust loaders and JavaScript loaders via async yielding. It includes built-in support for data and file URI schemes, dependency tracking (file, context, missing, build), and per-loader caching options. A corresponding testing crate (\crates/rspack\_loader\_testing\) provides reference implementations for validating the new runner's behavior.

_crates/rspack\_loader\runner · high confidence

Introduction of the rspack\_hook crate with stage-aware hook execution

The new \rspack\_hook\ crate provides the core infrastructure for the plugin system, introducing a \Hook\ trait and \HookCommon\ struct that support execution stages. This allows hooks to be ordered by priority (stage) and enables interceptors, laying the groundwork for the staged execution of compilation and module hooks.

_crates/rspack\hook · high confidence

JSON module support with tree-shaking and safe unicode escaping

The JSON plugin now parses JSON files into structured data to enable tree-shaking of named exports (objects and arrays) via a new \JsonExportsDependency\, allowing bundlers to eliminate unused JSON properties. It also implements safe escaping for the line and paragraph separator characters (U+2028 and U+2029) during code generation to prevent runtime syntax errors in JavaScript.

_crates/rspack\_plugin\json/src · high confidence

Native JS loader caching and execution pipeline

The \rspack\_binding\_api\ now implements a native loader caching system and a dedicated execution pipeline for JavaScript loaders. A new \JsLoaderCache\ tracks file, context, and build dependencies to invalidate cache entries when underlying assets change, while the \JsLoaderRspackPlugin\ manages the lifecycle of the loader runner and releases resources on compiler close. The resolver determines loader types (CommonJS vs. ES modules) and computes cache versions, and the scheduler optimizes execution by skipping JS callbacks for loaders known to lack pitch functions.

_crates/rspack\_binding\_api/src/plugins/js\loader · high confidence

Native plugin system for JavaScript hooks and RSC coordination

The binding API now exposes a native plugin infrastructure that allows JavaScript code to intercept and modify the compilation lifecycle. This includes a comprehensive \JsHooksAdapterPlugin\ that bridges core compiler and compilation hooks (such as \beforeModuleIds\, \optimizeModules\, and \runtimeModule\) to JavaScript, a \JsCleanupPlugin\ for handling revoked modules, and a \JsCoordinator\ for React Server Components (RSC) that supports configurable CSS link props and manifest callbacks.

_crates/rspack\_binding\api/src/plugins · high confidence

New CSS chunking plugin with configurable size limits

A new \CssChunkingPlugin\ has been added to the CSS plugin system, allowing users to control how CSS modules are grouped into chunks. The plugin introduces configurable \min\_size\ and \max\_size\ options (defaulting to 30KB and 100KB respectively) to optimize chunk sizes, along with an \exclude\ option to filter specific chunks and a \strict\ mode for dependency handling. This change enables more granular control over CSS output, preventing overly large or small chunks while respecting module dependencies.

_crates/rspack\_plugin\_css\chunking · high confidence

New CSS module lexer crate with dependency extraction and magic comment support

The \crates/css-module-lexer\ crate has been added to the workspace, providing a streaming lexer and dependency parser for CSS modules. It extracts class, ID, and URL dependencies while supporting ICSS \:import\/\:export\ syntax, the \composes\ property, and CSS module magic comments (e.g., \cssmodules-pure-ignore\). The implementation includes optimized string scanning using \memchr\, handles dashed identifiers and escaped CSS keywords, and exposes a public API (\lex\_dependencies\, \collect\_dependencies\) for integrating CSS module analysis into the build pipeline.

crates/css-module-lexer · high confidence

New JavaScript API for inspecting module details and structure

The \rspack\_binding\_api\ now exposes specific JavaScript wrappers for Normal, External, Context, and Concatenated modules, allowing users to inspect module properties and relationships directly from the JS side. Normal modules now provide access to resource paths, request strings, loader configurations, and a mutable \matchResource\ property, as well as build-time error diagnostics. Concatenated modules expose the \rootModule\ and the array of \modules\ that comprise the concatenation, while External and Context modules are also exposed with their standard module properties.

_crates/rspack\_binding\api/src/modules · high confidence

New JavaScript visitor infrastructure for scope analysis and semicolon insertion

The \visitors\ module now provides core infrastructure for JavaScript parsing and transformation. It introduces a \ScopeInfoDB\ that replaces parent-chain lookups with a scoped symbol table for faster variable resolution, and an \InsertedSemicolons\ visitor that implements ECMAScript Automatic Semicolon Insertion (ASI) rules to ensure correct syntax in generated code.

_crates/rspack\_plugin\javascript/src/visitors · high confidence

New N-API binding options for entry, library, and resolve configurations

This change introduces new Rust modules in \rspack\_binding\_api/src/options\ that expose detailed configuration options for entry points, library output, and module resolution to the JavaScript binding layer. Users can now configure entry-specific behaviors such as runtime, chunk loading, WASM loading, and dependencies via \JsEntryOptions\, define complex library export structures including UMD objects and auxiliary comments via \JsLibraryOptions\, and fine-tune module resolution with support for TypeScript config references, aliasing, and PnP settings via \RawResolveOptions\. These bindings enable the Node.js API to pass structured configuration data into the core Rust bundler logic.

_crates/rspack\_binding\api/src/options · high confidence

New Rstack ecosystem CI debugging skill

Added a new agent skill for triaging Rstack ecosystem CI failures across rspack, rsbuild, rslib, rspress, rstest, and rsdoctor. The skill provides a structured two-phase debug workflow (local triage and deep root-cause analysis) and includes reference guides for specific tools: an ecosystem status helper script, a canary date bisect tool for Rspack, an Rsbuild config debug tool, a deep PR debug tool, and a PR report comment tool. This replaces the previous migration skill with a dedicated eco-ci debugger.

.agents/skills/rstack-eco-ci-debug · high confidence

New Rust N-API binding crate for Node.js integration

The \rspack\_napi\ crate has been introduced to provide the Rust-side implementation for the Node.js binding layer. It includes a custom \JsCallback\ mechanism for safe cross-thread communication, specialized reference wrappers (\OneShotRef\, \ThreadsafeOneShotRef\, \WeakRef\) to manage JavaScript object lifecycles and prevent memory leaks, and a \ThreadsafeFunction\ implementation that bridges Rust async tasks with the Node.js event loop. Additionally, it provides a runtime management module that initializes a shared Tokio runtime for background processing and handles environment cleanup, along with utilities for error translation and JSON serialization.

_crates/rspack\napi · high confidence

New Rust binding API for splitChunks configuration

The \rspack\_binding\_api\ crate now exposes a new \raw\_split\_chunks\ module that bridges JavaScript configuration options to the Rust split-chunks plugin. This change adds support for configuring chunk splitting behavior via \RawSplitChunksOptions\, including new fields like \dedup\_depth\, \enforce\_size\_threshold\, and \name\_batch\. It also introduces specialized sub-modules for handling cache group tests, chunk filters, chunk naming (including batched name generation for performance), and size thresholds, allowing users to fine-tune how chunks are split and named in their bundles.

_crates/rspack\_binding\_api/src/raw\_options/raw\_split\chunks · high confidence

New Rust-to-JavaScript binding infrastructure for core compilation data

The rspack\_core crate now includes a new binding layer (cell.rs, napi\_allocator.rs) that exposes internal compilation structures—such as AssetInfo, CodeGenerationResult, CodeGenerationResults, Sources, and Assets—to the JavaScript API via N-API. This infrastructure establishes a one-to-one relationship between Rust instances and JS objects, allowing JS code to access build-time metadata and code generation outputs that were previously inaccessible.

_crates/rspack\core/src/binding · high confidence

New agent skill for creating draft release notes

A new agent skill, \create-draft-release-notes\, has been added to automate the generation and organization of GitHub release notes. This skill provides a structured workflow to create or update draft releases using the GitHub CLI, including verification of npm staged publishing and handling of authentication or permission limitations via a Markdown fallback. It automatically categorizes commit messages (such as breaking changes, features, and bug fixes) into organized sections and applies preservation rules to maintain existing content, ensuring consistent and user-friendly release documentation.

.agents/skills/create-draft-release-notes · high confidence

New build and debug utility scripts for the Node binding

The \crates/node\_binding/scripts\ directory now includes several new ESM scripts to support the build and debugging workflow. \build.mjs\ orchestrates the NAPI-RS build process, handling profile selection, feature flags, and post-build tasks such as renaming artifacts for browser targets and fixing TypeScript enum declarations. \dts-header.mjs\ and \banner.d.ts\ work together to prepend a custom TypeScript banner to the generated \napi-binding.d.ts\, ensuring correct type definitions for modules and build info. \add-external-debug-info.mjs\ implements the WebAssembly DWARF external file convention, allowing debug symbols to be stripped from the runtime WASM and stored in a separate sidecar file. \move-binding.mjs\ automates the placement of compiled \.node\ binaries into the appropriate npm platform directories.

_crates/node\binding/scripts · high confidence

New build dependency tracking for cache validation

Added a new \build\_dependencies\ module under \rspack\_core/src/cache\ that recursively calculates files used by build dependencies. It uses an AST visitor to extract import/require/export requests from JavaScript and TypeScript files, resolves them using the internal resolver, and collects the resulting file paths (including \package.json\ for node modules). This toolkit enables the caching system to accurately track which external files affect a module's build, improving cache invalidation precision.

_crates/rspack\core/src · high confidence

New cacheable serialization wrappers for complex types

The \rspack\_cacheable\ library now includes a comprehensive set of serialization wrappers in \crates/rspack\_cacheable/src/with\ to handle complex data structures and reference types. These new modules allow users to customize how specific types are archived and deserialized, supporting \Arc\, \Box\, \OnceCell\, \Cow\, \HashMap\, \HashSet\, \Vec\, tuples, and strings (with \Arc\<str\>\ caching). This enables more flexible and efficient caching of internal data structures that were previously difficult to serialize.

_crates/rspack\cacheable/src/with · high confidence

New compilation binding API modules for chunks, code generation, dependencies, diagnostics, and entries

The \rspack\_binding\_api\ now exposes dedicated Rust modules (\chunks\, \code\_generation\_results\, \dependencies\, \diagnostics\, \entries\) that bridge core compilation data structures to JavaScript via NAPI. Users can now access compilation chunks, code generation results, file system dependencies, diagnostics, and entry data through these new bindings, enabling more granular interaction with the compilation state from the JavaScript side.

_crates/rspack\_binding\api/src/compilation · high confidence

New dependency types for export info, module arguments, and branch guards

The JavaScript dependency system now includes several new dependency types to support advanced module analysis and code generation. \ExportInfoDependency\ allows runtime access to export metadata (such as \used\, \canMangle\, and \canInline\) by replacing source locations with computed values. \ModuleArgumentDependency\ handles references to module properties (like \id\ or \loaded\) by rendering the appropriate module argument and inserting required runtime globals. \IsIncludedDependency\ supports the \\_\_webpack\_is\included\\_\ API by checking if a module is part of the chunk graph. Additionally, \BranchGuardDependency\ and \PureExpressionDependency\ enable more precise tree-shaking and runtime condition handling by guarding dependencies based on branch evaluation and pure expression analysis.

_crates/rspack\_plugin\javascript/src/dependency · high confidence

New experimental configuration options for incremental builds, caching, and runtime mode

The \experiments\ configuration section now exposes several new options to control build behavior. Users can enable the new cache system via \experiments.newCache\, which allows fine-grained control over caching for code generation, modules, devtools, loaders, minimization, and the resolver. Incremental builds are configurable via \experiments.incremental\, allowing specific build passes (such as module graph building, chunk optimization, and asset emission) to be enabled or disabled. Additionally, users can enable CSS support (\experiments.css\), defer imports (\experiments.deferImport\), optimize pure functions (\experiments.pureFunctions\), and use source imports (\experiments.sourceImport\). The \experiments.runtimeMode\ option allows switching the runtime mode between "webpack" and "rspack".

_crates/rspack\_binding\_api/src/raw\_options/raw\experiments · high confidence

New external target plugins for Electron, Node, and HTTP requests

The externals plugin crate now includes dedicated target plugins to automatically handle external dependencies for specific environments. The \electron\_target\_plugin\ registers Node CommonJS externals for Electron modules (such as \electron\, \ipc\, and \app\) based on the target context (main, preload, or renderer). The \node\_target\_plugin\ exposes standard Node.js builtins and \pnpapi\ as Node CommonJS externals. Additionally, the \http\_externals\_rspack\_plugin\ handles HTTP URLs and CSS imports by mapping them to \module\, \import\, \asset\, or \css-import\ external types depending on the \web\_async\ configuration and dependency context. A new \EsmNodeTargetPlugin\ ensures that Node builtin externals used via CJS requires are correctly downgraded to \node-commonjs\ when necessary.

_crates/rspack\_plugin\externals/src · high confidence

New global object interning infrastructure for atoms and slices

Rspack now includes a new \rspack\_intern\ crate that provides global interning for JavaScript atoms and generic slices. This allows equal values to share a single memory allocation, making equality checks faster (pointer comparison) and reducing memory usage by keeping only one copy of each unique value. The implementation supports thread-safe concurrent interning and automatic cleanup when references are dropped.

_crates/rspack\intern · high confidence

New lint warns against inefficient hashers in Rspack collections

The \rspack\_collection\_hasher\ lint has been added to enforce performance best practices for internal data structures. It warns when \HashMap\, \HashSet\, \IndexMap\, \IndexSet\, \DashMap\, \DashSet\, \LinkedHashMap\, or \LinkedHashSet\ use Rust's default random hasher instead of the faster \FxHasher\. It also warns when \Ustr\ or \Identifier\ keys (which already have precomputed hashes) are used with non-identity hashers, recommending specific identity-hasher-based aliases like \IdentifierMap\ or \UstrMap\ to avoid redundant hashing overhead.

_linting, linting/rspack\_collection\hasher · high confidence

New macro for registering custom Rspack plugins in native bindings

The \rspack\_binding\_builder\_macros\ crate introduces the \register\_plugin\ procedural macro, allowing developers to define custom plugins that are exposed via N-API bindings. By providing a plugin name and a resolver function, the macro generates an N-API function that registers the plugin with \rspack\_binding\_builder\, enabling custom Rust plugins to be loaded and used within the Rspack host environment.

_crates/rspack\_binding\_builder\macros/src · high confidence

New parallel execution utilities for iterators and async scopes

The \rspack\_parallel\ crate introduces new tools for managing concurrent work: \FutureConsumer\ and \TryFutureConsumer\ traits allow consuming asynchronous iterators with optional short-circuit cancellation on errors, \RayonConsumer\ enables immediate consumption of parallel iterators, and a \scope\ helper provides structured concurrency for spawning and awaiting async tasks.

_crates/rspack\parallel · high confidence

New proc-macro attributes for tagged unions and field name generation

The \rspack\_napi\_macros\ crate now provides two new procedural macro attributes: \\#\[tagged\_union\]\ and \\#\[field\_names\]\. The \\#\[tagged\_union\]\ attribute allows Rust enums with single unnamed fields to be exposed to JavaScript as a single object with a discriminator field (e.g., \type: 'V1'\ or \type: 'V2'\) and optional variant-specific data, simplifying the handling of polymorphic types in the NAPI bindings. The \\#\[field\_names\]\ attribute generates a \field\_names()\ method for structs that returns a vector of their field names converted to camelCase, facilitating dynamic property access or serialization in JavaScript.

_crates/rspack\_napi\macros · high confidence

New proc-macro derive and attribute system for plugins, hooks, and configuration

The \rspack\_macros\ crate now provides a comprehensive set of procedural macros to simplify plugin development and internal configuration handling. Users can use the \\#\[plugin\]\ attribute to automatically wrap structs in \Arc\ for thread-safe sharing, and \\#\[plugin\_hook\]\ to register functions as hook implementations with optional stage and tracing controls. The \\#\[rspack\_hash\]\ derive enables deterministic hashing for structs and enums, supporting field ordering and JSON serialization. The \\#\[AstObject\]\ derive allows structs to be parsed from AST object literals with support for camelCase renaming and default values. Additionally, \\#\[impl\_runtime\_module\]\ and \\#\[impl\_source\_map\_config\]\ automate the implementation of core Rspack traits for runtime modules and source map configuration, while \\#\[string\_enum\]\ and \\#\[MergeFrom\]\ provide serialization and merging utilities for enums and structs.

_crates/rspack\macros · high confidence

New raw\_options/raw\_builtins module exposes built-in plugins to the JavaScript API

The \rspack\_binding\_api\ crate now includes a new \raw\_options/raw\_builtins\ module that defines the Rust-side data structures and N-API bindings for configuring Rspack's built-in plugins. This change introduces the \BuiltinPluginName\ enum and specific option structs (e.g., \RawBannerPluginOptions\, \RawCopyRspackPluginOptions\, \RawHtmlRspackPluginOptions\, \RawHttpUriPluginOptions\) that map JavaScript configuration objects to the underlying Rust plugin implementations. This enables users to configure plugins like Banner, Copy, HTML, HTTP URI, and various ID plugins directly through the JavaScript API.

_crates/rspack\_binding\_api/src/raw\_options/raw\builtins · high confidence

New rspack\_util crate consolidates shared Rust utilities

The \rspack\_util\ crate has been introduced to centralize common Rust helpers used across the bundler. This includes asset matching logic (\asset\_condition\), base64 encoding/decoding with Node.js compatibility (\base64\), case-insensitive ID comparison (\comparators\), and path resolution utilities for both POSIX and Windows (\identifier\, \node\_path\). It also provides fast JSON stringification via SIMD (\json\_stringify\_str\), a webpack-compatible number hashing algorithm (\number\_hash\), source map kind definitions (\source\_map\), and filesystem timestamp accuracy handling for caching (\time\).

_crates/rspack\util/src · high confidence

New unified development CLI and release tooling

The repository now includes a new \scripts\ directory containing a unified development CLI (\x\) and dedicated release tooling. The \x\ command (powered by \zx\) provides a single entry point for common development tasks, including building Rust bindings and JS packages, running tests, and launching the Rspack CLI with VSCode debugging support. Additionally, new scripts in \scripts/release/\ manage versioning, crate version synchronization, and npm publishing, while \scripts/build-npm.mjs\ handles the generation of native binding packages from build artifacts. This change consolidates previously scattered maintenance scripts into a structured, ESM-based workflow.

scripts · high confidence

New utility modules for module concatenation, rule matching, and source map extraction

The \crates/rspack\_core/src/utils\ directory now includes several new utility modules that support core bundling capabilities. \concatenation\_scope.rs\ and \concatenated\_module\_visitor.rs\ provide the scope management and AST visitor logic required for module concatenation, enabling the bundler to merge multiple modules into a single scope. \module\_rules.rs\ implements the async/sync rule matching engine that evaluates \ModuleRule\ conditions against resource data, issuer, and other context. \extract\_source\_map.rs\ adds the ability to parse, decode, and fetch source mapping URLs from code comments and data URIs. Additionally, \compile\_boolean\_matcher.rs\ provides an AOT-optimized boolean matcher for rule conditions, and \find\_graph\_roots.rs\ ports Webpack's graph root finding algorithm to identify entry points in the dependency graph.

_crates/rspack\core/src/utils · high confidence

Port of Webpack's RemoveEmptyChunksPlugin

Added the RemoveEmptyChunksPlugin to rspack, porting the logic from Webpack to automatically remove chunks that contain no modules, no entry modules, and no runtime code, while preserving facade chunks. This ensures that the final bundle output does not include empty, unused chunks, aligning rspack's chunk optimization behavior with Webpack's.

_crates/rspack\_plugin\_remove\_empty\chunks/src · high confidence

Rspack sources library migrated into the monorepo with persistent cache support

The \rspack\_sources\ crate, a Rust port of \webpack-sources\ for composable sources and source maps, has been moved into the Rspack monorepo. This change introduces a new \cacheable\ module (enabled via the \rspack\_cacheable\ feature) that provides \CacheableSource\ and \CacheableReplacement\ types for serializing and deserializing source objects using \rkyv\, enabling persistent caching. The library now includes its own MIT license file and updated documentation reflecting its new location within the workspace.

_crates/rspack\sources · high confidence

Rspack test tools package is introduced

The \@rspack/test-tools\ package is added, providing the internal test infrastructure for Rspack. It includes a new build configuration (\rstack.config.mts\) that supports both CommonJS and ESM outputs, and introduces a new test runner framework (\rstest\) with ESM support and file snapshot capabilities. The package contains a suite of case creators (e.g., \builtin\, \cache\, \config\, \compiler\, \diagnostic\, \error\, \esm-output\, \example\, \hash\) that standardize how Rspack tests are defined, executed, and validated against snapshots.

packages/rspack-test-tools · high confidence

Runtime modules migrated to Rust-based template rendering

The runtime modules in \rspack\_plugin\_runtime\ have been rewritten in Rust, replacing the previous JavaScript-based runtime generation. This change introduces a new template rendering system using EJS templates and the \dojang\ engine, allowing runtime code to be generated directly from Rust structs. Key modules such as \AutoPublicPathRuntimeModule\, \ChunkPrefetchStartupRuntimeModule\, and \GetChunkFilenameRuntimeModule\ now define their logic and templates in Rust, improving build performance and enabling more precise control over runtime output generation.

_crates/rspack\_plugin\_runtime/src/runtime\module · high confidence

Support for AMD, CommonJS, and URL context dependencies

The JavaScript plugin now handles dynamic context resolution for AMD \require\ calls, CommonJS \require\/\require.resolve\ calls, and \new URL()\ expressions. This change introduces dedicated dependency types and code-generation templates for these patterns, ensuring that dynamic module requests in these legacy and URL-based contexts are correctly bundled and resolved at runtime.

_crates/rspack\_plugin\javascript/src/dependency/context · high confidence

Support for \`new URL()\` with configurable URL modes

Added a new \URLDependency\ and its template in the JavaScript plugin to handle \new URL()\ expressions. This change introduces support for different URL resolution modes: relative URLs (using runtime globals for relative path resolution), new URL relative mode (preserving the \new URL(..., import.meta.url)\ structure with static placeholders for public path replacement), and the default mode (using \require\ and base URI). Users can now configure URL handling behavior via the \module.parser.url\ option, enabling more precise control over how asset imports are resolved and emitted in the final bundle.

_crates/rspack\_plugin\javascript/src/dependency/url · high confidence

Support for data:, file:, and http(s): URI schemes

Rspack now natively resolves resources using data URIs, file URIs, and http/https URIs. Data URIs are parsed to extract MIME types and decoded (base64 or URL-encoded) into module content. File URIs are converted to local filesystem paths for standard module resolution. HTTP/HTTPS URIs are fetched with support for caching, lockfile integrity verification, and configurable allowed-URI policies, enabling direct imports from remote URLs.

_crates/rspack\_plugin\schemes · high confidence

Support for dynamic entry points

Rspack now supports dynamic entry points, allowing entry modules to be determined at runtime rather than being statically defined in the configuration. This is implemented via the new \DynamicEntryPlugin\, which accepts a function to resolve entry imports and options during the compilation phase. The plugin caches dependency instances to optimize incremental builds by reusing existing dependencies when possible, ensuring that subsequent builds can skip unnecessary module processing if the dynamic entries remain unchanged.

_crates/rspack\_plugin\_dynamic\entry · high confidence

Support for rspack.DllPlugin and rspack.DllReferencePlugin

Rspack now supports the DllPlugin and DllReferencePlugin APIs, allowing users to pre-compile a separate library of modules and reference them in the main application. This change introduces the \DllEntryPlugin\ and \LibManifestPlugin\ to generate DLL manifests and the \DllReferenceAgencyPlugin\ (wrapping \DelegatedPlugin\) to resolve and delegate module requests to the pre-compiled DLL. Users can now split their build process to improve compilation performance for stable vendor libraries.

_crates/rspack\_plugin\dll · high confidence

Support for static worker new URL output

Added \CreateScriptUrlDependency\ and \CreateScriptUrlDependencyTemplate\ to handle static worker URL generation, enabling the bundler to correctly process \new URL()\ expressions for Web Workers when the output is static. This introduces a new dependency type (\CreateScriptUrl\) that wraps the URL in the \\_\_webpack\require\\_.c\ (or equivalent runtime global) helper, ensuring proper path resolution for worker scripts in static builds.

_crates/rspack\_plugin\javascript/src/dependency/worker · high confidence

create-rspack scaffolding now uses @rstackjs/create-toolkit and includes Rstest and agent skills

The \create-rspack\ CLI has been rewritten to use \@rstackjs/create-toolkit\ instead of the previous scaffolding engine, enabling new interactive options and tool integrations. Users can now optionally add Rstest for testing and receive curated agent skills (such as Rspack and React best practices) during project creation. The CLI also supports a \--no-git\ flag to skip Git initialization, and the generated templates for Vanilla, React, and Vue now include modernized configurations, TypeScript type declarations, and Rstest setup files.

packages/create-rspack · high confidence

Removals

Removal of basic Rust example

The basic example in the Rust crate has been removed, eliminating the standalone demonstration that previously compiled a React entry point using JavaScript and CSS plugins.

crates/rspack/examples · high confidence

Removal of legacy code splitting implementation

The legacy code splitting logic located in \crates/rspack\_core/src/chunk\_spliter\ has been removed. This deletion eliminates the previous \code\_splitting2\ function and associated module graph traversal logic that handled entry chunk creation and module placement, indicating a shift to a different code splitting strategy elsewhere in the codebase.

_crates/rspack\_core/src/chunk\spliter · high confidence

Removal of the React Refresh example application

The source files for the \examples/react-refresh\ directory have been deleted, removing the example application that demonstrated React Refresh functionality with various component types (class, function, lazy-loaded). This change is part of a broader effort to move example projects to the \rspack-contrib/rspack-examples\ repository.

examples/react-refresh · high confidence

Removed unused static assets from the Arco Pro example

The Arco Pro example application no longer includes several unused static asset files, specifically \dark.svg\, \light.svg\, \logo.svg\, and \world.json\. Removing these unused resources reduces the bundle size and cleans up the project's asset directory.

examples/arco-pro · high confidence

Security

Fix DOM clobbering vulnerability in auto public path

Addresses a security vulnerability where the auto public path logic was susceptible to DOM clobbering attacks. This fix ensures that the public path is resolved securely, preventing malicious manipulation of global variables that could lead to incorrect asset loading or other security issues.

packages/rspack · high confidence

Architecture

CSS parser and generator refactored into a dedicated module

The CSS parsing and generation logic has been reorganized into a new \parser\_and\_generator\ module, splitting the implementation into \parser.rs\, \generator.rs\, and \source\_builder.rs\. This change introduces a \CssModuleGenerator\ that handles both CSS and JavaScript source generation, supporting various export types (text, CSS stylesheet) and managing CSS module exports, local identifiers, and unused export tracking. The \CssSourceBuilder\ now handles source preparation, including charset handling, media queries, supports rules, and layer wrapping, while the parser tracks composes order and local CSS ident declarations.

_crates/rspack\_plugin\_css/src/parser\_and\generator · high confidence

CSS plugin refactored into modular components with native escape handling

The CSS plugin implementation has been restructured from a single-file module into a modular architecture, splitting functionality into dedicated files for syntax handling, dependencies, parsing/generation, plugin logic, and runtime. This change introduces a native Rust-based CSS escape decoder in css\_syntax.rs, replacing previous external dependencies for identifier escaping, and establishes the foundation for the new CSS module system by organizing the plugin's core responsibilities into separate, focused modules.

_crates/rspack\_plugin\css/src · high confidence

Compiler options restructured into dedicated modules

The compiler configuration schema has been reorganized into a set of dedicated modules (cache, clean\_options, context, externals, filename, mode, module, node, optimizations, output, platform, snapshot, stats) and unified under a new CompilerOptions struct. This change introduces granular configuration types such as CacheOptions (supporting Memory, FileSystem, and Persistent strategies), CleanOptions (with KeepPath, KeepRegex, and KeepFunc variants), and a comprehensive OutputOptions struct, providing users with a more structured and explicit way to configure build behavior.

_crates/rspack\core/src/options · high confidence

Introduce new JavaScript dependency scanning infrastructure

The dependency scanning logic in the JavaScript plugin has been reorganized into a new modular structure under \visitors/dependency\. This change introduces a dedicated \JavascriptParser\ and a \scan\_dependencies\ entry point that coordinates AST walking and dependency collection. A new \context\_dependency\_helper\ module has been added to handle the creation of context dependencies, including parsing template strings and wrapped expressions to generate precise regular expressions for module resolution. Additionally, a \util.rs\ module provides shared helper functions for expression name matching, regex validation, and error creation, consolidating previously scattered utility code.

_crates/rspack\_plugin\javascript/src/visitors/dependency · high confidence

JavaScript parser and generator module structure

The JavaScript parser and generator logic is now consolidated into a dedicated module at \crates/rspack\_plugin\_javascript/src/parser\_and\_generator\. This change introduces the \JavaScriptParserAndGenerator\ struct, which manages parser plugins and import meta resolution, and includes a \ParserRuntimeRequirementsData\ helper to standardize runtime variable rendering. It also adds a test to verify that parse error diagnostics correctly share source code references.

_crates/rspack\_plugin\_javascript/src/parser\_and\generator · high confidence

JavaScript parser plugins restructured into modular, hook-based architecture

The JavaScript parser plugin system has been refactored from a monolithic structure into a modular, hook-based architecture. The new \drive.rs\ implementation uses a bitmask-based dispatch mechanism to efficiently route AST events to specific plugins, reducing allocation overhead. This change introduces dedicated parser plugins for distinct concerns, including \api\plugin.rs\ for runtime globals (e.g., \\\_webpack\require\\_\), \common\_js\_imports\_parse\_plugin.rs\ and \common\_js\_exports\_parse\_plugin.rs\ for CommonJS handling, \esm\_detection\_parser\_plugin.rs\ for ESM detection, and \esm\_import\_dependency\_parser\_plugin.rs\ for import analysis. This restructuring improves performance and maintainability while preserving existing parsing behavior.

_crates/rspack\_plugin\_javascript/src/parser\plugin · high confidence

New JavaScript plugin architecture with dedicated module plugins

The JavaScript plugin system has been restructured into a modular architecture. A new \drive.rs\ defines the core \JavascriptModulesPluginHooks\ (including render, chunk hash, and module content hooks) that serve as the extension point for JavaScript output generation. A new \api\_plugin.rs\ implements the \rspack.APIPlugin\ to inject Node.js \createRequire\ support into ESM output when needed. Additionally, several key tree-shaking and optimization plugins (\FlagDependencyExportsPlugin\, \FlagDependencyUsagePlugin\, \InlineExportsPlugin\, \MangleExportsPlugin\, \InferAsyncModulesPlugin\) have been introduced or significantly refactored to manage export analysis, usage flagging, and async module inference, replacing previous monolithic implementations.

_crates/rspack\_plugin\javascript/src/plugin · high confidence

Refactor chunk graph internals into dedicated module files

The chunk graph implementation in rspack\_core has been reorganized by splitting the logic into separate files for chunk-specific data (\chunk\_graph\_chunk.rs\) and module-specific data (\chunk\_graph\_module.rs\). This change introduces dedicated \ChunkId\ and \ModuleId\ types that support serialization as numeric literals when possible, and refactors the \ChunkGraph\ struct to manage these distinct concerns more clearly. Users benefit from improved code maintainability and potential performance gains from the more granular data structures, though the public API surface remains largely unchanged.

_crates/rspack\_core/src/chunk\graph · high confidence

Refactored legacy cache implementation into modular components

The legacy cache system has been restructured into distinct, composable modules: a \Cache\ trait defines the lifecycle hooks, with concrete implementations for \DisableCache\ (when caching is off), \MemoryCache\ (process-local), and \PersistentCache\ (disk-based). These are combined via \MixedCache\ to support hybrid scenarios. The persistent cache now explicitly manages build dependencies, file/context/missing snapshots, and specific 'occasions' (make, minimize, source maps) for granular serialization and recovery, improving cache isolation and rebuild efficiency.

_crates/rspack\_core/src/legacy\cache · high confidence

Rspack binding API is split into a dedicated crate

The Rust binding layer has been reorganized into a new \rspack\_binding\_api\ crate, separating it from the core \rspack\_node\ crate. This change introduces a new set of NAPI wrappers for core concepts such as \Chunk\, \Module\, \Compilation\, and \AssetInfo\, and implements a \NapiAllocator\ to handle the conversion of internal Rust types to JavaScript values. It also introduces compiler-scoped ThreadsafeFunction (TSFN) management to ensure that JavaScript callbacks are properly cleaned up when a compiler instance is closed or garbage collected.

_crates/rspack\_binding\api/src · high confidence

Behavioural changes

Adoption of Rstack CLI for pre-commit hooks

The pre-commit hook configuration has been migrated to use the Rstack CLI. The hook script now executes the \rs staged\ command, replacing the previous implementation to leverage the new tooling for managing staged changes.

.rstack · medium confidence

Basic React example added to examples/react

The examples/react directory now includes a minimal React application using TypeScript (App.tsx, index.tsx) and CSS, replacing the previous JavaScript-based example (app.jsx, button.jsx) and associated assets (SVGs). This change provides a simpler, modern starting point for users exploring React integration.

examples/react · high confidence

CSS chunk loading runtime is restructured into modular EJS templates

The CSS loading runtime in the rspack plugin has been refactored from a single monolithic implementation into a set of modular EJS templates (e.g., \css\_loading.ejs\, \css\_loading\_with\_hmr.ejs\, \css\_loading\_with\_prefetch.ejs\). This change allows the runtime to conditionally include only the necessary logic for specific features—such as Hot Module Replacement (HMR), chunk prefetching, preloading, and style injection—resulting in smaller and more optimized client-side code. The Rust module (\mod.rs\) now orchestrates these templates, extracting runtime requirements and variables to ensure the generated JavaScript accurately reflects the enabled features.

_crates/rspack\_plugin\css/src/runtime · high confidence

CSS module ordering and rendering logic refactored into dedicated plugin hooks

The CSS plugin's internal structure has been reorganized to improve modularity and alignment with Webpack's behavior. A new \drive.rs\ file introduces \CssModulesPluginHooks\, allowing external code to intercept and modify the rendering of individual CSS module packages via a \render\_module\_package\ hook. The core logic for determining the correct order of CSS modules within a chunk (\get\_ordered\_chunk\_css\_modules\) and the subsequent rendering process (\render\_chunk\) has been moved into \impl\_plugin\_for\_css\_plugin.rs\. This change ensures that CSS modules are ordered based on their dependency graph (post-order indices) and resolves conflicts by emitting warnings, while also handling auto-public-path placeholders during the final source generation.

_crates/rspack\_plugin\css/src/plugin · high confidence

Configurable global memory allocator with tracing support

The rspack allocator now allows users to select the global memory allocator via Cargo features. By default, it uses mimalloc for performance. Users can enable the 'sftrace-setup' feature to wrap the allocator (mimalloc or system) with sftrace for tracing, or the 'tracy-client' feature to use the system allocator with Tracy profiling. The 'system-allocator' feature forces the use of the standard system allocator, which is useful for debug builds or specific environments. Miri and WebAssembly targets are excluded from these custom allocators.

_crates/rspack\allocator/src · high confidence

Dead code elimination for if-statements and logical operators

The JavaScript parser now evaluates constant conditions in if-statements, logical operators (&&, \|\|, ??), and conditional expressions at build time. When a condition is determined to be constant and side-effect-free, the parser replaces the dead branch with an empty block or zero, effectively removing unreachable code. This optimization also preserves hoisted var and function declarations from removed branches to maintain correct scoping behavior, aligning the bundler's dead code elimination with webpack's behavior.

_crates/rspack\_plugin\_javascript/src/parser\plugin/const · high confidence

Exports info data model refactored into split getter/setter modules

The internal data model for module exports in \rspack\core\ has been restructured to improve performance and maintainability. The \ExportInfoData\ and \ExportsInfoData\ structs now delegate their logic to dedicated \\\getter.rs\ and \\\_setter.rs\ modules, separating read-only queries (such as determining if an export is used or retrieving its mangled name) from mutation operations (such as setting targets or usage states). This change also introduces a new \NamedExports\ enum that uses a small inline vector for modules with few exports before spilling to a \BTreeMap\, reducing memory overhead for common cases.

_crates/rspack\core/src/exports · high confidence

Extracted shared browserslist resolution logic into a dedicated Rust crate

The browserslist resolution and configuration parsing logic has been moved into a new, standalone \rspack\_browserslist\ crate. This change centralizes the handling of browserslist queries, environment names, and config file paths, providing a reusable \load\_browserslist\ function and a \browserslist\_to\_lightningcss\_targets\ converter for other parts of the build system. Users benefit from consistent browserslist resolution across the toolchain and improved performance through Rust-native parsing.

_crates/rspack\browserslist · high confidence

Introduce InternedPath for memory-efficient path handling

The \rspack\_paths\ crate now provides \InternedPath\, a type that deduplicates identical file paths across the entire process by sharing a single allocation for equal paths. This change significantly reduces memory consumption and improves equality-check performance (pointer comparison) for path-heavy data structures. It also includes support for normalizing Windows DOS device paths (e.g., \\\\\?\\C:\\...\) to their legacy Win32 equivalents and enforces UTF-8 path assertions, ensuring consistent and safe path handling in the resolver and caching systems.

_crates/rspack\paths · high confidence

Introduce Rust-based DefinePlugin parser for JavaScript

The DefinePlugin logic for JavaScript has been moved into a new Rust module (\crates/rspack\_plugin\_javascript/src/parser\_plugin/define\_plugin\). This change replaces the previous implementation with a native parser plugin that handles identifier evaluation, \typeof\ checks, and member expression analysis. It also introduces dependency tracking for defined values to support tree shaking and detects conflicting definitions during compilation.

_crates/rspack\_plugin\_javascript/src/parser\_plugin/define\plugin · high confidence

Introduce Rust-based HTML plugin with template hooks and asset injection

The HTML generation logic has been rewritten in Rust (crates/rspack\_plugin\_html), replacing the previous JavaScript-based implementation. This new plugin supports configurable HTML templates (via file path, content string, or function), allows injecting scripts and styles into the head or body, and respects options such as chunks, exclude\_chunks, chunks\_sort\_mode, script\_loading, hash, minify, favicon, meta, and title. It exposes a series of hooks (before\_asset\_tag\_generation, alter\_asset\_tags, alter\_asset\_tag\_groups, after\_template\_execution, before\_emit, after\_emit) that allow customization of the generated HTML, and handles asset path resolution, public path injection, and HTML minification during the processAssets stage.

_crates/rspack\_plugin\html/src · high confidence

Introduce Rust-native runtime plugins for chunk loading, formatting, and prefetching

The runtime plugin system has been rewritten in Rust, replacing the previous JavaScript-based implementation with native modules for chunk loading (JSONP, CommonJS, Import Scripts, and ES Modules), chunk formatting (Array Push Callback, CommonJS, and ES Modules), and chunk prefetch/preload. This change introduces new runtime behaviors for how chunks are loaded and executed, including support for prefetch and preload triggers, and adds a BundlerInfo plugin that can inject the Rspack version and unique ID into the runtime output.

_crates/rspack\_plugin\runtime/src · high confidence

Introduce dedicated CSS dependency types for imports, exports, and URL resolution

The CSS plugin now uses specific dependency structs—CssImportDependency, CssComposeDependency, CssExportDependency, CssLocalIdentDependency, CssIcssSymbolDependency, CssSelfReferenceLocalIdentDependency, and CssUrlDependency—to manage CSS module internals. This change enables precise handling of CSS imports (including render conditions and export types), CSS module exports (supporting local ident mangling and ICSS symbol resolution), and URL asset resolution (replacing placeholders with correct public paths). Users benefit from more accurate CSS module export tree-shaking, correct handling of CSS \composes\ and self-references, and reliable URL generation in CSS assets.

_crates/rspack\_plugin\css/src/dependency · high confidence

Introduce dedicated CommonJS dependency types for exports, requires, and self-references

The CommonJS dependency handling in the JavaScript plugin has been refactored to use specific dependency structs for different CJS patterns. This change introduces \CommonJsExportsDependency\ for tracking \exports\ assignments, \CommonJsExportRequireDependency\ for re-exporting via \require\, \CommonJsFullRequireDependency\ for full-module \require\ calls, \CommonJsRequireDependency\ for standard \require\ usage, and \CommonJsSelfReferenceDependency\ for reading \module.exports\ or \exports\ within the same module. Each type includes its own template for code generation and implements logic to correctly report referenced exports and side-effect states, improving the accuracy of tree-shaking and module analysis for CommonJS code.

_crates/rspack\_plugin\javascript/src/dependency/commonjs · high confidence

Introduce graphical error displayer with theme-based styling

The error reporting system now uses a new graphical renderer that displays diagnostics with terminal colors and Unicode characters. The displayer automatically detects whether to use color based on the output stream's capabilities, applying a theme-based style for visual hierarchy instead of environment sniffing. This change introduces a \Display\ trait with implementations for standard output (\StdioDisplayer\) and string generation (\StringDisplayer\), allowing for consistent, styled error messages in the CLI and programmatic access.

_crates/rspack\error/src/displayer · high confidence

Introduce incremental compilation artifacts for faster rebuilds

Rspack now uses a new \artifacts\ module to store and recover compilation state (such as the module graph, chunk graph, hashes, and code generation results) between builds. This change enables incremental compilation by allowing the bundler to reuse previously computed data instead of recalculating it from scratch, significantly improving rebuild performance.

_crates/rspack\core/src/artifacts · high confidence

Introduce new SplitChunks plugin implementation

The \rspack\_plugin\_split\_chunks\ crate has been reorganized into a new, modular structure (\common\, \module\_group\, \options\, \plugin\) to power the bundle splitting logic. This change introduces a refined \ModuleGroup\ abstraction that manages module collections and their associated cache groups, supporting both named and anonymous chunk strategies. It also adds robust \ChunkFilter\ and \ModuleLayerFilter\ types, allowing users to define custom async filters for chunks and modules, alongside helper utilities for calculating and merging split chunk sizes across different source types.

_crates/rspack\_plugin\_split\chunks/src · high confidence

Introduce rollback-capable data structures for the module graph

Added a new \rollback\ module in \rspack\_core\ containing \RollbackAtom\, \RollbackMap\, \OverlayMap\, \DenseDependencyIdMap\, and \DenseIdOverlayMap\. These structures provide checkpoint and reset capabilities, allowing the module graph to temporarily apply changes (such as during module concatenation) and safely discard them if needed, which supports the fix for preserving shared connections during module concatenation.

_crates/rspack\_core/src/module\graph/rollback · high confidence

Introduce structured SplitChunks cache group options

The split chunks plugin now exposes a dedicated options module defining the \CacheGroup\ struct and its associated test and name-getter types. This change formalizes the configuration schema for \splitChunks.cacheGroups\, explicitly supporting fields such as \min\_size\_reduction\, \enforce\_size\_threshold\, \used\_exports\, and flexible \test\/\name\ definitions (including functions and regexes), ensuring these options are correctly parsed and applied during bundle splitting.

_crates/rspack\_plugin\_split\chunks/src/options · high confidence

Introduces hybrid file system routing for Node.js and native implementations

The \rspack\_binding\_api\ crate now includes a \HybridFileSystem\ that routes file system operations between a Node.js-based file system and a native Rust file system based on a configurable allowlist of regular expressions. This allows users to leverage Node.js file system capabilities for specific paths (such as those requiring native addons or specific Node APIs) while using the faster native implementation for the rest of the project, providing a unified interface that automatically selects the appropriate backend per path.

_crates/rspack\_binding\_api/src/fs\node · high confidence

JavaScript ProvidePlugin now tracks value dependencies for conflict detection

The JavaScript ProvidePlugin now registers value dependencies during parsing, enabling it to detect and warn about conflicting configuration values for the same provided identifier across different modules. This change ensures that if multiple modules request the same provided name but with different source modules, a warning diagnostic is emitted during compilation, helping users identify configuration inconsistencies that could lead to unexpected behavior.

_crates/rspack\_plugin\_javascript/src/parser\_plugin/provide\plugin · high confidence

JavaScript plugin refactored with new magic comment handling and runtime rendering

The JavaScript plugin module has been restructured to improve code organization and parsing capabilities. A new \magic\_comment.rs\ module has been introduced to centrally handle webpack-style magic comments (such as \ChunkName\, \Prefetch\, \Preload\, and \Ignore\), including logic for detecting and warning about conflicting comment prefixes. The previous \utils.rs\ and \visitors.rs\ modules, which contained basic SWC parsing and dependency scanning logic, have been removed and replaced by a more modular architecture featuring dedicated \runtime.rs\ and \runtime\_context.rs\ files for managing runtime code generation and module rendering. Additionally, the public API has been updated to expose new types like \TransformOutput\ and \SourceMapsConfig\, and the module now re-exports core parser and generator components for broader use.

_crates/rspack\_plugin\javascript/src · high confidence

Legacy case transformation support for babel-plugin-import compatibility

The import plugin now supports legacy kebab-case and snake\_case transformations to maintain compatibility with older versions of babel-plugin-import (pre-1.13.7). This change introduces a custom template engine to replace Handlebars, enabling new template helpers like \legacyKebabCase\ and \legacySnakeCase\ that transform identifiers differently than standard case conversions (e.g., \HTTPRequest\ becomes \h-t-t-p-request\ instead of \http-request\). Users relying on these specific legacy naming conventions for component imports will see their imports transformed according to the older behavior.

_crates/swc\_plugin\import · high confidence

Migrate rspack\_dojang HTML template engine into the monorepo

The \rspack\_dojang\ crate, an HTML template engine forked from the external \dojang\ project, has been moved into the Rspack monorepo. This change brings the template engine's source code (including the parser, evaluator, and execution logic) under the main repository, allowing Rspack to maintain fixes and Rspack-specific features alongside its consumers. The engine remains a drop-in replacement for EJS, supporting basic JavaScript control flow, script/output tags, and custom function registration.

_crates/rspack\dojang · high confidence

Module Federation runtime initialization and entry handling

The Module Federation plugin now manages runtime initialization by injecting an EmbedFederationRuntimeModule into runtime chunks to wrap the startup function, ensuring federation dependencies execute before other modules. This includes support for async startup via an optional experiment flag, and the ContainerPlugin now adds a ContainerEntryDependency to handle entry points and exposes, while the ContainerReferencePlugin resolves remote modules and fallbacks.

_crates/rspack\_plugin\mf · high confidence

Module resolution now uses the new rspack\_resolver engine

The resolver implementation in rspack\_core has been replaced with the new rspack\_resolver engine. This change introduces a new file-system abstraction (BoxFS) to bridge the core's ReadableFileSystem with the resolver's requirements, and a ResolverFactory to manage resolver instances and caching based on dependency types. Users benefit from improved resolution accuracy, better error diagnostics, and support for modern module resolution features like Yarn PnP and enhanced alias handling.

_crates/rspack\core/src/resolver · high confidence

New cache configuration options exposed via binding API

The binding API now exposes granular cache configuration options, allowing users to select between 'persistent', 'filesystem', or 'memory' cache types. Persistent cache supports new settings including \readonly\, \portable\, \max\_age\, and \max\_memory\_generations\. Filesystem cache options now include \readonly\, \idle\_timeout\ variants, and \max\_memory\_generations\. Memory cache allows configuration of \max\_generations\. These options are mapped to the core cache implementation via the new \RawCacheOptions\ and \RawStorageOptions\ structures.

_crates/rspack\_binding\_api/src/raw\_options/raw\cache · high confidence

New experiments configuration structure for advanced features

The \experiments\ module has been restructured to define a new \Experiments\ configuration struct that exposes granular control over several advanced capabilities. Users can now configure fine-grained caching via \new\_cache\ (enabling code generation, module, devtool, loader, minimize, and resolver caching), enable CSS support through the \css\ flag, activate deferred imports with \defer\_import\, support source phase imports for WebAssembly via \source\_import\, optimize side-effects-free function calls with \pure\_functions\, and switch the runtime generation mode between Webpack and Rspack compatibility using \runtime\_mode\.

_crates/rspack\core/src/options/experiments · high confidence

New filesystem snapshot system for cache dependencies

The new cache system now uses a dedicated \FileSystemInfo\ module to track and validate file system state, replacing the previous approach. This implementation mirrors webpack's \FileSystemInfo\ seam, supporting timestamp, hash, and combined timestamp-hash strategies for modules, context modules, and build dependencies. It classifies paths into unmanaged, managed, and immutable categories, allowing the cache to accurately detect changes in source files, \node\_modules\, and cached assets, thereby improving rebuild accuracy and cache invalidation.

_crates/rspack\_core/src/new\cache/snapshot · high confidence

New high-performance regex engine with suffix optimization

The \rspack\_regex\ crate now provides a new \RspackRegex\ implementation that uses the \regress\ library for full JavaScript RegExp compatibility, while introducing a fast-path optimization for \endsWith\ patterns to significantly improve performance in common scenarios like file extension matching. This change replaces previous regex handling mechanisms with a unified API supporting flags, capture groups, and NAPI bindings for JavaScript interop.

_crates/rspack\regex/src · high confidence

New stats module structure and artifact fallback system

The stats generation logic has been restructured into a new module (\crates/rspack\_core/src/stats\) containing \mod.rs\, \struct.rs\, and \utils.rs\. This introduces a \Stats\ struct that manages artifact fallback flags (for exports info, module graph cache, build module graph, module IDs, and chunk hashes) to handle incremental build scenarios. It also defines the data structures for stats output, including \ExtendedStatsOptions\, \StatsError\ (with module trace support), \StatsModule\, and \StatsAsset\, along with utility functions for sorting modules and retrieving chunk group child assets by preload/prefetch order.

_crates/rspack\core/src/stats · high confidence

Plugin system refactored to use explicit hook registration via ApplyContext

The plugin architecture in rspack\_core has been restructured to replace the previous implicit hook registration (via methods like \register\_parse\_module\ and \parse\_module\ on the \Plugin\ trait) with an explicit registration model. Plugins now implement an \apply\ method that receives an \ApplyContext\, allowing them to directly register their hooks (such as \compiler\_hooks\, \compilation\_hooks\, and module factory hooks) and parser/generator builders. This change removes the old \args.rs\ and \traits.rs\ files, simplifies the \Plugin\ trait to focus on lifecycle and configuration, and centralizes hook management within the \PluginDriver\, improving type safety and clarity for plugin authors.

_crates/rspack\core/src/plugin · high confidence

Prevent asset emission and recording when compilation errors occur

The new NoEmitOnErrorsPlugin intercepts the compilation lifecycle to block output generation if errors are present. By tapping into the should\_emit and should\_record hooks, the plugin ensures that no assets are written to disk and no records are saved when the compilation contains errors, aligning with the optimization.emitOnErrors configuration.

_crates/rspack\_plugin\_no\_emit\_on\errors · high confidence

Refactored ESM dependency handling and code generation

The ESM dependency system in the JavaScript plugin has been restructured to improve performance and maintainability. The diff shows the introduction of new, specialized dependency types such as \ESMCompatibilityDependency\ (which handles \\_\_esModule\ marking and async module boundaries), \ESMExportExpressionDependency\, and \ESMExportHeaderDependency\ (which strips the \export\ keyword). Existing dependencies like \ESMImportDependency\ and \ESMImportSpecifierDependency\ have been refactored to use a new caching mechanism (\ModuleGraphCacheArtifact\) for export mode determination and to support branch-guarded dependencies for better tree-shaking. Additionally, \ImportDependency\ and \ImportEagerDependency\ now support \referenced\_specifiers\ and \branch\_guard\ fields to enable more precise side-effects optimization and dynamic import handling.

_crates/rspack\_plugin\javascript/src/dependency/esm · high confidence

Refactored JavaScript dependency parser with reference-based AST traversal and incremental location caching

The JavaScript dependency parser has been restructured to improve performance and reduce memory allocations. A new \ExprRef\ wrapper type allows the parser to hold references to SWC AST nodes instead of cloning them during traversal. Additionally, a \DependencyLocationAdvancer\ component has been added to compute dependency source locations incrementally, using cached results for adjacent ranges and optimized ASCII fast-paths. The parser's walk logic is now split into distinct phases (\module\_pre\, \block\_pre\, \pre\, and \walk\) to better align with webpack's hook system and improve code organization.

_crates/rspack\_plugin\javascript/src/visitors/dependency/parser · high confidence

Refactored cacheable macros to support custom crate paths and trait serialization

The \rspack\_cacheable\_macros\ crate has been restructured to support more flexible caching configurations. The \\#\[cacheable\]\ macro now accepts a \crate = ...\ argument, allowing users to specify a custom path to the \rspack\_cacheable\ crate instead of relying on the default \::rspack\_cacheable\. Additionally, the new \\#\[cacheable\_dyn\]\ macro enables serialization for dynamic trait objects (\dyn Trait\) by automatically implementing the necessary \ArchiveUnsized\, \SerializeUnsized\, and \DeserializeUnsized\ traits, as well as registering vtables for runtime validation. The macro also introduces a \hashable\ argument for \\#\[cacheable\]\ structs to derive \Hash\ and \PartialEq\ on the archived type, and supports \with\ arguments for custom field serialization logic.

_crates/rspack\_cacheable\macros · high confidence

Refactored chunk merging logic to prevent panics during optimization

The LimitChunkCountPlugin has been refactored to use a new \ChunkCombinationBucket\ data structure for managing chunk pairs, replacing the previous implementation. This change introduces a lazy-sorting mechanism that orders combinations by size benefit and integrated size, ensuring deterministic behavior. Crucially, this refactoring addresses a panic that occurred when the plugin was used with incremental compilation enabled, stabilizing the chunk optimization process.

_crates/rspack\_plugin\_limit\_chunk\count · high confidence

Refactored compilation into a modular, incremental pass system

The compilation pipeline has been restructured into a series of distinct, named passes (such as \BuildChunkGraphPass\, \AfterProcessAssetsPass\, and \AfterSealPass\) that execute sequentially. This change introduces a new incremental update mechanism for the module graph, allowing the system to selectively remove and rebuild only the affected parts of the dependency tree during rebuilds rather than rebuilding everything from scratch. Additionally, the chunk graph building logic has been extracted into its own artifact and pass, enabling more granular control and potential reuse of the chunk graph state across rebuilds.

_crates/rspack\core/src/compilation · high confidence

Refactored dependency system with new core types and traits

The dependency system in rspack\_core has been restructured to improve caching, hashing, and code generation. This introduces new core types such as \DependencyId\ (a unique u32 identifier), \DependencyCategory\ (categorizing imports like ESM, CommonJS, CSS, etc.), and \DependencyType\ (a comprehensive enum covering all dependency kinds). The \Dependency\ trait is now the central interface, defining methods for export analysis, diagnostics, and connection state. Code generation is handled via the \DependencyCodeGeneration\ trait and \DependencyTemplate\ implementations, allowing dependencies to render their code into the output. New dependency structs like \ConstDependency\ and \CachedConstDependency\ provide efficient ways to replace source code with constant values, with the latter supporting placement in module or chunk init fragments. Context dependencies are abstracted via the \ContextDependency\ trait, and module dependencies use the \ModuleDependency\ trait. This refactoring aligns the internal dependency model with webpack's structure while enhancing performance through better caching and reduced allocations.

_crates/rspack\core/src/dependency · high confidence

Refactored file system watcher into a modular, platform-aware architecture

The \rspack\_watcher\ crate has been restructured to improve reliability and cross-platform consistency. It now uses a pluggable \Analyzer\ strategy: on macOS and Windows, it watches the common root directory recursively, while on other platforms it watches individual directories. The new \DiskWatcher\ manages the underlying \notify\ instance and cleans up stale watches, and the \Executor\ aggregates file events with a configurable timeout. A dedicated \EventProcessor\ thread handles expensive operations like JS-backed \ignored\ predicates and mtime baseline checks to prevent blocking the OS event loop, and the \Scanner\ closes startup race conditions by verifying file states after the watcher is active.

_crates/rspack\watcher · high confidence

Refactored module graph storage with rollback support and connection tracking

The module graph implementation has been restructured to use rollback-capable data structures (RollbackMap, OverlayMap, DenseIdOverlayMap) for modules, connections, and dependency mappings, enabling efficient incremental rebuilds and state recovery. A new ModuleGraphConnection type with explicit IDs and active/conditional state tracking replaces previous connection representations, and ModuleGraphModule now maintains explicit incoming and outgoing connection sets for faster graph traversal. Internal helper functions for safe dependency and module lookups have been separated into a restricted internal module to enforce invariants in public APIs.

_crates/rspack\_core/src/module\graph · high confidence

Refactored resolve option merging and caching infrastructure

The resolve configuration handling has been restructured to improve how options are combined and persisted. A new 'clever merge' system now intelligently combines resolve settings, correctly handling per-dependency overrides and preserving option order. Additionally, alias values are now fully cacheable, allowing the resolver state to be serialized and restored efficiently during builds. These changes refine the internal mechanics of module resolution without altering the external configuration API.

_crates/rspack\core/src/options/resolve · high confidence

Removal of legacy pre-commit hook script

The legacy pre-commit hook script located at .husky/pre-commit has been removed. This file previously executed pnpm lint-staged via the husky.sh bootstrap script, indicating a shift away from the older husky configuration method towards a newer tooling approach.

.husky · high confidence

Restructured examples with new React and Vanilla templates

The examples directory has been reorganized to provide cleaner, modern starter templates for debugging and learning. The legacy \arco-pro\ example and older \basic\, \bundle-splitting\, \code-splitting\, and \multi-entry\ examples have been removed. In their place, new \basic\ and \react\ examples have been added, featuring updated configuration files (\rspack.config.mjs\/\.ts\) that utilize the latest \@rspack/cli\ and \@rspack/core\ APIs. The new React example specifically demonstrates TypeScript support, CSS modules, and the \react-refresh\ plugin for development hot-reloading, offering a more robust starting point for users.

examples · high confidence

Rewritten split-chunks algorithm with bitmap-based intersection discovery

The split-chunks plugin has been completely rewritten to use a new, high-performance algorithm for discovering module intersections. This change introduces a dense bitmap representation (\ChunkBitmap\) to efficiently track and compare chunk memberships, replacing previous data structures. The new logic discovers intersections in bounded rounds, computes original support, and handles deduplication via configurable \dedupDepth\. This rewrite improves bundle splitting performance and stability, ensuring deterministic output and better alignment with webpack's splitting behavior while introducing new internal structures for managing module groups, max/min size constraints, and request limits.

_crates/rspack\_plugin\_split\chunks/src/plugin · high confidence

Rspack CLI is rewritten as a pure ESM package with a new command-line interface

The \@rspack/cli\ package has been completely rewritten from the ground up as a pure ESM package, replacing the previous CommonJS implementation. This new version introduces a modernized CLI powered by the \cac\ argument parser and utilizes \@rstackjs/load-config\ for configuration loading, which now supports TypeScript, MJS, and CJS config files out of the box. The rewrite brings several behavioral changes: the \serve\ and \preview\ commands now require \@rspack/dev-server\ as an explicit peer dependency and load it lazily; the CLI enables Node.js compile caching by default (skipped in CI) to improve startup performance; and it introduces new built-in environment variables like \RSPACK\_BUILD\ and \RSPACK\_WATCH\ for config functions. Additionally, the \serve\ command now defaults to enabling lazy compilation for web applications and includes a new \--open\ flag to automatically open the browser.

packages/rspack-cli · high confidence

Runtime templates migrated to Dojang for enhanced rendering

The runtime module templates in \crates/rspack\_plugin\_runtime/src/runtime\_module/runtime\ have been converted from the previous format to use Dojang for template rendering. This change introduces a new set of \.ejs\ files (such as \async\_module.ejs\, \jsonp\_chunk\_loading.ejs\, and \module\_chunk\_loading.ejs\) that define the runtime logic using Dojang syntax. Users benefit from improved template processing capabilities and potentially better performance in runtime code generation, while maintaining compatibility with existing chunk loading, HMR, and module export behaviors.

_crates/rspack\_plugin\_runtime/src/runtime\module/runtime · high confidence

Stabilized benchmark execution via mimalloc allocator and controlled thread limits

The benchmarking infrastructure now uses a custom global allocator wrapping mimalloc to prevent non-deterministic memory growth during reallocation, ensuring more consistent benchmark results. Additionally, thread usage is strictly capped: walltime benchmarks are limited to 16 threads, while simulation benchmarks use 8 blocking threads and 1 Rayon thread. The Tokio runtime configuration adapts based on the benchmark mode (walltime vs. simulation) and the CodSpeed profiling environment, ensuring predictable performance characteristics across different testing scenarios.

xtask/benchmark · high confidence

Fixes

12 commits (7 fixes) fixing crates/rspack\_plugin\_module\_replacement

A fix in crates/rspack\_plugin\_module\_replacement — 12 commits (7 fixs), 3 files.

_crates/rspack\_plugin\_module\replacement · medium confidence · unverified

Fixes SWC Wasmtime bytecode cache corruption

The SWC plugin runtime now uses a version-specific serialization identifier (wasmtime-v36) to ensure bytecode caches are invalidated when the Wasmtime engine is upgraded. This change prevents cache corruption issues that could occur if stale, incompatible bytecode was loaded from the filesystem after a Wasmtime version bump.

_crates/rspack\util/src/swc · high confidence

Test coverage

Add Rust benchmark infrastructure and fixtures; Add browser-based E2E test suite for rspack; Added E2E tests for NoEmitOnErrorsPlugin recovery scenarios; Added Rspack-webpack gap tracking skill and test diff script; Added Vue 3 end-to-end test case; Added comprehensive test suite for rspack\_cacheable macros and utilities; Added e2e test cases for CSS chunk loading, empty imports, missing files, and asset hooks; Added e2e test fixtures for CSS, HTML, and React scenarios; Added e2e tests for CSS Hot Module Replacement scenarios; Added e2e tests for dynamic entry removal and shared import scenarios; Added e2e tests for lazy compilation scenarios; Added e2e tests for module loading failures; Added macro integration tests for hooks, plugins, and enums; Added rspack test cases to \tests/rspack-test\; Added test cases for BannerPlugin, DefinePlugin, ProvidePlugin, and SourceMapDevToolPlugin; Added test cases for DefinePlugin process.env destructuring and DotenvPlugin configuration; Added test cases for cache snapshotting with managed and unmanaged paths; Added test cases for chunk group, runtime chunk, and child compiler plugins; Added test cases for minifier and source-map plugin configurations; Added test cases for module hook scenarios; Added test cases for persistent cache symlink invalidation; Added test cases for preserveModules with CSS and assets; Added test cases for rspack plugins and configuration features; Added test cases for server-entry CSS scoping in RSC plugin; Added test cases for static/dynamic imports, entry exports, scope hoisting, and WASM loading; Added test cases for strict namespace object 'this' context; Added test cases for strict this context in dynamic imports and CJS requires; Added test cases for the CircularCheckRspackPlugin; Added test coverage for BannerPlugin hashing interpolation; Added test coverage for CopyRspackPlugin POSIX asset keys; Added test coverage for CopyRspackPlugin with bracketed paths and case-insensitive globbing; Added test coverage for DefinePlugin and child compiler asset handling; Added test coverage for ESM preserve-modules scenarios; Added test coverage for RSC manifest callback and client CSS handling; Added test coverage for RSC plugin with concatenated modules; Added test coverage for RSC plugin worker entries; Added test coverage for child compiler asset emission with JsonpTemplatePlugin; Added test coverage for disabling client API checks in RSC; Added test coverage for html-rspack-plugin integration; Added test coverage for html-rspack-plugin integration with DefinePlugin; Added test coverage for relative resource path in source maps; Added test coverage for server actions preservation in production builds; Added test coverage for the new compiler builder API and loader integration; Added test fixtures for basic, CSS, and React/Preact refresh scenarios; Added test fixtures for conditional reexports, ignore context, and issue \#11335; Added test fixtures for source map generation; Added test fixtures for tsconfig-paths references and unsafe-cache-normalization; Added test for CopyPlugin file dependency normalization; Added test for RSC client barrel tree-shaking behavior; Added test for RSC service without client injection; Added test for copy-plugin context dependency path normalization; Added test for dynamic import with webpackChunkName comment in split-chunks; Added test for empty entry chunk removal in split-chunks; Added test for labeled do-while control flow preservation during minification; Added test for non-ASCII context paths; Added test for relative paths in inline source maps; Added test suite for CircularDependencyRspackPlugin diagnostics; Added tests for CopyRspackPlugin brace expansion in glob patterns; Added tests for CopyRspackPlugin with JavaScript input file system; Added tests for ProgressPlugin structured info object; Added tests for RSC CSS link props configuration; Added tests for RSC server-entry CSS loading and import.meta.rspackRsc support; Added tests for RSC tree-shaking and dynamic client export preservation; Added tests for extractComments regex flags and case sensitivity; Added tests for internal processAssets parameter and dynamic virtual modules; Added tests for mini-css-extract-plugin compatibility; Added tests for source map namespace schemes; Added tests for the CircularCheckRspackPlugin; Added unit tests for RspackRegex functionality; Expanded test coverage for new cache invalidation and snapshot scenarios; Snapshot tests added for default compiler options and error handling.

Dependencies

Update pnpm to v10.24.0

The pnpm package manager has been upgraded to version 10.24.0.

(dependencies) · high confidence

Updated webpack-sources patch for v3.5.3

A new patch file has been added to override the TypeScript type definitions for webpack-sources v3.5.3. This patch modifies the module's export structure by removing the legacy 'declare namespace exports' wrapper and the 'export = exports' statement, aligning the types with modern ES module standards.

patches · high confidence

Housekeeping

Initial repository scaffolding and configuration

The repository has been initialized with essential configuration files, including a pnpm workspace definition with dependency catalogs, a Rust nightly toolchain specification, and a unified Rstack CLI configuration for formatting and linting. It also includes standard project governance and documentation files such as the MIT license, code of conduct, security policy, and contributor guidelines.

(repo-wide) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 58 (-2.1)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.17) — scores are not directly comparable.

Lenses

  • Code Health 78 → 79 (+0.7)
  • Architecture 61 → 64 (+2.4)
  • Maturity 66 → 66 (-0.1)
  • Readiness 54 → 53 (-0.9)
  • Security 70 → 78 (+8.1)
  • Accessibility 70 → 63 (-7.6)
  • Performance 60 (new)

Resolved (103)

  • Change coupling: mod.rs ↔ lib.rs (crates/rspack_binding_api/src/compilation/mod.rs)
  • Change-coupling hub: binding.d.ts → rspack.wasi-browser.js, async_dependency_block.rs, chunk.rs, chunk_graph.rs, entries.rs, mod.rs, dependency.rs, node.rs, module_graph_connection.rs, macros.rs, interceptor.rs, context.rs, raw_banner.rs, raw_copy.rs, raw_devtool.rs, mod.rs, raw_external.rs, raw_optimization.rs, mod.rs, mod.rs, externals.rs, struct.rs, lib.rs, cache_group.rs (crates/node_binding/binding.d.ts)
  • Duplicated block (10 lines × 2) (crates/rspack_core/src/runtime_template.rs)
  • Duplicated block (11 lines × 2) (crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs)
  • Duplicated block (12 lines × 2) (crates/rspack_binding_api/src/lib.rs)
  • Duplicated block (13 lines × 2) (crates/rspack_binding_api/src/compilation/mod.rs)
  • Duplicated block (13 lines × 2) (crates/rspack_napi/src/js_values/weak_ref.rs)
  • Duplicated block (15 lines × 2) (crates/rspack_core/src/external_module.rs)
  • Duplicated block (17 lines × 2) (crates/rspack_plugin_rstest/src/parser_plugin.rs)
  • Duplicated block (21 lines × 2) (crates/rspack_plugin_esm_library/src/split_chunks.rs)
  • Duplicated block (33 lines × 2) (crates/rspack_binding_api/src/plugins/js_loader/mod.rs)
  • Duplicated block (34 lines × 2) (crates/rspack_plugin_esm_library/src/split_chunks.rs)
  • Duplicated block (6 lines × 2) (crates/rspack_core/src/cache/snapshot.rs)
  • Duplicated block (7 lines × 2) (crates/rspack_plugin_javascript/src/dependency/esm/import_dependency.rs)
  • Duplicated block (8–9 lines × 2) (crates/rspack_plugin_rslib/src/dyn_import_external.rs)
  • FileSystemInfo::context_value_inner (cognitive 32) (crates/rspack_core/src/new_cache/snapshot/file_system_info.rs)
  • FileSystemInfo::context_value_inner (cyclomatic 22) (crates/rspack_core/src/new_cache/snapshot/file_system_info.rs)
  • FunctionTooLong: index.createLoaderContext (packages/rspack/src/loader-runner/index.ts)
  • High CVE: [CVE redacted] (pnpm-lock.yaml)
  • High CVE: [CVE redacted] (pnpm-lock.yaml)
  • …and 83 more

New (147)

  • Change coupling: context.rs ↔ mod.rs (crates/rspack_core/src/compilation/build_module_graph/graph_updater/repair/context.rs)
  • Change-coupling hub: binding.d.ts → rspack.wasi-browser.js, async_dependency_block.rs, chunk.rs, chunk_graph.rs, entries.rs, mod.rs, dependency.rs, module_graph_connection.rs, macros.rs, interceptor.rs, context.rs, raw_banner.rs, raw_copy.rs, raw_devtool.rs, mod.rs, raw_external.rs, raw_optimization.rs, mod.rs, mod.rs, externals.rs, struct.rs, lib.rs, cache_group.rs (crates/node_binding/binding.d.ts)
  • CodeSplitter::can_reuse_affected_module (cyclomatic 16) (crates/rspack_core/src/compilation/build_chunk_graph/code_splitter.rs)
  • Combinator::prepare_direct_groups (cognitive 18) (crates/rspack_plugin_split_chunks/src/plugin/module_group.rs)
  • Dependency hygiene PARTLY measured — Cargo dependencies read, no committed lock to grade for currency
  • Duplicate intent with inconsistent naming and signature style. has_white_space is a property (note the typo 'white' vs 'whitespace'), while has_whitespace() is a method. They likely check the same underlying state.
  • Duplicated block (10 lines × 2) (crates/rspack_binding_api/src/lib.rs)
  • Duplicated block (11 lines × 2) (crates/rspack_binding_api/src/compilation/mod.rs)
  • Duplicated block (11 lines × 2) (crates/rspack_core/src/runtime_template.rs)
  • Duplicated block (11 lines × 2) (crates/rspack_plugin_mf/src/sharing/consume_shared_plugin.rs)
  • Duplicated block (11 lines × 2) (crates/rspack_plugin_rstest/src/import_dependency.rs)
  • Duplicated block (12 lines × 2) (crates/rspack_plugin_esm_library/src/optimize_chunks.rs)
  • Duplicated block (13 lines × 2) (crates/rspack_plugin_esm_library/src/split_chunks.rs)
  • Duplicated block (5 lines × 3) (crates/rspack_plugin_esm_library/src/split_chunks.rs)
  • Duplicated block (6 lines × 2) (crates/rspack_core/src/options/snapshot.rs)
  • Duplicated block (6 lines × 2) (crates/rspack_plugin_javascript/src/parser_plugin/common_js_imports_parse_plugin.rs)
  • Duplicated block (7 lines × 2) (crates/rspack_binding_api/src/fs_node/write.rs)
  • Duplicated block (7 lines × 2) (crates/rspack_plugin_rstest/src/plugin.rs)
  • Duplicated block (7 lines × 4) (crates/rspack_plugin_esm_library/src/optimize_chunks.rs)
  • Duplicated block (8 lines × 2) (crates/rspack_core/src/artifacts/code_generate_cache_artifact.rs)
  • …and 127 more

Changes since last survey

  • 153 commits — 105 feature/other, 48 fixes

By area

  • tests/rspack-test — 80 commits
  • (root) — 15 commits
  • crates/rspack_core — 15 commits
  • packages/rspack — 11 commits
  • crates/rspack_binding_api — 5 commits
  • .github/workflows — 3 commits
  • packages/rspack-cli — 3 commits
  • packages/rspack-test-tools — 3 commits
  • tests/e2e — 3 commits
  • website/docs — 3 commits
  • crates/css-module-lexer — 1 commit
  • crates/rspack_collections — 1 commit
  • crates/rspack_loader_runner — 1 commit
  • crates/rspack_napi — 1 commit
  • crates/rspack_plugin_css — 1 commit
  • crates/rspack_plugin_javascript — 1 commit
  • crates/rspack_plugin_real_content_hash — 1 commit
  • crates/rspack_plugin_split_chunks — 1 commit
  • crates/rspack_resolver — 1 commit
  • packages/create-rspack — 1 commit

Notable commits

  • fix: fix(bench): exclude compiler teardown from runtime requirements (#15813)
  • fix: fix(binding): release loader TSFNs on compiler close (#15735)
  • fix: fix(cli): enable compile cache before loading CLI (#15903)
  • fix: fix(cli): initialize profiling once for multiple configs (#15829)
  • fix: fix(core): make module source maps context independent (#15671)
  • fix: fix(html): keep the doctype when a comment is above it (#15778)
  • fix: fix(loader): avoid mutating lightningcss-loader options (#15900)
  • fix: fix(loader): normalize builtin options for inline requests (#15909)
  • fix: fix(loader): preserve string BOM across native boundaries (#15632)
  • fix: fix(loader): revert native loader hook invocation (#15719)
  • fix: fix(resolve): resolve relative tsconfig paths against cwd (#15713)
  • fix: fix(rslib): render externalized new URL targets as plain relative URLs (#15670)
  • fix: fix(rstest): resolve manual mocks next to package entries (#15689)
  • fix: fix(rstest): resolve mock APIs through the runtime registry (#15823)
  • fix: fix(rstest): transform non-hoisted mock APIs in expression position (#15877)
  • fix: fix(types): accept entry dependencies in ModuleGraph queries (#15896)
  • fix: fix(types): accept falsy loaders and child compiler plugins (#15912)
  • fix: fix(types): align externals function signatures (#15857)
  • fix: fix(types): allow Node fs as intermediate file system (#15895)
  • fix: fix(types): allow RegExp resolve restrictions and migrate configs (#15819)
  • …and 133 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

web-infra-dev/rspack was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 29 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit ec86d0386bafa39ff6cef9cbd91e7224f96603f0 — the exact code this score is about.
  • Scored under rubric-2026.09.17 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-70910855e4b4.