Skip to content

perf(react-compiler): enable React Compiler for CounterLabel and Truncate - #8509

Merged
joshblack merged 2 commits into
mainfrom
refactor/react-compiler-low-risk-batch-1
Oct 15, 2026
Merged

joshblack merged 2 commits into
mainfrom
refactor/react-compiler-low-risk-batch-1

Conversation

@joshblack

@joshblack joshblack commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

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

  • Enable compiler output for CounterLabel/CounterLabel.tsx, Truncate/Truncate.tsx, and internal/components/Caret.tsx.
  • Enable compilation of ActionList/ActionList.examples.stories.tsx and stories/deprecated/ActionList.stories.tsx.
  • Enable compilation of NavList/NavList.features.stories.tsx and NavList/NavList.test.tsx.
  • Add a minor changeset for the published component optimizations. Existing changesets from the base branch remain unchanged.

Removed

Remove these seven files from the compiler exclusion list. No public APIs are removed.

Rollout strategy

  • No changes needed in github/github-ui
  • Needs changes in github/github-ui
  • Ships with feature flag(s)
  • Not sure
  • None

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 start and used its index.json to 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.

@changeset-bot

changeset-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 35f5c66

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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

@github-actions github-actions Bot added the staff Author is a staff member label Oct 6, 2026
@joshblack
joshblack added this pull request to stack #8506 October 6, 2026 18:05
@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions
github-actions Bot requested a deployment to storybook-preview-8509 October 6, 2026 18:12 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 6, 2026 18:22 Inactive
@primer-integration

primer-integration Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Waiting  Changes   Waiting
Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from f9b2657 to 5bf8678 Compare October 6, 2026 20:43
@github-actions
github-actions Bot requested a deployment to storybook-preview-8509 October 6, 2026 20:46 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 6, 2026 20:57 Inactive
@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from 5bf8678 to 01bda87 Compare October 6, 2026 20:58
@github-actions
github-actions Bot requested a deployment to storybook-preview-8509 October 6, 2026 21:08 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 6, 2026 21:17 Inactive
@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch 2 times, most recently from 376299f to 2c02df9 Compare October 7, 2026 20:26
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 7, 2026 20:35 Inactive
@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from 2c02df9 to 8bcf408 Compare October 12, 2026 16:15
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 12, 2026 16:26 Inactive
@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from 8bcf408 to d2de377 Compare October 14, 2026 16:05
@joshblack joshblack changed the title perf(react-compiler): enable first low-risk migration batch perf(react-compiler): enable React Compiler for CounterLabel and Truncate Oct 14, 2026
@joshblack
joshblack marked this pull request as ready for review October 14, 2026 16:10
@joshblack
joshblack requested a review from a team as a code owner October 14, 2026 16:10
@joshblack
joshblack requested review from tay1orjones and a balanced review from Copilot October 14, 2026 16:10
@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from d2de377 to ce1a979 Compare October 14, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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/react changeset 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.

@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from ce1a979 to 536fee9 Compare October 14, 2026 16:17
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 14, 2026 16:24 Inactive
@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from 536fee9 to 35f5c66 Compare October 14, 2026 16:31
@github-actions
github-actions Bot requested a deployment to storybook-preview-8509 October 14, 2026 16:36 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 14, 2026 16:46 Inactive
Base automatically changed from chore/update-babel-v8-2 to main October 15, 2026 16:32
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
@joshblack
joshblack force-pushed the refactor/react-compiler-low-risk-batch-1 branch from 35f5c66 to 26cbb7e Compare October 15, 2026 16:32
@joshblack joshblack added the integration-tests: skipped manually Changes in this PR do not require an integration test label Oct 15, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8509 October 15, 2026 16:42 Inactive
@joshblack
joshblack added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit 78ba2e0 Oct 15, 2026
57 checks passed
@joshblack
joshblack deleted the refactor/react-compiler-low-risk-batch-1 branch October 15, 2026 17:01
@primer primer Bot mentioned this pull request Oct 15, 2026

This branch was successfully deployed

1 active and 1 inactive deployments
storybook-preview-8509 — 26cbb7ea Deployed Oct 15, 2026 by github-actions[bot]
github-pages — 26cbb7ea Deployed Oct 15, 2026 by joshblack via deploy-preview #33712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: skipped manually Changes in this PR do not require an integration test staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants