Skip to content

feat: add React Compiler support for ActionMenu#8056

Open
joshblack wants to merge 1 commit into
mainfrom
copilot/react-compiler-action-menu
Open

feat: add React Compiler support for ActionMenu#8056
joshblack wants to merge 1 commit into
mainfrom
copilot/react-compiler-action-menu

Conversation

@joshblack

Copy link
Copy Markdown
Member

Closes N/A

Changelog

New

N/A

Changed

  • Enabled React Compiler support for ActionMenu.
  • Updated ActionMenu tests to render compiled JSX helpers as components and keep the external-anchor replacement assertion compiler-safe.
  • Added a patch changeset for the rendering performance improvement.

Removed

N/A

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

  • npx eslint --no-cache packages/react/src/ActionMenu/**/*.{ts,tsx}
  • npm test -- --run packages/react/src/ActionMenu/ActionMenu.test.tsx packages/react/src/__tests__/deprecated/ActionMenu.test.tsx packages/react/src/AnchoredOverlay/AnchoredOverlay.test.tsx
  • npm run build && npm test -- --run && npm run type-check && npm run lint && npm run lint:css && npm run format:diff
  • Storybook started and responded locally at http://localhost:6006.

Merge checklist

  • Added/updated tests (not needed; existing coverage validated)
  • Added/updated documentation (not needed)
  • Added/updated previews (not needed)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge
  • (GitHub staff only) Integration tests pass at github/github-ui (Learn more about how to run integration tests)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c457dd8

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 Patch

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 Jun 24, 2026
@github-actions

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. If this doesn't work, you can also use the original workflow here. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@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 Jun 24, 2026
@joshblack joshblack marked this pull request as ready for review June 24, 2026 23:11
@joshblack joshblack requested a review from a team as a code owner June 24, 2026 23:11
@joshblack joshblack requested review from TylerJDev and Copilot June 24, 2026 23:11

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.

Pull request overview

Enables React Compiler support for ActionMenu by removing it from the compiler “unsupported” list and updating ActionMenu tests to be compatible with compiled output expectations.

Changes:

  • Allow src/ActionMenu/**/*.tsx to be treated as React Compiler-supported.
  • Refactor ActionMenu tooltip-v2 test helpers to be rendered as components (compiler-friendly).
  • Stabilize the “replaceable anchor” assertion by waiting for the computed anchor-name / position-anchor linkage, and add a patch changeset noting the perf improvement.
Show a summary per file
File Description
packages/react/src/ActionMenu/ActionMenu.test.tsx Updates test helpers and assertions to be React Compiler-safe.
packages/react/script/react-compiler.mjs Removes ActionMenu from the unsupported patterns list, enabling compilation support.
.changeset/react-compiler-action-menu.md Adds a patch changeset for the consumer-facing rendering performance improvement.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment on lines +87 to +90
}: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
actionMenuTrigger: React.ReactElement<any>
}): JSX.Element {
Comment on lines 105 to +107
function ExampleWithReplaceableAnchor(): JSX.Element {
'use no memo'

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 staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants