Skip to content

perf(ActionList): enable React Compiler#7537

Merged
hectahertz merged 3 commits intomainfrom
hectahertz/enable-react-compiler-actionlist
Feb 18, 2026
Merged

perf(ActionList): enable React Compiler#7537
hectahertz merged 3 commits intomainfrom
hectahertz/enable-react-compiler-actionlist

Conversation

@hectahertz
Copy link
Copy Markdown
Contributor

@hectahertz hectahertz commented Feb 12, 2026

Closes #

Enable React Compiler for ActionList, the foundational component used by ActionMenu, SelectPanel, NavList, and FilteredActionList.

ActionList was originally excluded from the compiler during the initial migration. After analysis (build, lint with eslint-plugin-react-compiler, and manual Storybook verification), all ActionList source files are fully compiler-compatible. The only fix needed was a Rules of Hooks violation in a story file (ChildWithSideEffects, moved SideEffectDescription to module scope).

With the compiler enabled, React will automatically memoize ActionList's components (Item, List, Group, Selection, Visuals, etc.), reducing unnecessary re-renders without manual React.memo / useMemo / useCallback.

Changelog

New

N/A

Changed

  • Removed src/ActionList/**/*.tsx from the React Compiler unsupported list in react-compiler.mjs
  • Fixed nested component definition in ChildWithSideEffects story

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

  1. Ran npx eslint with react-compiler/react-compiler rule on all ActionList files (source, stories, tests): 0 warnings
  2. npx turbo build --filter=@primer/react --force passes with ActionList compiled
  3. Verified in Storybook: ActionList Default, Single Select, Multi Select, With Avatars, ActionMenu with 100 items, SelectPanel default, NavList default

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Storybook)
  • 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

- Remove ActionList from the React Compiler unsupported list
- Fix Rules of Hooks violation in ChildWithSideEffects story by
  moving SideEffectDescription to module scope
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 7bb57e1

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 integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Feb 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

👋 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. Or, apply the integration-tests: skipped manually label to skip these checks.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables React Compiler for ActionList components — a foundational component used by ActionMenu, SelectPanel, NavList, and FilteredActionList. The compiler will automatically optimize re-renders without manual memoization, improving performance for one of the most-rendered list components in the design system.

Changes:

  • Removed ActionList from the React Compiler unsupported list
  • Fixed a Rules of Hooks violation by moving a nested component to module scope in a story file

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/react/src/ActionList/ActionList.features.stories.tsx Moved SideEffectDescription component from nested definition to module scope to comply with Rules of Hooks
packages/react/script/react-compiler.mjs Removed src/ActionList/**/*.tsx from the unsupported components list
.changeset/actionlist-react-compiler.md Added changeset documenting the performance improvement

Copy link
Copy Markdown
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

@primer-integration
Copy link
Copy Markdown

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/13846

@primer-integration
Copy link
Copy Markdown

Integration test results from github/github-ui:

Passed  CI   Passed
Passed  VRT   Passed
Passed  Projects   Passed

All checks passed!

@hectahertz hectahertz added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit 4fd987c Feb 18, 2026
62 of 63 checks passed
@hectahertz hectahertz deleted the hectahertz/enable-react-compiler-actionlist branch February 18, 2026 16:20
This was referenced Feb 18, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants