refactor(commands): unify webpack and Rspack commands - #1424
Open
jbroma wants to merge 11 commits into
Open
Conversation
… and --bundler option Add Bundler type alias, CompilerInterface and CompilerAsset to the shared types.ts. Remove duplicate CompilerAsset definitions from rspack/types.ts and webpack/types.ts. Add --bundler <string> CLI option to both startCommandOptions and bundleCommandOptions. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add detectBundler() utility that determines the bundler engine with the following priority: 1. Explicit --bundler flag 2. Custom config path filename inference (rspack.* vs webpack.*) 3. Config file discovery (rspack configs checked first) 4. Default: rspack Co-Authored-By: Claude Opus 4.6 <[email protected]>
Webpack Compiler: - Remove EventEmitter inheritance - Add platforms property and devServerContext with late-init - Add setDevServerContext() and start() (no-op) methods - Internalize event handling: worker messages now call devServerContext.notifyBuildStart/End and broadcastToHmrClients directly instead of emitting events - Constructor now takes platforms as first argument Rspack Compiler: - Add 'implements CompilerInterface' declaration - Import CompilerAsset from shared types Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ction Add unified bundle.ts and start.ts that merge the rspack and webpack implementations, using detectBundler() and dynamic imports to select the correct engine at runtime. Add commands/index.ts exporting the unified command definitions and a createBoundCommands() helper for deprecated entry points. Add commands/index.js and commands/index.d.ts as the new primary CJS entry point. Update commands/rspack.js and commands/webpack.js to be deprecation wrappers that delegate via createBoundCommands(). Add './commands' export to package.json (alongside existing wildcard). Delete old bundler-specific files: - rspack/bundle.ts, rspack/start.ts, rspack/index.ts - webpack/bundle.ts, webpack/start.ts, webpack/index.ts Co-Authored-By: Claude Opus 4.6 <[email protected]>
Update init package: - Remove bundler parameter from modifyReactNativeConfig() - Use '@callstack/repack/commands' instead of bundler-specific paths Simplify react-native.config.js in all test apps to use the unified import instead of conditional require based on USE_WEBPACK env var. Update integration tests to import from '@callstack/repack/commands' instead of separate rspack/webpack command sets. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
@jbroma is attempting to deploy a commit to the Callstack Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 39d67ef 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 |
jbroma
marked this pull request as ready for review
July 29, 2026 20:22
Member
|
he's back! |
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.
Summary
@callstack/repack/commandsentry point with automatic bundler detection and a validated--bundleroverridestartandbundlecommand orchestration and dev-server delegate while preserving the separate Rspack and webpack compiler implementationsWhy
The command registries and most command orchestration were duplicated even though both bundlers already shared the config and dev-server layers. This gives users one stable command entry point while keeping each bundler's deliberately different execution model behind a small shared compiler interface.
Related to #1421. This PR intentionally does not merge compiler internals,
defineConfighelpers, or bundler configuration templates: those remain bundler-specific where their types and runtime behavior differ.Validation
@callstack/repack: 31 Jest suites, 290 tests, and 22 snapshots passedtester-app,tester-federation, andtester-federation-v2, including async chunks, miniapp lifecycle, and both Module Federation gallery flows