Skip to content

feat: update rsbuild 2.0.0-beta.8#20

Merged
SyMind merged 3 commits intomainfrom
update-rsbuild
Mar 14, 2026
Merged

feat: update rsbuild 2.0.0-beta.8#20
SyMind merged 3 commits intomainfrom
update-rsbuild

Conversation

@SyMind
Copy link
Collaborator

@SyMind SyMind commented Mar 14, 2026

This pull request updates @rsbuild/core to version 2.0.0-beta.8 and adapts the codebase to the API changes introduced in this new version. The changes primarily involve migrating from dev.setupMiddlewares to the new server.setup API in rsbuild.config.ts files and updating how environments are accessed in the dev server.

@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 primarily focuses on upgrading the project's core build tool, @rsbuild/core, to its latest beta version. This upgrade necessitated a significant refactoring of server configuration across various project examples and the internal plugin, adapting to a new API for middleware setup. The changes ensure compatibility with the updated build system and include a minor functional addition to an example component.

Highlights

  • Dependency Update: Updated the @rsbuild/core dependency across the project to version 2.0.0-beta.8, along with corresponding updates in pnpm-lock.yaml to reflect the new canary versions of @rsbuild/core and @rspack/core bindings.
  • Configuration API Refactor: Refactored rsbuild.config.ts files in various examples and e2e tests to migrate from the deprecated dev.setupMiddlewares API to the new server.setup API for configuring server-side middlewares.
  • Internal Plugin Logic Update: Modified the core pluginRSC logic in src/index.ts to align with the new server.setup API, specifically for handling source map requests and accessing environment-specific APIs.
  • Example Component Enhancement: Added an error prop to the Dialog component in examples/server/src/Dialog.tsx and provided a default error message when used in examples/server/src/Todos.tsx.

🧠 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
  • e2e/integration/mixed-directives/rsbuild.config.ts
    • Refactored server middleware configuration from dev.setupMiddlewares to server.setup.
    • Updated environment bundle loading from serverAPI.environments.server.loadBundle to server.environments.server.loadBundle.
  • e2e/package.json
    • Updated @rsbuild/core dependency from ^2.0.0-beta.7 to ^2.0.0-beta.8.
  • examples/client/package.json
    • Updated @rsbuild/core dependency from ^2.0.0-beta.7 to ^2.0.0-beta.8.
  • examples/client/rsbuild.config.ts
    • Refactored server middleware configuration from dev.setupMiddlewares to server.setup.
    • Updated environment bundle loading from serverAPI.environments.server.loadBundle to server.environments.server.loadBundle.
  • examples/server/package.json
    • Updated @rsbuild/core dependency from ^2.0.0-beta.7 to ^2.0.0-beta.8.
  • examples/server/rsbuild.config.ts
    • Refactored server middleware configuration from dev.setupMiddlewares to server.setup.
    • Removed the output.minify: false configuration.
    • Updated environment bundle loading from serverAPI.environments.server.loadBundle to server.environments.server.loadBundle.
  • examples/server/src/Dialog.tsx
    • Added an error prop to the Dialog component's interface and destructuring.
    • Included a console.log statement to display the error prop.
  • examples/server/src/Todos.tsx
    • Passed a new error prop with a default Error object to the Dialog component.
  • examples/static/package.json
    • Updated @rsbuild/core dependency from ^2.0.0-beta.4 to ^2.0.0-beta.8.
  • examples/static/rsbuild.config.ts
    • Refactored server middleware configuration from dev.setupMiddlewares to server.setup.
    • Updated environment bundle loading from serverAPI.environments.server.loadBundle to server.environments.server.loadBundle.
  • package.json
    • Updated @rsbuild/core dependency from ^2.0.0-beta.7 to ^2.0.0-beta.8.
  • pnpm-lock.yaml
    • Updated the @rsbuild/core version to 2.0.0-canary-20260309140114.
    • Added new @rspack-canary binding packages for various platforms (darwin, linux, wasm32, win32).
    • Updated @rsbuild/plugin-react and rsbuild-plugin-arethetypeswrong to reference the new @rsbuild/core canary version.
    • Updated @rspack/core reference to @rspack-canary/core.
  • src/index.ts
    • Refactored dev.setupMiddlewares to server.setup and server.middlewares.use for middleware registration.
    • Updated URL handling for the source map endpoint, including a non-null assertion for req.url.
    • Modified environment API access from serverAPI.environments[targetEnv] to server.environments[rsbuildEnvName], incorporating pluginOptions.environments.
Activity
  • No specific activity (comments, reviews, progress) has been recorded for 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 to version 2.0.0-beta.8 and adapts the codebase to the API changes introduced in this new version. The changes primarily involve migrating from dev.setupMiddlewares to the new server.setup API in rsbuild.config.ts files and updating how environments are accessed in the dev server.

My review has identified a few areas for improvement:

  • A leftover console.log statement in an example component that should be removed.
  • A potentially unsafe non-null assertion in the source map middleware that could be made safer.
  • A @ts-expect-error comment that, while possibly necessary for now, should be tracked for removal in the future.

Overall, the dependency update and necessary code migrations seem to be handled correctly.

@SyMind SyMind merged commit 573c631 into main Mar 14, 2026
4 checks passed
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.

1 participant