Repository navigation
feat(bundler)!: migrate to Rspack 2 - #116
Merged
Merged
Conversation
Run Jest through the shared ESM wrapper and convert module mocks, raw templates and test paths to native ESM. Load the configuration from jest.config.mjs and use the built private style loader so build tests also work on Node 22.12. Remove the storage resolver workaround, the CJS style-loader substitute and the unused ts-node dependency. Keep the background finder doubles local to their tests and document the test runner requirements. Preserve coverage with real Rspack and loaders. Validate the migration against Rspack 1.7 before upgrading the bundler, then check Node 22.12 and Node 24.
Upgrade Rspack to ~2.2.9 and replace the Rsdoctor integration with @rsdoctor/core.
Adapt isolated CSS loading to the new runtime and update emitted text assets
through RawSource and compilation.updateAsset.
Set development builds to cheap-module-source-map and production builds to
devtool: false before applying plugin configuration. Keep watch source maps
inline. Preserve project-root resolution for root-relative CSS and SCSS URLs.
Keep missing exports as build errors in the base bundler configuration. Collect
TypeScript export metadata and use tolerant type re-export validation for
TypeScript modules compiled by the built-in SWC loader.
Cover local and package type re-exports, missing value exports, CSS and SCSS
root-relative URLs, source map defaults and plugin overrides with integration
tests. Verify the isolated CSS runtime and preserve Jest support on Node 22.12.
BREAKING CHANGE: Builds now use the ESM-only Rspack 2 API. Custom bundler plugins
must support Rspack 2. Development builds emit external .map files instead of
eval wrappers unless overridden through bundler configuration. Missing value
exports now fail the build; use named exports that exist, or a side-effect
import for a ?asis module. Re-export types from packages that ship JavaScript
and .d.ts declarations with explicit export type, for example:
export type {UserConfig} from "adnbn". The bundler cannot infer these type-only
exports from package declarations. The built-in SWC loader no longer reads .swcrc;
move required SWC options into the builtin:swc-loader configuration supplied
by a framework plugin. The supported Node.js minimum remains 22.12.0.
Write selection JSON to a sibling temporary file and rename it into place so watchRun cannot parse the empty or partial contents of an in-progress write. Preserve the stale-result scenario and every isolation transition assertion. Reproduce the partial-write failure deterministically and verify the same interleaving after the fix. Pass 20 runs across Node 22.12 and Node 24 with four concurrent processes, related style-routing tests and typechecking.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Upgrade to Rspack ~2.2.9 and @rsdoctor/core, adapting isolated CSS loading to the new runtime and updating emitted text assets through RawSource and compilation.updateAsset. Fail the build with a diagnostic if the expected CSS runtime changes.
Set source-map defaults explicitly, preserve project-root resolution for root-relative CSS and SCSS URLs, and keep missing value exports as errors while tolerating type re-exports from TypeScript modules compiled by SWC.
Migrate Jest to native ESM while retaining real compiler and loader coverage and Node.js 22.12 support. Publish selective-split watch fixture state atomically to prevent partially written JSON from causing intermittent failures.
Breaking changes
.mapfiles instead of eval wrappers unless a plugin overrides the configuration. Watch source maps remain inline.?asismodule.export type {UserConfig} from "adnbn"; the bundler cannot infer type-only exports from package.d.tsfiles..swcrc; supply required options through the framework plugin'sbuiltin:swc-loaderconfiguration.Validation
The three commits separate Jest infrastructure, the Rspack migration, and the watch-test race fix.