-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[data grid] Performance: selectors #18234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
(panel, labelId: string) => { | ||
(panel, labelId: string | undefined) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typings from the base-ui selector functions are more precise, they can catch more issues.
Deploy preview: https://deploy-preview-18234--material-ui-x.netlify.app/ Bundle size reportBundle size will be reported once CircleCI build #553042 finishes. |
(apiRef: RefObject<GridApiCommunity>) => | ||
apiRef.current.state.virtualization.renderContext.firstColumnIndex, | ||
(apiRef: RefObject<GridApiCommunity>) => | ||
apiRef.current.state.virtualization.renderContext.lastColumnIndex, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The create selector functions only accept state selectors, not apiRef selectors, but these aren't public so I think this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this in favor of the unwrapIfNeeded
logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base-ui selectors support multiple arguments (very efficiently), but we can't because our useGridSelector(api, selector, args?, equals?)
wrapper has the equals
argument blocking more arguments. We should rework that API at v9, we do need multiple arguments at some places and we use inefficient param objects instead. We could add useGridSelectorV9
, and an alternative useGridSelectorWithEquals(api, selector, equals, ...args)
for the limited cases where we need equals
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to #17846
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't quite get where the performance-related changes are. Could you clarify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to #17846
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use it anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old implementation calls reselect's |
Also, the previous implementation had two |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
f8a512a
to
8d62906
Compare
8d62906
to
8e6196b
Compare
Import the selectors implementation from base-ui.