feat: add React Compiler support for ActionMenu#8056
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: c457dd8 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 |
|
There was a problem hiding this comment.
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/**/*.tsxto be treated as React Compiler-supported. - Refactor
ActionMenutooltip-v2 test helpers to be rendered as components (compiler-friendly). - Stabilize the “replaceable anchor” assertion by waiting for the computed
anchor-name/position-anchorlinkage, 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
| }: { | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| actionMenuTrigger: React.ReactElement<any> | ||
| }): JSX.Element { |
| function ExampleWithReplaceableAnchor(): JSX.Element { | ||
| 'use no memo' | ||
|
|
Closes N/A
Changelog
New
N/A
Changed
Removed
N/A
Rollout strategy
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.tsxnpm run build && npm test -- --run && npm run type-check && npm run lint && npm run lint:css && npm run format:diffhttp://localhost:6006.Merge checklist