Skip to content

feat(create-rsbuild): add React Compiler support for React templates#7329

Merged
chenjiahan merged 1 commit intomainfrom
react_compiler_template_0313
Mar 13, 2026
Merged

feat(create-rsbuild): add React Compiler support for React templates#7329
chenjiahan merged 1 commit intomainfrom
react_compiler_template_0313

Conversation

@chenjiahan
Copy link
Member

Summary

  • add new template files and configuration for React Compiler integration
  • update quick-start docs to mention react-compiler option

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings March 13, 2026 06:46
@gemini-code-assist
Copy link
Contributor

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 introduces a new feature to create-rsbuild that allows users to opt-in to React Compiler support when initializing new React projects. This enhancement aims to provide better optimization capabilities for React applications by seamlessly integrating the React Compiler into the project setup process, ensuring that developers can leverage its benefits from the start.

Highlights

  • React Compiler Support: Added support for React Compiler integration when creating new React projects using create-rsbuild.
  • Documentation Updates: Updated the quick-start documentation (English and Chinese) to inform users about the new react-compiler option.
Changelog
  • e2e/cases/create-rsbuild/tools.test.ts
    • Added new end-to-end tests to verify the correct integration of React Compiler for React projects and its appropriate exclusion for non-React projects.
  • packages/create-rsbuild/src/index.ts
    • Introduced a new 'react-compiler' option within the project creation logic, enabling its selection specifically for 'react-js' and 'react-ts' templates.
  • packages/create-rsbuild/template-react-compiler/react-js/package.json
    • Created a new package.json file for React JS templates that includes @rsbuild/plugin-babel and babel-plugin-react-compiler as development dependencies.
  • packages/create-rsbuild/template-react-compiler/react-js/rsbuild.config.js
    • Created a new Rsbuild configuration file for React JS templates, setting up pluginReact and pluginBabel with babel-plugin-react-compiler.
  • packages/create-rsbuild/template-react-compiler/react-ts/package.json
    • Created a new package.json file for React TS templates that includes @rsbuild/plugin-babel and babel-plugin-react-compiler as development dependencies.
  • packages/create-rsbuild/template-react-compiler/react-ts/rsbuild.config.ts
    • Created a new Rsbuild configuration file for React TS templates, setting up pluginReact and pluginBabel with babel-plugin-react-compiler.
  • website/docs/en/guide/start/quick-start.mdx
    • Updated the English quick-start guide to include a tip about selecting React Compiler as an optional tool for React templates and added 'react-compiler' to the list of optional tools.
  • website/docs/zh/guide/start/quick-start.mdx
    • Updated the Chinese quick-start guide to include a tip about selecting React Compiler as an optional tool for React templates and added 'react-compiler' to the list of optional tools.
Activity
  • No human activity (comments, reviews, or progress updates) 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
Contributor

@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 adds support for React Compiler in create-rsbuild for React 19 templates. The changes are well-structured, including new template files, configuration updates, e2e tests, and documentation. However, there's a critical issue with the version of babel-plugin-react-compiler specified in the new package.json files, which appears to be unpublished and would cause project creation to fail. Additionally, the documentation could be more precise about which React templates support this new feature. My review includes suggestions to address these points.

@cloudflare-workers-and-pages
Copy link

Deploying rsbuild with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9be4095
Status: ✅  Deploy successful!
Preview URL: https://d31d9b5f.rsbuild-v2.pages.dev
Branch Preview URL: https://react-compiler-template-0313.rsbuild-v2.pages.dev

View logs

Copy link
Contributor

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

Adds a new react-compiler optional tool to create-rsbuild so React templates can be scaffolded with React Compiler (Babel plugin) integration, and updates the quick-start docs to mention the new option.

Changes:

  • Introduce a new react-compiler extra tool in create-rsbuild that merges in a template overlay (config + devDependencies).
  • Add new template-react-compiler overlays for react-js and react-ts.
  • Update EN/ZH quick-start docs and add e2e coverage for the new tool behavior.

Reviewed changes

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

Show a summary per file
File Description
website/docs/zh/guide/start/quick-start.mdx Mentions React Compiler as an optional tool and lists react-compiler in CLI docs.
website/docs/en/guide/start/quick-start.mdx Same as above for English docs.
packages/create-rsbuild/template-react-compiler/react-ts/rsbuild.config.ts Adds Rsbuild config overlay enabling babel-plugin-react-compiler via @rsbuild/plugin-babel.
packages/create-rsbuild/template-react-compiler/react-ts/package.json Adds devDependencies needed for React Compiler Babel integration (TS overlay).
packages/create-rsbuild/template-react-compiler/react-js/rsbuild.config.js Adds Rsbuild config overlay enabling babel-plugin-react-compiler (JS overlay).
packages/create-rsbuild/template-react-compiler/react-js/package.json Adds devDependencies needed for React Compiler Babel integration (JS overlay).
packages/create-rsbuild/src/index.ts Registers the react-compiler extra tool and copies the appropriate overlay into the generated project.
e2e/cases/create-rsbuild/tools.test.ts Adds scaffolding tests for react-compiler and verifies it’s ignored for non-React templates.

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

@chenjiahan chenjiahan merged commit 94e369d into main Mar 13, 2026
11 checks passed
@chenjiahan chenjiahan deleted the react_compiler_template_0313 branch March 13, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants