Skip to content

[select][combobox] Combine item store subscriptions - #5863

Merged
atomiks merged 2 commits into
mui:masterfrom
atomiks:claude/heuristic-brattain-69e7f4
Oct 5, 2026
Merged

atomiks merged 2 commits into
mui:masterfrom
atomiks:claude/heuristic-brattain-69e7f4

Conversation

@atomiks

@atomiks atomiks commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Since #5589, each SelectItem reads itemProps, multiple, disabled and readOnly through four separate store subscriptions, where it previously read one context. With long lists this made opening a Select noticeably slower. ComboboxItem has had the same pattern for longer, with six root-wide values each read through its own subscription.

This PR combines those root-wide values into a single itemRoot object in each store. The object is memoized in SelectRoot and AriaCombobox, and each item reads it with one useState('itemRoot'). This takes Select items from 9 to 5 subscriptions and Combobox/Autocomplete items from 8 to 3. Per-item selectors like isActive and isSelected stay separate, so a highlight change still re-renders only the affected items. The object only changes when one of the root values changes, and every item re-rendered in that case before too.

@atomiks atomiks added component: select Changes related to the select component. component: combobox Changes related to the combobox component. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. performance labels Oct 2, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@5863
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5863
    

commit: b46bccb

@code-infra-dashboard

code-infra-dashboard Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+197B(+0.04%) 🔺+55B(+0.03%)

Details of bundle changes

Performance

Total duration: 383.49 ms -33.84 ms(-8.1%) | Renders: 76 (+0) | Paint: 688.97 ms -87.86 ms(-11.3%)

No significant changes — details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit b46bccb
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6ac3189074f320000888a71b
😎 Deploy Preview https://deploy-preview-5863--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks
atomiks marked this pull request as ready for review October 2, 2026 04:35
@atomiks
atomiks force-pushed the claude/heuristic-brattain-69e7f4 branch from 608c064 to b46bccb Compare October 5, 2026 03:25
@atomiks
atomiks merged commit 5792048 into mui:master Oct 5, 2026
24 checks passed
@atomiks
atomiks deleted the claude/heuristic-brattain-69e7f4 branch October 5, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: combobox Changes related to the combobox component. component: select Changes related to the select component. performance type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant