Skip to content

[ENHANCEMENT] Enable React Compiler for all plugins - #878

Merged
Nexucis merged 2 commits into
perses:mainfrom
Gladorme:feat/react-compiler
Oct 22, 2026
Merged

Nexucis merged 2 commits into
perses:mainfrom
Gladorme:feat/react-compiler

Conversation

@Gladorme

@Gladorme Gladorme commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Description

Upgrade Rsbuild to v2 and enable the React Compiler through pluginReact({ reactCompiler }) for the module federation bundles and through .swcrc for the library build. Plugins target React 18 and depend on react-compiler-runtime.

Screenshots

image

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.

Upgrade Rsbuild to v2 and enable the React Compiler through pluginReact({ reactCompiler }) for the module
federation bundles and through .swcrc for the library build. Plugins target React 18 and depend on
react-compiler-runtime. Keep the previous browserslist since Rsbuild 2 raised its default targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
@Gladorme
Gladorme force-pushed the feat/react-compiler branch from 1c29fa9 to 35147c8 Compare October 21, 2026 12:49
@Gladorme
Gladorme marked this pull request as ready for review October 21, 2026 12:50
@Gladorme
Gladorme requested review from a team and andreasgerstmayr as code owners October 21, 2026 12:50
@Gladorme
Gladorme requested review from adrianSepiol and removed request for a team October 21, 2026 12:50

@Nexucis Nexucis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 This review was generated by GitHub Copilot (AI assistant), on behalf of the reviewer.

Thanks for this, overall it looks good to me 👍 A few non-blocking suggestions inline.

What was verified (PR checked out locally, compared against origin/main)

  • All 33 plugin packages get react-compiler-runtime + pluginReact({ reactCompiler }) (only e2e is untouched, as expected).
  • The compiler is effectively applied in both outputs:
    • ESM lib (build:esm via .swcrc): in table, 15/30 emitted files import { c as _c } from "react-compiler-runtime" (the only non-compiled file with JSX is bootstrap.js, which is fine).
    • MF bundles (rsbuild build): memo_cache_sentinel present in the output.
  • react-compiler-runtime is correctly in dependencies (the published lib/ imports it), and its peer range (react ^17 || ^18 || ^19) matches.
  • No need to add it to MF shared: it's stateless and its react import resolves to the shared singleton.
  • tsc -p tsconfig.json passes on rsbuild.shared.ts + all rsbuild.config.ts against Rsbuild v2 types; no removed v2 options in use.
  • Bundle size (table MF build): 8328 → 8343 kB raw / 3478 → 3467 kB gzip, i.e. negligible.
  • The oxlint config already enforces the compiler-derived rules (react/hooks, react/memo-dependencies, react/unsupported-syntax, react/todo…) and there's no use no memo / hooks-rule suppression in the sources, so the codebase is in good shape for this.

Other notes

  • Vitest does not run the compiler, so unit tests exercise the uncompiled code; compiler-specific regressions would only be caught by e2e/manual testing. Lint rules mitigate this, but it may be worth mentioning in the release notes.
  • Minor: the PR checklist is unchecked and the screenshot has no caption explaining what it shows.

Comment thread rsbuild.shared.ts Resolved
Comment thread .swcrc Resolved
Comment thread rsbuild.shared.ts Resolved
Comment thread alertmanager/rsbuild.config.ts Resolved
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
@Nexucis
Nexucis added this pull request to the merge queue Oct 22, 2026
Merged via the queue into perses:main with commit d13fb63 Oct 22, 2026
17 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.

2 participants