Skip to content

feat: compatible with Rspack 2.x, Rsbuild 2.x, Modern.js 3.x#439

Merged
fi3ework merged 1 commit intomainfrom
m3
Feb 24, 2026
Merged

feat: compatible with Rspack 2.x, Rsbuild 2.x, Modern.js 3.x#439
fi3ework merged 1 commit intomainfrom
m3

Conversation

@fi3ework
Copy link
Copy Markdown
Member

@fi3ework fi3ework commented Feb 17, 2026

compatible with Rspack 2.x, Rsbuild 2.x, Modern.js 3.x. since only a few breaking changes there, we can do a minimal compatible inside instead of release a major version.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @fi3ework, 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 dependency upgrade across the project, ensuring compatibility with the latest major versions of key build tools like Rspack, Rsbuild, and Modern.js. A major addition is the implementation of Chromatic stats compatibility, which standardizes build output for improved visual testing workflows. These changes collectively enhance the project's maintainability, leverage new features from updated tools, and streamline the development and testing processes.

Highlights

  • Dependency Updates: Updated various packages across the repository to support newer major versions of @rsbuild/core (to ^2.0.0-0), @modern-js/app-tools (to ^3.0.0-0), and @rspack/core (to ^2.0.0-0). This includes both devDependencies and peerDependencies to ensure broad compatibility.
  • Chromatic Stats Compatibility: Introduced a new utility (chromatic-stats.ts) to normalize build statistics for Chromatic's TurboSnap feature. This ensures that module IDs and reasons are correctly formatted, improving the efficiency and accuracy of visual testing.
  • Modern.js Module Federation V3 Support: The modernjs-react-mf sandbox has been upgraded to use @module-federation/modern-js-v3, reflecting compatibility with the latest version of Modern.js's module federation capabilities.
  • Rspack 2.x Compatibility: Adjusted the iframe-rsbuild.config.ts to conditionally apply config.experiments.outputModule = false only for Rspack major version 1, ensuring proper behavior and compatibility with Rspack 2.x.
  • Testing Enhancements: Added new unit and integration tests for Chromatic stats compatibility and refined existing sandbox configuration tests to target built files for GFM MDX compile checks, improving test robustness.

🧠 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
  • packages/addon-modernjs/package.json
    • Updated @modern-js/app-tools and @rsbuild/core dev and peer dependencies to support newer major versions.
  • packages/addon-modernjs/src/preset.ts
    • Added BuilderAdapterParams type.
    • Removed 'shared' generic from AppTools type.
    • Updated adapterParams typing for appContext and normalizedConfig.
  • packages/addon-rslib/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • packages/builder-rsbuild/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • packages/builder-rsbuild/src/chromatic-stats.ts
    • Added a new file to handle Chromatic minimal stats contract compatibility, including functions to normalize module paths, reasons, and module entries.
  • packages/builder-rsbuild/src/index.ts
    • Imported withStatsJsonCompat and applied it to the stats object returned by the build process.
    • Changed isObject type definition to Record<string, unknown>.
  • packages/builder-rsbuild/src/preview/iframe-rsbuild.config.ts
    • Added getRspackMajorVersion utility function.
    • Conditionally applied config.experiments.outputModule = false only for Rspack v1.
  • packages/builder-rsbuild/tests/chromatic-stats.test.ts
    • Added new unit tests for withChromaticMinimalContract and withStatsJsonCompat.
  • packages/framework-html/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • packages/framework-react-native-web/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • packages/framework-react/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • packages/framework-vue3/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • packages/framework-web-components/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • packages/rsbuild-plugin-react-native-web/package.json
    • Updated @rsbuild/core dev and peer dependencies.
  • sandboxes/lit/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/modernjs-react-mf/host/modern.config.ts
    • Switched from @module-federation/modern-js to @module-federation/modern-js-v3.
    • Removed explicit bundler: 'rspack' from appTools configuration.
  • sandboxes/modernjs-react-mf/host/module-federation.config.ts
    • Switched from @module-federation/modern-js to @module-federation/modern-js-v3.
  • sandboxes/modernjs-react-mf/host/package.json
    • Updated @modern-js/app-tools, @module-federation/modern-js (to -v3), and @rsbuild/core dev dependencies.
  • sandboxes/modernjs-react-mf/host/src/module-federation.d.ts
    • Added a new declaration file for remote module federation.
  • sandboxes/modernjs-react-mf/host/tsconfig.json
    • Included @mf-types/**/* in the include array.
  • sandboxes/modernjs-react-mf/remote/modern.config.ts
    • Switched from @module-federation/modern-js to @module-federation/modern-js-v3.
    • Simplified appTools plugin configuration.
  • sandboxes/modernjs-react-mf/remote/module-federation.config.ts
    • Switched from @module-federation/modern-js to @module-federation/modern-js-v3.
  • sandboxes/modernjs-react-mf/remote/package.json
    • Reordered private field.
    • Updated @modern-js/app-tools and @module-federation/modern-js (to -v3) dev dependencies.
  • sandboxes/modernjs-react/modern.config.ts
    • Refactored defineConfig to a plain object export.
    • Removed CliPluginFuture type assertions.
    • Removed explicit bundler: 'rspack' from appTools configuration.
  • sandboxes/modernjs-react/package.json
    • Updated @modern-js/app-tools and @rsbuild/core dev dependencies.
  • sandboxes/react-16/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/react-18/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/react-18/tests/chromatic.test.ts
    • Updated acceptedReasonTokens to include more module name variations for lazy modules.
  • sandboxes/react-native-web/package.json
    • Added @babel/plugin-transform-react-jsx dev dependency.
    • Updated @rsbuild/core dev dependency.
  • sandboxes/react-testing/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/rslib-react-component/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/rslib-react-mf/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/rslib-vue3-component/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/rspack-react-18/package.json
    • Updated @rspack/cli, @rspack/core, and @rsbuild/core dependencies.
  • sandboxes/vanilla-ts/package.json
    • Updated @rsbuild/core dev dependency.
  • sandboxes/vue3/package.json
    • Updated @rsbuild/core dev dependency.
  • tests/chromatic-stats.integration.test.ts
    • Added new integration tests for Chromatic stats.
  • tests/helpers/runSandboxInspect.ts
    • Removed configs from SandboxInspectResult interface and parseInspectOutput function.
    • Removed DEBUG: 'rsbuild' from environment variables.
  • tests/sandbox-config.test.ts
    • Modified SnapshotTarget interface to use fileMatcher instead of labelMatcher.
    • Updated SANDBOX_CASES to target built files for GFM MDX compile checks.
    • Updated extraction logic for GFM runtime markers.
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
Copy Markdown

@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 introduces compatibility with Rspack 2.x, Rsbuild 2.x, and Modern.js 3.x. The changes primarily involve updating dependencies across multiple packages and adapting the code to the new APIs of these major versions. A significant new feature is the addition of a compatibility layer for Chromatic TurboSnap, which normalizes Rspack's stats JSON output. This is well-tested with new unit and integration tests. The overall changes are extensive but look solid and align with the goal of supporting the latest versions of the underlying build tools. I have one minor suggestion for improving type safety in one of the configuration files.

@fi3ework fi3ework merged commit 10fcde7 into main Feb 24, 2026
11 of 17 checks passed
@fi3ework fi3ework deleted the m3 branch February 24, 2026 06:32
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