feat: add React Compiler support for Tooltip#8061
Conversation
🦋 Changeset detectedLatest commit: ecf0922 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 |
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
33c018f to
76c1f32
Compare
There was a problem hiding this comment.
Pull request overview
Enables React Compiler support for TooltipV2 by allowing TooltipV2 sources to be included in the compiler-supported set, and updates TooltipV2’s ActionMenu-related tests to render the helper as a React component (instead of calling a JSX-returning function) for compiler compatibility.
Changes:
- Removed
src/TooltipV2/**/*.tsxfrom the React Compiler “unsupported” list. - Refactored the ActionMenu test helper in TooltipV2 tests into a component with props.
- Added a patch changeset documenting Tooltip’s React Compiler support.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/TooltipV2/tests/Tooltip.test.tsx | Refactors the ActionMenu test helper into a component for React Compiler compatibility. |
| packages/react/script/react-compiler.mjs | Removes TooltipV2 from the compiler unsupported patterns list. |
| .changeset/react-compiler-tooltip-v2.md | Adds a patch changeset noting Tooltip React Compiler support. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Low
| interface ExampleWithActionMenuProps { | ||
| actionMenuTrigger: React.ReactElement | ||
| } |
|
Integration test results from github/github-ui PR:
CI check runs linting, type checking, and unit tests. Check the workflow logs for specific failures. Need help? If you believe this failure is unrelated to your changes, please reach out to the Primer team for assistance. |
Closes #
Adds React Compiler support for Tooltip by removing TooltipV2 from the compiler unsupported list. Updates the ActionMenu integration test helper to render as a React component instead of invoking JSX as a plain function.
Changelog
New
Changed
Removed
Rollout strategy
Testing & Reviewing
npx eslint --no-cache 'packages/react/src/TooltipV2/**/*.{ts,tsx}'npm test -- --run packages/react/src/TooltipV2/__tests__/Tooltip.test.tsxnpm run build && npm test -- --run && npm run type-check && npm run lint && npm run lint:css && npm run format:diffMerge checklist