Skip to content

feat(plugin-react): add reactCompiler option#7938

Merged
chenjiahan merged 2 commits into
mainfrom
chenjiahan/feat-react-compiler-plugin-react
Jun 18, 2026
Merged

feat(plugin-react): add reactCompiler option#7938
chenjiahan merged 2 commits into
mainfrom
chenjiahan/feat-react-compiler-plugin-react

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds a reactCompiler option to @rsbuild/plugin-react so users can enable or configure Rspack builtin:swc-loader React Compiler support from the plugin API.

Related Links

https://rspack.rs/guide/tech/react#using-builtinswc-loader

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f372310-3971-47f9-9f6e-146056976fa2

📥 Commits

Reviewing files that changed from the base of the PR and between 915ed26 and 0295d30.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • e2e/cases/plugin-react/react-compiler-babel/rsbuild.config.ts
  • e2e/cases/plugin-react/react-compiler/index.test.ts
  • e2e/cases/plugin-react/react-compiler/package.json
  • e2e/cases/plugin-react/react-compiler/rsbuild.config.ts
  • e2e/cases/plugin-react/react-compiler/src/App.jsx
  • e2e/cases/plugin-react/react-compiler/src/index.js
  • e2e/cases/plugin-react/react-compiler/src/useCounter.js
  • pnpm-workspace.yaml
💤 Files with no reviewable changes (2)
  • e2e/cases/plugin-react/react-compiler-babel/rsbuild.config.ts
  • pnpm-workspace.yaml

📝 Walkthrough

Walkthrough

The plugin-react package gains support for the React Compiler via a new exported ReactCompilerOptions type and an optional reactCompiler field added to the PluginReactOptions interface. In the plugin's setup function, the SWC transform configuration is refactored to construct a transformOptions object that always includes the react transform settings and conditionally includes reactCompiler when the option is provided, before passing the combined object to tools.swc.jsc.transform. Two new tests verify that both the boolean form (reactCompiler: true) and the object form (reactCompiler: { target: '18' }) are correctly reflected in the generated loader rules for .tsx files. The e2e test case is updated to demonstrate the plugin-based React Compiler configuration, and the Babel compiler dependency is removed from the workspace catalog.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'feat(plugin-react): add reactCompiler option' directly and accurately summarizes the main change: adding a new reactCompiler option to the plugin-react package.
Description check ✅ Passed The PR description clearly explains that it adds a reactCompiler option to @rsbuild/plugin-react to enable or configure Rspack's builtin:swc-loader React Compiler support, which is directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 915ed2616d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/plugin-react/src/index.ts
@chenjiahan chenjiahan merged commit efe4fbd into main Jun 18, 2026
7 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/feat-react-compiler-plugin-react branch June 18, 2026 14:15
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