Repository navigation
[all components] Reduce selector bundle size - #5250
Merged
atomiks merged 1 commit intoJul 21, 2026
Merged
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,080.52 ms -87.55 ms(-7.5%) | Renders: 78 (+0) | Paint: 1,691.64 ms -142.89 ms(-7.8%) No significant changes — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
atomiks
marked this pull request as ready for review
July 16, 2026 05:45
atomiks
requested review from
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
July 16, 2026 05:45
atomiks
force-pushed
the
codex/remove-redundant-selector-factories
branch
from
July 16, 2026 08:33
2d3bbc5 to
17b1d1f
Compare
atomiks
force-pushed
the
codex/remove-redundant-selector-factories
branch
from
July 21, 2026 09:25
17b1d1f to
d631ed0
Compare
There was a problem hiding this comment.
Pull request overview
This PR reduces @base-ui/react bundle size by removing redundant uses of the internal createSelector factory and replacing them with direct selector functions, without changing the public store utilities.
Changes:
- Replace
createSelector(...)wrappers with direct(state, ...args) => ...selectors across popup-related stores and other component stores. - Keep selector arguments explicit (notably Toast selectors that depend on
id) while removing intermediate selector helpers. - Remove now-unneeded
createSelectorimports (and switch toimport typewhere applicable).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/utils/popups/store.ts | Replaces internal popup selectors with direct functions and updates imports accordingly. |
| packages/react/src/tooltip/store/TooltipStore.ts | Converts Tooltip store selectors from createSelector to direct selector functions. |
| packages/react/src/toast/store.ts | Inlines Toast selectors directly against state (including id-param selectors), removing selector factory usage. |
| packages/react/src/select/store.ts | Converts Select store selectors to direct selector functions (including multi-arg selectors). |
| packages/react/src/preview-card/store/PreviewCardStore.ts | Converts PreviewCard store selectors to direct selector functions. |
| packages/react/src/popover/store/PopoverStore.ts | Converts Popover store selectors to direct selector functions. |
| packages/react/src/menu/store/MenuStore.ts | Converts Menu store selectors to direct selector functions, preserving parent-store lookups. |
| packages/react/src/floating-ui-react/components/FloatingRootStore.ts | Converts FloatingRoot store selectors to direct selector functions. |
| packages/react/src/dialog/store/DialogStore.ts | Converts Dialog store selectors to direct selector functions. |
| packages/react/src/combobox/store.ts | Converts Combobox store selectors to direct selector functions (including multi-arg selectors). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Aug 24, 2026
flaviendelangle
added a commit
to flaviendelangle/mui-x
that referenced
this pull request
Aug 24, 2026
Remove internal selector factories that don't memoize: createSelector with a single function argument returns it unchanged, and composed non-memoized selectors re-run their inputs on every call anyway, so both forms only added bundle size. createSelectorMemoized selectors are untouched. Same technique as mui/base-ui#5250. Co-Authored-By: Claude Fable 5 <[email protected]>
flaviendelangle
added a commit
to flaviendelangle/mui-x
that referenced
this pull request
Aug 24, 2026
Remove internal selector factories that don't memoize: createSelector with a single function argument returns it unchanged, and composed non-memoized selectors re-run their inputs on every call anyway, so both forms only added bundle size. createSelectorMemoized selectors are untouched. Same technique as mui/base-ui#5250. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove redundant internal selector factories without changing the public store utility.
Changes