Skip to content

perf(ActionList): enable React Compiler#7537

Draft
hectahertz wants to merge 1 commit intomainfrom
hectahertz/enable-react-compiler-actionlist
Draft

perf(ActionList): enable React Compiler#7537
hectahertz wants to merge 1 commit intomainfrom
hectahertz/enable-react-compiler-actionlist

Conversation

@hectahertz
Copy link
Contributor

@hectahertz hectahertz commented Feb 12, 2026

Summary

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.

Changes

  • Remove src/ActionList/**/*.tsx from the React Compiler unsupported list in react-compiler.mjs
  • Fix a nested component definition in ChildWithSideEffects story — moved SideEffectDescription to module scope to comply with the Rules of Hooks

Why this matters

ActionList is the most-rendered list component in the design system. With the compiler enabled, React will automatically memoize ActionList's components (Item, List, Group, Selection, Visuals, etc.), reducing unnecessary re-renders without any manual React.memo / useMemo / useCallback work.

How did you test this change?

  1. Lint — Ran npx eslint with react-compiler/react-compiler rule on all ActionList files (source, stories, tests): 0 warnings

  2. Buildnpx turbo build --filter=@primer/react --force passes cleanly with ActionList compiled

  3. Storybook — Verified the following stories render correctly with zero console warnings:

    • ActionList Default
    • ActionList Single Select (with click interactions)
    • ActionList Multi Select (with click interactions)
    • ActionList With Avatars
    • ActionMenu with 100 items (overlay open)
    • SelectPanel default (overlay open, filter interaction)
    • NavList default

- 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

changeset-bot bot commented Feb 12, 2026

⚠️ No Changeset found

Latest commit: f2fe7ee

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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
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.

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.

1 participant