Skip to content

perf: enable React Compiler for shared hooks#8145

Draft
joshblack wants to merge 1 commit into
copilot/react-compiler/primitivesfrom
copilot/react-compiler/hooks
Draft

perf: enable React Compiler for shared hooks#8145
joshblack wants to merge 1 commit into
copilot/react-compiler/primitivesfrom
copilot/react-compiler/hooks

Conversation

@joshblack

Copy link
Copy Markdown
Member

Closes #

Follow up to #8143.

This PR enables React Compiler support for the shared hook internals in @primer/react. These hooks were still on the migration list because they needed small refactors to avoid compiler skips and keep callback/state behavior stable under compilation.

Changelog

New

Changed

  • Update shared hook internals so they pass the React Compiler migration check.
  • Add a patch changeset for enabling React Compiler support for shared hook internals.

Removed

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

This should be a patch since it improves internal rendering behavior for existing hooks without changing the public API.

Testing & Reviewing

  • npm run lint:react-compiler -w @primer/react

Would love a close look at the hook behavior changes, especially around callback stability and cleanup behavior.

@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f8b3d45

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 staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 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. 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.

@primer

primer Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🤖 Lint issues have been automatically fixed and committed to this PR.

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.

1 participant