Repository navigation
perf(react-compiler): enable React Compiler for CounterLabel and Truncate - #8509
Conversation
🦋 Changeset detectedLatest commit: 35f5c66 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
Integration test results from github/github-ui PR: |
f9b2657 to
5bf8678
Compare
5bf8678 to
01bda87
Compare
376299f to
2c02df9
Compare
2c02df9 to
8bcf408
Compare
8bcf408 to
d2de377
Compare
d2de377 to
ce1a979
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The bounded compiler opt-in and release metadata have no identified blocking issues, and reported validation covers the affected behavior.
0 open findings
What changed in this PR
Enables the first small React Compiler migration batch following the Babel 8 tooling update, without component refactors or public API changes.
Changes:
- Removes compiler exclusions for three runtime components and four story/test files.
- Adds a minor
@primer/reactchangeset for rendering optimizations.
| File | Description |
|---|---|
packages/react/script/react-compiler.mjs |
Enables compilation for seven previously excluded files. |
.changeset/react-compiler-low-risk-batch-1.md |
Records the component optimizations for a minor release. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
ce1a979 to
536fee9
Compare
536fee9 to
35f5c66
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cf031929-064e-4482-961d-25594325eb1b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: cf031929-064e-4482-961d-25594325eb1b
35f5c66 to
26cbb7e
Compare
Follow up to #8505. No issue to close.
This PR enables React Compiler for the first low-risk migration batch, stacked on
chore/update-babel-v8-2. All seven files already pass the current compiler check, so no component refactors are needed.The batch contains 12 changed lines (5 additions and 7 deletions), below the 500-line limit. This is the first review checkpoint; the remaining migrations are not included.
Changelog
New
None.
Changed
CounterLabel/CounterLabel.tsx,Truncate/Truncate.tsx, andinternal/components/Caret.tsx.ActionList/ActionList.examples.stories.tsxandstories/deprecated/ActionList.stories.tsx.NavList/NavList.features.stories.tsxandNavList/NavList.test.tsx.Removed
Remove these seven files from the compiler exclusion list. No public APIs are removed.
Rollout strategy
Minor release: compiler migrations are coordinated rendering changes, without public API or intended visual changes. Use minor changesets for subsequent compiler migration batches, keeping each batch separate and below 500 changed lines.
Testing & Reviewing
npm run lint:react-compiler -w @primer/react: passed for 840 enabled files.npm test -- --run packages/react/src/CounterLabel/CounterLabel.test.tsx packages/react/src/Truncate/Truncate.test.tsx packages/react/src/NavList/NavList.test.tsx packages/react/src/__tests__/storybook.test.tsx: passed (4 files, 383 tests).npm run build: passed.npm run type-check: passed.npm test -- --run: passed (159 files, 2,706 tests; 3 skipped and 10 todo).npm run lint: passed.npm run lint:css: passed.npm run format: passed.npm run format:diff: passed.Direct Oxc checks confirmed all seven files are enabled and have no compiler diagnostics; normal-mode transforms emit memo-cache output for CounterLabel, Truncate, and Caret.
Started Storybook with
npm startand used itsindex.jsonto select the affected stories. Playwright Chromium smoke checks rendered all 48 selected stories without uncaught page errors or Storybook error UI. Deprecated ActionList stories emit DOM-prop warnings. The temporary Storybook server was stopped afterward.No new snapshots or visual baselines were added. Dedicated VRT/AVT and github-ui integration were not run (there are no intended visual or accessibility changes).
For review, focus on CounterLabel's accessible count, Truncate's polymorphic props and styles, and NavList's navigation behavior with compilation enabled.