Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: b1b83ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
dannyhw
added this pull request to stack #1491
October 9, 2026 23:41
Raise the @rspack/core peer to >=2 and build and test against 2.2.8. Map the options Rspack 2 renamed or removed: - Stop setting experiments.parallelLoader, which Rspack 2 removed. Parallel loading is opted into per rule with `parallel: true`. The babel-swc-loader warning about it could no longer fire, so it is removed together with the hideParallelModeWarning option. - Rspack 2 passes parallel loaders a correct rootContext and the compiler's bundled SWC, so the babel-swc-loader uses both directly. - REPACK_EXPERIMENTAL_CACHE sets and --reset-cache reads the top-level `cache` option, as Rspack 2 silently ignores experiments.cache. - Fix the type fallout: a non-union SwcConfig for the babel-swc-loader, InputFileSystem-typed reads in the assets loader, and narrowing the now `false | DevServer` devServer option. Jest loads the ESM-only core through a custom test environment, and the integration markers and snapshots follow Rspack 2's output.
Rspack 2 changed the default of module.parser.javascript.exportsPresence to 'error', which fails builds on missing-export imports that React Native itself ships, such as `React.unstable_Activity` in renderApplication.js. Default it to 'auto', matching webpack and Rspack 1. Projects can still override it.
Published Rspack 2 binaries are built without the perfetto trace layer, so `RSPACK_PROFILE` crashed `start` unless RSPACK_TRACE_LAYER was set. Default to the logger layer, and drop the handler for Rspack < 1.4.
The SWC minimizer was only picked for Rspack 1.4.11, which Re.Pack no longer supports, so the minimizer no longer depends on the bundler.
Rspack 2's stats.toJson() leaves out assets, chunks, chunk groups, entrypoints and modules unless they are asked for, even with the `normal` preset. When the project has no stats config, request them explicitly so `bundle --json` writes the same stats as before.
Rspack 2 joins a module's absoluteResourcePath from the context without resolving it, so files outside the project root, such as hoisted node_modules in a monorepo, were named `<context>/../../...` in source maps built without a dev server. Normalize the path.
…e source Rspack 2 percent-encodes the resource path of the Module Federation runtime `data:` module, so the malformed `webpack://` source it produces no longer matched the raw prefix and was not renamed to `webpack://module-federation/virtual-runtime-<hash>.js`.
Replace experiments.parallelLoader with per-rule `parallel: true`, drop hideParallelModeWarning, list the exportsPresence default, and add a Rspack 2 section to the Re.Pack 5 migration guide.
dannyhw
force-pushed
the
dannyhw/rspack-2
branch
from
October 12, 2026 10:31
8454e13 to
23a654c
Compare
…lugin snapshots Rspack 2 inlines the MF v2 bundler runtime as a URL-encoded data: URI, which put an absolute local path in the snapshot, and colors inlined error messages when color output is enabled, as it is on CI.
This branch was successfully deployed
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.
Stacked on #1487 (
dannyhw/v6).Summary
Re.Pack 6 requires
@rspack/core2 (peer>=2) and drops Rspack 1. There's no runtime branching on the Rspack major. The change maps the options Rspack 2 renamed or moved, fixes the type fallout, and removes the Rspack 1 workarounds. webpack is unaffected. New projects from@callstack/repack-initget@rspack/core@^2.Mapped options
experiments.parallelLoader: Rspack 2 removed it, so Re.Pack no longer sets it. Loaders run in parallel when their rule setsparallel: true, which the templates and tester apps already do.hideParallelModeWarningoption are removed.experiments.cache: Rspack 2 ignores it silently, soREPACK_EXPERIMENTAL_CACHEproduced no persistent cache. It now sets top-levelcache: { type: 'persistent' }.--reset-cachereads top-levelcachefor both bundlers.resetPersistentCachelost its per-bundler overloads and casts.exportsPresence: Rspack 2's default is'error', which fails on missing-export imports that React Native itself ships (React.unstable_ActivityinrenderApplication.js). Re.Pack setsmodule.parser.javascript.exportsPresence: 'auto'for Rspack.RSPACK_PROFILE: it crashedstartbecause published v2 binaries have no perfetto layer. It now defaults to theloggerlayer. The pre-1.4 profile handler is gone.Rspack 2 behaviour changes handled
bundle --json:stats.toJson()now leaves out assets, chunks, chunk groups, entrypoints and modules unless asked for, even withpreset: 'normal'. With no stats config, Re.Pack requests them explicitly. User presets are passed through.absoluteResourcePathis now<context>/../../...and isn't resolved.SourceMapPluginnormalizes it.repack-expo: the Module Federation runtimedata:module's resource path is now percent-encoded. The Expo source map fix matches the encoded form.Types
SwcLoaderOptionsis now a union ondetectSyntax, so the loader uses its own non-unionSwcConfig.assetsLoader: it reads through small promise wrappers typed againstInputFileSystem, becauseutil.promisifypicks the wrong overload of the v2 types.RepackTargetPlugin:devServeris nowfalse | DevServer, so it's narrowed before readinghot.Rspack 1 workarounds removed
rootContextworkaround and the@rspack/corefallback lookup for SWC. Rspack 2 passes parallel loaders the rightrootContextand_compiler.rspack.experiments.swc(checked in serial and parallel mode).Tests and infra
jest.environment.jsplus amoduleNameMapperbridge).// repack/polyfillsembed_federation_runtime. MF still initializes in__webpack_require__.x(), after the polyfills, in both the test bundle and the real host bundle (MF 2.9.2).exportsPresencedefaultSourceMapPluginpath normalization: a real Rspack compile that fails without the fix^2.2.8. The old "1.6.2+ breaks MF v2 polyfill ordering; 1.6.4+ fails typecheck" notes don't apply to 2.2.8.@swc/helpersis^0.5.23, the Rspack 2 peer.Docs
parallelLoader→ per-ruleparallel: truein the configuration guide and the babel-loader / babel-swc-loader pagesexportsPresenceagent_contextdesign doc rewritten for the single-major approachKnown issue (upstream, not fixed here)
In tester-app production bundles, 9 of about 1100 source map sources point one directory too shallow, e.g.
apps/packages/repack/dist/modules/InitializeScriptManager.js. The affected sources are Re.Pack's own runtime modules, reached through the workspace symlinkapps/tester-app/node_modules/@callstack/repack -> ../../../../packages/repack.resourcePathfor these modules. The wrong path is what you get by resolving the link target against the link instead of its directory.require.contextmodule that was already wrong on 1.6.[projectRoot]sources resolve.Verification
Run on Rspack 2.2.8, Node 26:
Checks:
pnpm build,pnpm typecheck,pnpm lint:ciandpnpm test, all with--force. All pass, including:Bundles:
apps/tester-federation-v2/configs/*.mts, iOS + Android each: Rspack host, mini and expo-host-widget, webpack host and minibundle --jsonwrites assets/chunks/modules again, and--stats minimalis respectedDev server:
startserves iOS + AndroidREPACK_EXPERIMENTAL_CACHE=1writesnode_modules/.cache/rspack: cold compile 11.2s, warm 2.7s--reset-cachedeletes that directoryRSPACK_PROFILE=OVERVIEWemits logger traces with no perfetto crashNative apps: tester-app Debug ran against the Rspack 2 dev server on the iOS simulator (iPhone 17 Pro, iOS 27) and the Android emulator (Pixel 9).
src/App.tsxhot-updated the screen in place on both platforms, with component state kept.main.<hash>.hot-update.json, with no bundle reload.[HMRClient] Processing bundle update.I also checked out the first commit on its own: it typechecks and passes its Jest suite (340).