Skip to content

fix: compatible with Rsbuild v2#37

Merged
chenjiahan merged 1 commit intomainfrom
work_with_v2_0228
Feb 28, 2026
Merged

fix: compatible with Rsbuild v2#37
chenjiahan merged 1 commit intomainfrom
work_with_v2_0228

Conversation

@chenjiahan
Copy link
Member

  • Upgraded @rsbuild/core from version 1.6.10 to 2.0.0-beta.4
  • Compatible with Rsbuild v2

Copilot AI review requested due to automatic review settings February 28, 2026 09:45
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 upgrading the project's build system to be compatible with Rsbuild v2. It involves updating the primary @rsbuild/core package and its related plugins to their latest beta versions. To ensure a smooth transition and continued functionality, conditional logic has been implemented to handle potential differences in Rsbuild's internal configuration structure between versions. The dependency lockfile has also been thoroughly updated to reflect these changes and maintain a stable build environment.

Highlights

  • Rsbuild v2 Upgrade: The core build tool, @rsbuild/core, has been upgraded from version 1.6.10 to 2.0.0-beta.4, along with corresponding updates to its associated plugins (@rsbuild/plugin-less, @rsbuild/plugin-sass, @rsbuild/plugin-stylus).
  • Compatibility Logic: New logic was introduced in src/index.ts to dynamically adapt rule chaining based on the Rsbuild version, ensuring compatibility with both v1 and v2 of the framework.
  • Dependency Lockfile Updates: The pnpm-lock.yaml file was extensively updated to reflect the new versions of @rsbuild packages, introduce new @rspack/binding versions, and update sass-embedded dependencies, ensuring consistent dependency resolution.
  • Git Ignore Update: Added test-temp-* to the .gitignore file to prevent temporary test files from being committed.

🧠 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
  • .gitignore
    • Added test-temp-* to the ignore list.
  • package.json
    • Updated @rsbuild/core from ^1.6.10 to ^2.0.0-beta.4.
    • Updated @rsbuild/plugin-less from ^1.5.0 to ^1.6.0.
    • Updated @rsbuild/plugin-sass from ^1.4.0 to ^1.5.0.
    • Updated @rsbuild/plugin-stylus from ^1.2.0 to ^1.3.0.
  • pnpm-lock.yaml
    • Updated various @rsbuild and sass-embedded package versions.
    • Added new @rspack/binding versions (2.0.0-beta.3) for multiple platforms.
    • Removed buffer-builder@0.2.0 dependency.
    • Updated peer dependency ranges for @rsbuild/plugin-less, @rsbuild/plugin-sass, and @rsbuild/plugin-stylus to include Rsbuild v2.
  • src/index.ts
    • Introduced isV1 variable to check Rsbuild version.
    • Modified rule chaining logic to differentiate between Rsbuild v1 and v2 configurations.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates @rsbuild/core and its related dependencies to version 2 to ensure compatibility. The changes primarily involve dependency version bumps and a small logic adjustment in src/index.ts to accommodate API differences in Rsbuild v2. The changes look good, but I have one suggestion to improve the readability of the new compatibility logic.

@chenjiahan chenjiahan merged commit e324880 into main Feb 28, 2026
7 checks passed
@chenjiahan chenjiahan deleted the work_with_v2_0228 branch February 28, 2026 09:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates this plugin’s development dependencies and bundler-chain integration to work with Rsbuild v2 while retaining compatibility with Rsbuild v1.

Changes:

  • Upgraded @rsbuild/core to the 2.0.0-beta line and bumped related @rsbuild/plugin-* dev dependencies.
  • Adjusted bundler-chain rule selection in pluginTypedCSSModules to handle Rsbuild v2’s rule structure.
  • Updated lockfile and ignored temporary test directories.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/index.ts Adds Rsbuild v1/v2 branching when selecting the CSS rule to inject the typed CSS modules loader.
package.json Bumps Rsbuild-related devDependencies to versions compatible with Rsbuild v2 betas.
pnpm-lock.yaml Captures the resolved Rsbuild/Rspack beta dependency graph and related upgrades.
.gitignore Ignores test-temp-* directories created by tests.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to +41
"@rsbuild/core": "^2.0.0-beta.4",
"@rsbuild/plugin-less": "^1.6.0",
"@rsbuild/plugin-sass": "^1.5.0",
"@rsbuild/plugin-stylus": "^1.3.0",
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rsbuild/core@2.x requires Node ^20.19.0 || >=22.12.0 (per the lockfile). If contributors run pnpm install on older Node versions they’ll hit hard engine errors; consider documenting the required Node version for development (or adding an engines/tooling hint) alongside the devDependency upgrade.

Copilot uses AI. Check for mistakes.
"@rsbuild/plugin-less": "^1.6.0",
"@rsbuild/plugin-sass": "^1.5.0",
"@rsbuild/plugin-stylus": "^1.3.0",
"@rsbuild/plugin-type-check": "^1.3.1",
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rsbuild/plugin-type-check@1.3.1 declares a peer dependency on @rsbuild/core 1.x (see pnpm-lock.yaml), but this PR upgrades the workspace dev dependency to @rsbuild/core 2.x. This will produce unmet peer dependency warnings and may indicate real incompatibility; consider upgrading @rsbuild/plugin-type-check to a release that supports Rsbuild v2 or removing it if it’s not used in this repo.

Suggested change
"@rsbuild/plugin-type-check": "^1.3.1",
"@rsbuild/plugin-type-check": "^2.0.0-0",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants