chore: upgrade @rspack/core to 2.0.0-beta.2#76
Conversation
- Upgrade @rspack/core from 1.7.1 to 2.0.0-beta.2 - Switch tsconfig module/moduleResolution to CommonJS/node for CJS compatibility - Replace legacy `libraryTarget` with modern `library.type` API (rspack 2.0 no longer supports the legacy API) - Fix Schema type import from schema-utils - Update test snapshots
Summary of ChangesHello @LingyuCoder, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a significant upgrade of the core Rspack dependency to its Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request upgrades @rspack/core to a new major beta version and applies necessary fixes for breaking changes. The changes look good and correctly address the breaking changes from the dependency upgrade, such as migrating the libraryTarget API and updating TypeScript configurations. I have one suggestion to improve type safety for the Schema type in src/types.ts, which was changed to any as part of the fix.
There was a problem hiding this comment.
Pull request overview
This PR upgrades @rspack/core from version 1.7.1 to 2.0.0-beta.2 and addresses several breaking changes introduced by the new version. The upgrade includes migrating to modern library configuration syntax, adjusting TypeScript compilation settings, fixing type imports, and updating test snapshots to reflect new rspack output. However, the PR introduces critical test failures and has potential compatibility issues.
Changes:
- Upgrade
@rspack/coredependency to 2.0.0-beta.2 with corresponding package version bump to 2.0.0-beta.0 - Migrate all
libraryTargetconfigurations to modernlibrary: { type }object format required by rspack 2.0 - Switch TypeScript module system from NodeNext to CommonJS and adjust Schema type handling
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Bumps package version to 2.0.0-beta.0 and upgrades @rspack/core to 2.0.0-beta.2 |
| pnpm-lock.yaml | Updates lockfile with rspack 2.0.0-beta.2 dependencies and bindings |
| tsconfig.json | Changes module resolution from NodeNext to CommonJS for compatibility with rspack 2.0 |
| src/types.ts | Replaces Schema type import with generic Record type due to module resolution changes |
| src/server.ts | Adds assets: true parameter to toJson() calls and improves WebSocket type casting |
| scripts/build-client-modules.cjs | Migrates sockjs-client build from legacy libraryTarget to modern library object format |
| tests/fixtures/module-federation-config/*.js | Updates test fixtures to use modern library configuration syntax |
| tests/fixtures/worker-config-dev-server-false/public/worker-bundle.js | Updates test fixture with new rspack 2.0 runtime output |
| tests/e2e/snapshots/app.test.js.snap.webpack5 | Updates snapshots showing spdy server test failures with SyntaxErrors |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The previous snapshots were recorded when spdy was temporarily broken, capturing SyntaxError as expected behavior. Regenerate with correct output.
Summary
Upgrade
@rspack/corefrom 1.7.1 to 2.0.0-beta.2 and fix all breaking changes introduced by the new version:libraryTargetstring API. All usages (sockjs-client build script and module federation test fixtures) are migrated to the modernoutput.libraryobject format (e.g.library: { type: 'umd' }).module: "CommonJS",moduleResolution: "node") for compatibility with the existing CJS-based test infrastructure and runtimerequire()calls.Schematype import that failed under the new module resolution.Checklist