Skip to content

[select] Split the store into state and context - #5582

Merged
flaviendelangle merged 1 commit into
mui:masterfrom
flaviendelangle:select-store-split
Aug 28, 2026
Merged

flaviendelangle merged 1 commit into
mui:masterfrom
flaviendelangle:select-store-split

Conversation

@flaviendelangle

@flaviendelangle flaviendelangle commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Select keeps refs, callbacks, reactive options, and the Floating UI context in one memoized React context. Changing any dependency rerenders every Select part.

This PR applies the store split from #5581 without changing when Select props reach its parts:

  • makes SelectRootContext provide the stable ReactStore
  • moves 13 refs and four commands into the non-reactive store context
  • keeps root props and itemProps in a separate synchronous React context
  • registers Select selectors and reads them through store.useState()
  • gives the Floating UI context its own provider
  • uses EMPTY_OBJECT for the initial prop bags
  • covers atomic store synchronization, first-commit command availability, and commit-time disabled updates

No public API, DOM, or behavior change is intended.

Verification:

  • pnpm test:jsdom Select --no-watch (506 passed, 71 skipped)
  • pnpm test:chromium Select --no-watch (558 passed, 19 skipped)
  • pnpm typescript
  • pnpm eslint
  • pnpm exec prettier --check packages/react/src/select docs/src/error-codes.json
  • pnpm extract-error-codes

@flaviendelangle flaviendelangle added component: select Changes related to the select component. internal Behind-the-scenes enhancement. Formerly called “core”. labels Aug 27, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+1.36KB(+0.30%) 🔺+6B(0.00%)

Details of bundle changes

Performance

Total duration: 1,044.92 ms -87.65 ms(-7.7%) | Renders: 76 (+0) | Paint: 1,697.43 ms -159.09 ms(-8.6%)

Test Duration Renders
Combobox type — 500 items, narrows to ~11 (type "Row 25") 32.63 ms ▼-13.16 ms(-28.7%) 15 (+0)
Combobox type — 500 items, all stay mounted (type "Row ") 28.76 ms ▼-11.37 ms(-28.3%) 11 (+0)
Combobox open — 500 items 25.82 ms ▼-8.24 ms(-24.2%) 4 (+0)
Dialog mount (300 instances) 21.33 ms ▼-5.42 ms(-20.2%) 1 (+0)

11 tests within noise — details


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

@netlify

netlify Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit f4d2d12
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a904067ae16b90008a0fbdb
😎 Deploy Preview https://deploy-preview-5582--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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

commit: f4d2d12

@michaldudak michaldudak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@flaviendelangle
flaviendelangle merged commit 8d9cd50 into mui:master Aug 28, 2026
24 checks passed
@flaviendelangle
flaviendelangle deleted the select-store-split branch August 28, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: select Changes related to the select component. internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants