-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[data grid] Avoid subscribing to renderContext
state in grid root for better scroll performance
#15986
[data grid] Avoid subscribing to renderContext
state in grid root for better scroll performance
#15986
Conversation
Deploy preview: https://deploy-preview-15986--material-ui-x.netlify.app/ |
Seed for thought for future refactoring: It seems very easy to introduce additional performance overhead with unused features currently. Could potentially also pave ways for a nicer API for future plugin ecosystem within the community. |
In the latest commits I'm also proposing a slightly easier to follow logic around resetting It also fixes a few issues:
|
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.
Thank you for the PR, subscribing to renderedRowsIntervalChange
rather than binding to the store does seem a better approach.
For my tests, it improved the safari performance ~30-40%, cherry-on-top I can observe a slight (~10%) performance improvement in Chrome too.
As far as #15168 is concerned, the change certainly improved the Safari experience, we could do another benchmark on top of it if there are more areas we could improve in. However, that shouldn't be a blocker for merging this PR.
packages/x-data-grid/src/hooks/features/rows/useGridRowSpanning.ts
Outdated
Show resolved
Hide resolved
packages/x-data-grid/src/hooks/features/rows/useGridRowSpanning.ts
Outdated
Show resolved
Hide resolved
Great, thanks for testing! Unrelated to the original issue – there are some other root-level hooks that can be optimised as well in the Simple example: mui-x/packages/x-data-grid-pro/src/hooks/features/columnPinning/useGridColumnPinning.tsx Line 61 in 758d8b8
But I'd probably move these to another PR. |
Agreed 👍, however I remember a few use-cases where directly using selector caused a state out-of-sync issue, we gotta be careful of any such case when refactoring. In general, we should aim to keep things in the context they are required in, especially for the selectors that may regress the performance and opt-in features like row spanning which are not active at all the times. |
Cherry-pick PRs will be created targeting branches: v7.x |
@@ -308,6 +308,7 @@ export const useGridDataSourceLazyLoader = ( | |||
|
|||
const handleScrolling: GridEventListener<'scrollPositionChange'> = React.useCallback( | |||
(newScrollPosition) => { | |||
const renderContext = gridRenderContextSelector(privateApiRef); |
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.
This kind of change is dangerous in my opinion. If we mix state from useGridSelector
with state from the apiRef
directly, we are mixing state from different render/update cycles. We should not use this pattern to fix performance issues.
If we need to fix re-render issues, we should specialize selectors. For example, the selector could be targetted for renderContext.lastRowIndex
specifically instead of the whole renderContext
object, that would prevent re-renders while avoiding bugs.
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.
There's another PR I opened that takes care of the other useGridSelectors as well, which to me is the correct solution here. For reasons I described in the other PR. #16001
Plus using useGridSelectors in non-rendering hooks makes you write state syncing logic declaratively, which leads to useEffects calling useCallbacks whenever useCallback deps change and other spaghetti that's difficult to debug/trace.
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.
which to me is the correct solution here
I'm open to removing code if we can prove that it won't introduce bugs, but mixing state from different update cycles is pretty important to avoid. For example, if part of the state comes from before a filter has been applied, and another part of the state comes from the latest apiRef.current.state
after a filter has been applied, we'd be using state slices that aren't coherent with each other.
Using apiRef
directly consistently would avoid the issue, though I'd be curious to see how reactive bindings are working.
I'm still catching up with notifications I missed during the holidays but I'll review #16001 in the next days.
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.
but mixing state from different update cycles is pretty important to avoid
Completely agree, but you're more likely to do that with by accident with using useGridSelector
on root level than not (=mixing stale state from rendering phase with up-to-date state from events/apiRef methods that themselves can hide a state selector in their implementation). Direct state selectors are more commonplace in the code base as it stands today – either directly or indirectly through apiRef
methods. Using useGridSelector
-s on root-level seems to be a more recent trend in the code base.
Compare the before and after of useGridRowSpanning
hook. In which implementation can you answer the question more clearly – under what conditions is the row spanning state reset?
I'm not trying to throw shade to anyone's code in particular. This is not an isolated example, and I could have easily written the same thing myself if I just started out from using useGridSelector
instead hooking into the existing events. It's inevitable if you mix two paradigms, you end up writing duct tape to keep them in sync. That duct tape in React is useEffect
, which becomes an implicit event that is run under certain conditions. Under which exactly can become quite difficult to understand the more direct and indirect dependencies we end up having, and the less isolated the code is to a particular component.
If you take a step back – no hook in the useDataGridComponent
tree is directly responsible for rendering anything – they are not an explicit part of a rendering cycle of any particular component. However, the use of useGridSelector
forces those into a declarative paradigm from the outset, while actually serving an imperative function in the context of the data grid.
Just to be clear, even if the motivation around this PR was to take care of a performance regression, the rationale around the other PR (#16001) is not performance per se, it's not me pushing my idea(s/ologies), it's not removing code. But it is to suggest a convention that enables writing more isolated features and easier to follow logic within those features – a foundation that would have prevented this regression in the first place. And it's a pretty simple one.
useGridSelector
- Perfect to use in component rendering life-cycle (e.g
GridRow
,GridCell
,GridBody
, etc.) - Should be avoided in root-level feature hooks / when hooking into the global state machine. The only true reason to use
useGridSelector
on root level is as a direct dependency of auseEffect
, however that's seldom done and necessary, and usually a sign of a missing explicit event asuseEffect
itself will become that event implicitly, but may be invoked much more frequently than necessary.
FWIW, it doesn't seem to be a new convention either from my understanding of the code base. The older versions of the code base either explicitly or implicitly followed this very convention, at least to a much higher degree. Breaking seems to be a more recent trend.
Open to be proven wrong as always – show me an example where useGridSelector
in the affected code is provably necessary. I will do my best to showcase why that may actually not be the case, and come up with an alternative on my end.
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.
Your points make a lot of sense. The reactivity architecture via useGridSelector()
has mostly been my effort, following the point #1 of this discussion, and I initially established the guideline of "always use useGridSelector
" as a way to provide a simple & clear rule for the rest of the team to follow. This in particular allows to easily refactor code between components & root-level hooks, which I've been doing a lot for the somewhat recent performance improvements.
It's inevitable if you mix two paradigms, you end up writing duct tape to keep them in sync. That duct tape in React is useEffect, which becomes an implicit event that is run under certain conditions. Under which exactly can become quite difficult to understand the more direct and indirect dependencies we end up having, and the less isolated the code is to a particular component.
Yes that's a major source of bugs and it's been on my radar for some time. Our state management goes through various cycles of updates/renders before settling on a coherent state because we use the async useEffect
to sync up parts of the state, whereas we should be using something that can synchronously settle on a valid state. For example, if the rows
prop is updated, there are various rounds of (async) updates before the filtered, sorted, and grouped rows slices of state are updated to match the new rows
prop.
I'm not sure yet what's the best way to solve the issue. Going all in into selectors could be a solution, because selectors can lazily sync with the latest state value, though they keep their state in a memoized memory cell that doesn't live on the state
object so that's less debuggable. Alternatively, we could create some event-based system that updates the state synchronously when another part of the state changes, this would not be lazy but it would be more debuggable.
useGridSelector: Perfect to use in component rendering life-cycle / Should be avoided in root-level feature hooks
I'm ok with that convention but it places a burden on the maintainers to be strict about observing those invariants, whereas creating specialized selectors would provide correctness without having to think about the context before using state data. Let me ping the team to see what's the consensus.
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.
Really nice discussion points. A couple of cents from my side.
If we mix state from
useGridSelector
with state from theapiRef
directly, we are mixing state from different render/update cycles.
Yes, this should be avoided as much as possible, I supported the change in #15986 specific to the renderContext
as this particular state update is a bit unusual, I suspected the performance lag in Safari is due to wrapping of the state update in ReactDOM.flushSync
, extracting the value in the event listener seemed like a proper reactive handle for this case. Also supported by the fact that yielded a better scroll performance. The testing I did didn't exhibit any regressions so I moved forward to merge, we could revert if we find one.
An alternate approach for this event (handleScrolling
) could be to either extract the other state (dimensions
) in the function too or use the argument (params.renderContext
) passed to the event handler. 1 would avoid mixing of useGridSelector
and apiRef
slices, while 2 would remove state out-of-sync without extracting the selector slice. (But only for this instance, we'd need to do similar things for other (useGridRowSpanning
)).
useGridSelector
should be avoided in root-level feature hooks
If we manage to make that happen cleanly, it'll definitely make it harder for inactive features to impact the performance or unnecessarily re-render/re-compute some parts of the application, improving the overall performance, however, I'd be careful to avoid breaking an expected reactivity with this change.
All our root-level hooks are grouped, so it wouldn't be too hard to do:
I assume there are some use cases where it's inevitable to avoid useGridSelector
in root hooks, like when they are used as useEffect
dependencies. We'd need to provide an escape hatch to make that happen.
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.
So in the feature hooks, we use plain state selectors in event listeners, and if there's no event, do we use useGridSelector + useEffect?
I think the first question to ask if the event is missing is whether a new event should be added. If a state change triggers another piece of state to change as a side-effect, useEffect/useLayoutEffect
are always worse options to write that logic in React than an event, as things will now happen in different render passes.
useEffect
is an escape hatch from declarative rendering paradigm in react. In theory, the only appropriate use for useEffect
in feature hooks (in relation to the internal state management) should be to sync props with the internal state. Of course there are other appropriate cases like subscribing to DOM events, etc.
I didn't see any obvious examples where I thought useGridSelector
would be necessary in feature hooks, outside of useGridDimensions
and useGridRowsMeta
(although that could be fixed with more work as well, but since it's a core hook rather than feature hook, it's less of a concern to me; readability is much worse though with useGridSelector
).
I'm curious to see if you have any examples though that would prove the inverse. The only theoretical case for useGridSelector
I can think of – an event that mutates internal state needs to access the rendered value of the state (=old state). The only other case I can think of is that a feature hook needs to send the grid to re-render when no component depends on that state – but that smells of side-effects, and likely has a much nicer solution. If such cases would exist, they would likely be broken by react compiler in the future as well. But I haven't found any such cases yet, and this change would have highlighted them as well:
#15666 (comment)
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.
Ah, almost forgot. An alternative escape hatch to useGridSelector/useEffect
could be useGridSelectorChange
. Instead of creating/updating state, it would call a callback if the resulting selector value changes.
But I haven't seen a place where I would use it yet, except for useGridDimensions
/ useGridRowsMeta
.
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 only theoretical case for useGridSelector I can think of – an event that mutates internal state needs to access the rendered value of the state (=old state)
In this case, the old state = the current state (before the new one is applied), so a regular selector should work here. Does this make sense?
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 only theoretical case for useGridSelector I can think of – an event that mutates internal state needs to access the rendered value of the state (=old state)
In this case, the old state = the current state (before the new one is applied), so a regular selector should work here. Does this make sense?
I meant a case, e.g.:
onKeyDown
DOM event firesfocusCell
state is changed (but updated state is not rendered until the next keyframe)onCellKeyDown
internal event is fired- For whatever reason, the
onCellKeyDown
consumer in a feature hook (=different hook than the one that manages focus state) needs to know the currently renderedfocusCell
It's all purely theoretical though – I was just stretching my imagination to come up with a case where useGridSelector
would be a necessary choice over straight selectors in callbacks (as I proposed), and hence tried to poke holes in my other PR. For avoidance of doubt, I haven't seen any practical example in the code where this is an actual use case.
commit 55b01ba Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue Jan 14 20:51:13 2025 +0200 Bump MUI Internal (mui#16177) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit bdd82ae Author: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Tue Jan 14 14:35:41 2025 +0100 [charts] Plot data at first render if `skipAnimation` is set to `true` (mui#16166) Signed-off-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Signed-off-by: Jose C Quintas Jr <juniorquintas@gmail.com> Co-authored-by: Jose C Quintas Jr <juniorquintas@gmail.com> commit ca63047 Author: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Tue Jan 14 13:18:02 2025 +0100 [docs] Add example for custom legend (mui#16169) commit fdcc57e Author: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Tue Jan 14 12:01:56 2025 +0100 [docs] Remove broken links (mui#16167) commit 7c505ea Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Tue Jan 14 07:35:12 2025 +0100 [pickers] Let the field components handle their opening UI, and allow field editing on mobile pickers (mui#15671) Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> commit c7f8cd6 Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Mon Jan 13 16:37:49 2025 +0100 [docs] Add full custom field creation example (mui#15194) Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Signed-off-by: Lukas Tyla <llukas.tyla@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> commit aa515ec Author: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Mon Jan 13 15:53:59 2025 +0100 [charts] Move z-axis to plugin (mui#16130) commit 2c9ddc9 Author: Jose C Quintas Jr <juniorquintas@gmail.com> Date: Mon Jan 13 13:58:06 2025 +0100 [charts] Make `useChartGradientId` public (mui#16106) commit 6e76ec9 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Mon Jan 13 13:18:23 2025 +0200 [code-infra] Stop renovate from updating `date-fns-v2` (mui#16158) commit 770ab40 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 10:03:03 2025 +0200 Bump next to ^15.1.4 (mui#16150) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 2ee4a8f Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:50:58 2025 +0200 Bump pnpm to 9.15.3 (mui#16151) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 89b0740 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:47:53 2025 +0200 Bump markdown-to-jsx to ^7.7.3 (mui#16149) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 3ac1a43 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:47:40 2025 +0200 Bump @octokit/plugin-retry to ^7.1.3 (mui#16140) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit d42a129 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:34:21 2025 +0200 Bump typescript to ^5.7.3 (mui#16152) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 8eaf601 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:31:00 2025 +0200 Bump jscodeshift to 17.1.2 (mui#16148) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit b216ad8 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:21:50 2025 +0200 Bump React (mui#16143) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 1a6dfc2 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:20:37 2025 +0200 Bump @tanstack/query-core to ^5.64.0 (mui#16154) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit eea3ad8 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:20:08 2025 +0200 Bump babel to ^7.26.5 (mui#16146) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 4cfb04c Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 09:19:20 2025 +0200 Bump @types/d3-shape to ^3.1.7 (mui#16141) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 8351f94 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 13 08:51:56 2025 +0200 Bump Material UI to ^5.16.14 (mui#16145) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 6b3dece Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 12 13:43:15 2025 +0000 Bump @octokit/rest to ^21.1.0 (mui#16153) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 41e5994 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 12 13:40:44 2025 +0000 Bump fast-glob to ^3.3.3 (mui#16147) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 71cdcbf Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 12 09:30:42 2025 +0000 Bump GitHub Actions (mui#16144) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit f07901e Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 12 09:28:32 2025 +0000 Bump @types/node to ^20.17.12 (mui#16142) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 49bee80 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 12 05:32:28 2025 +0000 Bump @next/eslint-plugin-next to 15.1.4 (mui#16139) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 3174216 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 12 05:31:35 2025 +0000 Bump @mui/monorepo digest to c51af8e (mui#16138) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 769855d Author: Jose C Quintas Jr <juniorquintas@gmail.com> Date: Sat Jan 11 10:54:03 2025 +0100 [charts] Handle case where gradient stop `offset` could be `Infinite` (mui#16131) commit e93f4d2 Author: Rom Grk <romgrk@users.noreply.github.com> Date: Fri Jan 10 17:25:27 2025 -0500 [DataGrid] Refactor: remove missed theme (mui#16122) commit 9c2224f Author: Jose C Quintas Jr <juniorquintas@gmail.com> Date: Fri Jan 10 16:24:43 2025 +0100 [charts] Replace tooltip mark with style (mui#16117) commit 7d5dd73 Author: Jose C Quintas Jr <juniorquintas@gmail.com> Date: Fri Jan 10 15:41:02 2025 +0100 [charts] Support `rtl` for gradient legend (mui#16115) commit d25c213 Author: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Date: Fri Jan 10 14:30:29 2025 +0100 [docs] Fix demo rendering issue on Codesandbox (mui#16118) commit 1fdcf85 Author: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> Date: Fri Jan 10 13:23:05 2025 +0100 [charts] Use plugin system for series and axes (mui#15865) Co-authored-by: Jose C Quintas Jr <juniorquintas@gmail.com> commit 5999d29 Author: Jose C Quintas Jr <juniorquintas@gmail.com> Date: Fri Jan 10 12:00:00 2025 +0100 [charts][docs] Fix wrong props warnings (mui#16119) commit 7541f95 Author: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Date: Fri Jan 10 11:55:23 2025 +0100 [core] Type all references as `RefObject` (mui#16124) commit 85961a5 Author: Rom Grk <romgrk@users.noreply.github.com> Date: Fri Jan 10 03:26:26 2025 -0500 [DataGrid] refactor: theme to CSS variables (mui#15704) Signed-off-by: Rom Grk <romgrk@users.noreply.github.com> Co-authored-by: Kenan Yusuf <kenan.m.yusuf@gmail.com> commit 9e07e0f Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Fri Jan 10 09:18:12 2025 +0100 [pickers] Use context to pass props from the picker to the field (mui#16042) Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> commit 6412b8c Author: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Date: Thu Jan 9 15:49:00 2025 +0100 v8.0.0-alpha.7 (mui#16110) Signed-off-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> commit 296a499 Author: Bilal Shafi <bilalshafidev@gmail.com> Date: Thu Jan 9 17:13:03 2025 +0500 [DataGridPremium] Server-side aggregation with data source (mui#15741) Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> commit 3b0bba2 Author: Rom Grk <romgrk@users.noreply.github.com> Date: Thu Jan 9 04:18:25 2025 -0500 [core] Update argos screenshots (mui#16111) commit 068ab78 Author: Andrew Cherniavskii <andrew@mui.com> Date: Wed Jan 8 21:52:57 2025 +0100 [DataGridPremium] Improve aggregation performance for multiple columns (mui#16097) commit 3fe74a9 Author: Jose C Quintas Jr <juniorquintas@gmail.com> Date: Wed Jan 8 16:18:31 2025 +0100 [charts] New HTML legend & styles (mui#15733) Signed-off-by: Jose C Quintas Jr <juniorquintas@gmail.com> Co-authored-by: Alexandre Fauquette <45398769+alexfauquette@users.noreply.github.com> commit 86d6e2a Author: Rom Grk <romgrk@users.noreply.github.com> Date: Tue Jan 7 17:39:23 2025 -0500 [DataGrid] Refactor: create tooltip props (mui#16086) commit f1332f1 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Tue Jan 7 16:45:26 2025 +0200 [pickers] Rename `AdapterDateFns` into `AdapterDateFnsV2` and `AdapterDateFnsV3` into `AdapterDateFns` (mui#16082) Signed-off-by: Lukas Tyla <llukas.tyla@gmail.com> Co-authored-by: Michel Engelen <32863416+michelengelen@users.noreply.github.com> commit 0a7ba21 Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Tue Jan 7 14:56:09 2025 +0100 [pickers] Always use `setValue` internally to update the picker value (mui#16056) commit cad579c Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Tue Jan 7 12:35:24 2025 +0100 [pickers] Rename `ctx.onViewChange` to `ctx.setView` and add it to the actions context (mui#16044) commit 011ccd0 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Tue Jan 7 13:32:27 2025 +0200 [pickers] Memoize `<PickersActionBar />` (mui#16071) commit fb23fd1 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Tue Jan 7 12:53:00 2025 +0200 [l10n] Improve Norwegian (nb-NO) locale (mui#16083) (@josteinjhauge) (mui#16089) Signed-off-by: Jostein Hauge <josteinjhauge@me.com> Co-authored-by: Jostein Hauge <josteinjhauge@me.com> commit 0a8dff6 Author: tomashauser <37981481+tomashauser@users.noreply.github.com> Date: Tue Jan 7 09:23:10 2025 +0100 [docs] Fix non-existing "adapter" property of LocalizationProvider (mui#16084) commit 0f66a53 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 6 12:25:52 2025 +0200 Lock file maintenance (mui#16051) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 8e785f9 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 6 16:43:26 2025 +0700 Bump @mui/monorepo digest to 5d892ca (mui#16073) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 82cf0ed Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 6 11:20:02 2025 +0200 Bump markdownlint-cli2 to ^0.17.1 (mui#16079) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 5189633 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 6 11:15:50 2025 +0200 Bump concurrently to ^9.1.2 (mui#16078) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit b80d266 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 6 11:09:21 2025 +0200 Bump @tanstack/query-core to ^5.62.15 (mui#16074) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 7c41d42 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 6 11:04:23 2025 +0200 Bump styled-components to ^6.1.14 (mui#16080) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 0219cb4 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Jan 6 11:00:43 2025 +0200 Bump MUI Internal (mui#16077) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 5a267e7 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 5 04:43:34 2025 +0000 Bump @types/node to ^20.17.11 (mui#16076) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 959dc9d Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Jan 5 04:42:38 2025 +0000 Bump @types/lodash to ^4.17.14 (mui#16075) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 3ebf4fb Author: Rom Grk <romgrk@users.noreply.github.com> Date: Fri Jan 3 18:23:01 2025 -0500 [DataGrid] Refactor: create base button props (mui#15930) commit 513b8f6 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Fri Jan 3 15:37:59 2025 +0200 [pickers] Update `closeOnSelect` and `actionBar.actions` default values (mui#15944) Signed-off-by: Lukas Tyla <llukas.tyla@gmail.com> Co-authored-by: Arthur Balduini <arthurbalduini@Arthurs-MacBook-Pro.local> Co-authored-by: arthurbalduini <arthurbalduini2@gmail.com> commit 5f0cd45 Author: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Date: Fri Jan 3 14:12:01 2025 +0100 [DataGrid] Fix number filter field formatting values while typing (mui#16062) commit d85fff1 Author: Jose C Quintas Jr <juniorquintas@gmail.com> Date: Thu Jan 2 12:42:58 2025 +0100 [code-infra] Add `testSkipIf` and `describeSkipIf` (mui#16049) Signed-off-by: Jose C Quintas Jr <juniorquintas@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> commit 3fffa77 Author: Steve Xu <stevexugc@gmail.com> Date: Thu Jan 2 17:25:40 2025 +0800 [l10n] Add Chinese (Taiwan) (zh-TW) locale (mui#16033) Signed-off-by: Steve Xu <stevexugc@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> commit 3b47f1d Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Wed Jan 1 21:23:49 2025 +0700 Bump @mui/monorepo digest to 84d6ecf (mui#16021) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas <llukas.tyla@gmail.com> commit 88438a1 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Wed Jan 1 14:25:27 2025 +0200 [test] Stabilize flaky Data Grid tests (mui#16053) commit a5f4a73 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue Dec 31 14:55:55 2024 +0200 Bump MUI Internal (mui#16028) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 390211c Author: Rajat <robertdoweny2301@gmail.com> Date: Tue Dec 31 17:53:50 2024 +0530 [docs] Fix `EditingWithDatePickers` demo (mui#15967) commit d570c6d Author: Andrew Cherniavskii <andrew@mui.com> Date: Tue Dec 31 13:22:53 2024 +0100 [DataGrid] Fix TS error (mui#16046) commit 797c5a0 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue Dec 31 13:57:37 2024 +0200 Bump next to ^15.1.3 (mui#16026) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 552f08b Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue Dec 31 13:57:00 2024 +0200 Bump @tanstack/query-core to ^5.62.9 (mui#16023) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 2f4af7e Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Tue Dec 31 12:55:57 2024 +0100 [docs] Fix inconsistent multi input range field separators (mui#16043) commit f689693 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Tue Dec 31 13:55:29 2024 +0200 Bump pnpm to 9.15.2 (mui#16027) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit ea384f1 Author: Rajat <robertdoweny2301@gmail.com> Date: Tue Dec 31 16:08:36 2024 +0530 [DataGridPremium] Make Aggregation keyboard accessible in the column menu (mui#15934) Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com> commit 20e037b Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Tue Dec 31 10:56:57 2024 +0100 [pickers] Introduce a new concept of `manager` (mui#15339) Signed-off-by: Flavien DELANGLE <flaviendelangle@gmail.com> Co-authored-by: Lukas Tyla <llukas.tyla@gmail.com> commit e5471d4 Author: Derek Alvarado <derekalvarado24@outlook.com> Date: Mon Dec 30 15:59:16 2024 -0700 [DataGrid] Add `name` attribute to selection checkboxes (mui#15178) Co-authored-by: Andrew Cherniavskii <andrew.cherniavskii@gmail.com> commit 43411bf Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Mon Dec 30 17:31:41 2024 +0100 [pickers] Create a new context to pass the range position props to the layout components and to the views (mui#15846) commit 9bce04c Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Mon Dec 30 18:21:16 2024 +0200 [fields] Handle focusing container with `inputRef.current.focus` on `accessibleFieldDOMStructure` (mui#15985) commit 3ead503 Author: Andrew Cherniavskii <andrew@mui.com> Date: Mon Dec 30 17:10:14 2024 +0100 [core] Update the `release:version` docs (mui#16038) commit 0c6aa25 Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Mon Dec 30 16:27:38 2024 +0100 [pickers] Remove `NonEmptyDateRange` type (mui#16035) commit 2cc9bc8 Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Mon Dec 30 16:26:21 2024 +0100 [docs] Unify the wording of the pickers slots breaking changes (mui#16036) commit e283172 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 30 17:04:59 2024 +0200 [core] Improve React 19 support (mui#15769) Signed-off-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jose Quintas <juniorquintas@gmail.com> Co-authored-by: Lukas <llukas.tyla@gmail.com> Co-authored-by: flavien <flaviendelangle@gmail.com> Co-authored-by: Armin Mehinovic <armin@mui.com> Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com> Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com> commit 89215a1 Author: Bilal Shafi <bilalshafidev@gmail.com> Date: Mon Dec 30 19:58:59 2024 +0500 [DataGrid] Fix select all checkbox state reset with server side data (mui#16034) commit 61346b3 Author: Flavien DELANGLE <flaviendelangle@gmail.com> Date: Mon Dec 30 10:14:59 2024 +0100 [pickers] Use `usePickerContext()` and `usePickerActionsContext()` instead of passing props to the `shortcuts` and `toolbar` slots (mui#15948) commit dac7c3d Author: Olivier Tassinari <olivier.tassinari@gmail.com> Date: Sun Dec 29 13:22:12 2024 +0100 [core] Small fixes on docs commit 2fa4d4f Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 29 06:16:16 2024 +0000 Bump markdownlint-cli2 to ^0.17.0 (mui#16029) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 2c0a4a4 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 29 06:15:15 2024 +0000 Bump eslint-plugin-react to ^7.37.3 (mui#16025) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 7e7d63b Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 29 04:56:05 2024 +0000 Bump concurrently to ^9.1.1 (mui#16024) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 25ae6e4 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 29 04:55:10 2024 +0000 Bump @next/eslint-plugin-next to 15.1.3 (mui#16022) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 7bc37b2 Author: Bilal Shafi <bilalshafidev@gmail.com> Date: Sat Dec 28 12:20:24 2024 +0500 [core] Clarify the release strategy (mui#16014) Co-authored-by: Andrew Cherniavskii <andrew.cherniavskii@gmail.com> commit 2799763 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Fri Dec 27 18:06:40 2024 +0200 [pickers] Support `date-fns-jalali` v4 (mui#16011) commit dcdc59e Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Fri Dec 27 15:07:37 2024 +0200 [docs] Refactor Data Grid with Date Pickers example (mui#15992) commit d8dbace Author: Olivier Tassinari <olivier.tassinari@gmail.com> Date: Fri Dec 27 02:10:59 2024 +0100 [core] Sync with other repos commit 9c0c462 Author: Olivier Tassinari <olivier.tassinari@gmail.com> Date: Fri Dec 27 01:28:01 2024 +0100 [docs] Fix 301 redirections Reported in https://app.ahrefs.com/site-audit/6021552/issues?current=25-12-2024T023235 commit 61d8511 Author: Danail Hadjiatanasov <hadjiatanasov@gmail.com> Date: Thu Dec 26 22:13:45 2024 +0200 v8.0.0-alpha.6 (mui#16002) commit b061f55 Author: Lauri <lauri.lehtmaa@gmail.com> Date: Thu Dec 26 10:13:55 2024 +0100 [data grid] Avoid subscribing to `renderContext` state in grid root for better scroll performance (mui#15986) commit 758d8b8 Author: Lukas Tyla <llukas.tyla@gmail.com> Date: Tue Dec 24 10:06:37 2024 +0200 [l10n] Improve Dutch (nl-NL) locale (mui#15920) @JoepVerkoelen (mui#15994) Signed-off-by: JoepVerkoelen <jverkoelen@gmail.com> Co-authored-by: JoepVerkoelen <jverkoelen@gmail.com> Co-authored-by: Joep Verkoelen <joep.verkoelen@infradaxoverheid.nl> commit 4a649f2 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 17:47:28 2024 +0100 Bump @codspeed/vitest-plugin to ^4.0.0 (mui#15898) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jose Quintas <juniorquintas@gmail.com> commit a886d98 Author: Bilal Shafi <bilalshafidev@gmail.com> Date: Mon Dec 23 18:07:16 2024 +0500 [DataGrid] Improve test coverage of server side data source (mui#15942) commit f572940 Author: Rajat <robertdoweny2301@gmail.com> Date: Mon Dec 23 18:27:07 2024 +0530 [DataGrid] Fix header filters showing clear button while empty (mui#15829) Co-authored-by: Armin Mehinovic <armin@mui.com> commit 26b1463 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 11:21:25 2024 +0200 Bump webpack-cli to ^6.0.1 (mui#15980) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit a7e6782 Author: Lauri <lauri.lehtmaa@gmail.com> Date: Mon Dec 23 09:53:35 2024 +0100 [DataGrid] Replace `forwardRef` with a shim for forward compatibility (mui#15955) commit a58d118 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 10:07:10 2024 +0200 Bump pnpm to 9.15.1 (mui#15977) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 0a8efa4 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 10:06:57 2024 +0200 Bump React router to ^6.28.1 (mui#15974) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit ee83cad Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 09:45:24 2024 +0200 Bump react-hook-form to ^7.54.2 (mui#15978) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit ca29c58 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 09:41:48 2024 +0200 Bump markdown-to-jsx to ^7.7.2 (mui#15975) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 4b73330 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 09:40:59 2024 +0200 Bump @tanstack/query-core to ^5.62.8 (mui#15972) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 1d72f1a Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 09:40:27 2024 +0200 Bump @docsearch/react to ^3.8.2 (mui#15970) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit ae9c40b Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Mon Dec 23 09:27:14 2024 +0200 Bump next to ^15.1.2 (mui#15976) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 032c788 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 22 08:24:39 2024 +0000 Bump github/codeql-action action to v3.28.0 (mui#15979) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 9ab258d Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 22 08:20:03 2024 +0000 Bump @types/react to ^18.3.18 (mui#15973) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 0458ca5 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 22 04:28:13 2024 +0000 Bump @next/eslint-plugin-next to 15.1.2 (mui#15971) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 5e7eaa5 Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 22 04:27:18 2024 +0000 Bump @mui/monorepo digest to 0ea1ef5 (mui#15969) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 1bac67d Author: Rom Grk <romgrk@users.noreply.github.com> Date: Fri Dec 20 18:03:58 2024 -0500 [DataGrid] Refactor: move skeleton to leaf import (mui#15931) commit f985ea0 Author: Lauri <lauri.lehtmaa@gmail.com> Date: Fri Dec 20 23:48:32 2024 +0100 [docs] remove production profiler from docs build (mui#15959) commit 562675c Author: Rom Grk <romgrk@users.noreply.github.com> Date: Fri Dec 20 17:43:15 2024 -0500 [DataGrid] Refactor: move progress components to leaf import (mui#15914) Signed-off-by: Rom Grk <romgrk@users.noreply.github.com> Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com> Co-authored-by: Kenan Yusuf <kenan.m.yusuf@gmail.com>
Probably fixes #15168
@MBilalShafi, started thinking about it, and I can see now why this selector hook is problematic:
mui-x/packages/x-data-grid/src/hooks/features/rows/useGridRowSpanning.ts
Line 228 in 26b1463
We're forcing the root of the grid to re-render every time
renderContext
changes (which can happen quite a lot when scrolling fast), which adds extra overhead, since all the root hooks need to re-evaluate as well. Regardless of whetherrowSpanning
is enabled or not. Saw that the same issue is also present inuseGridDataSourceLazyLoader
. We should rely on events instead of creating new state there.Removed the top-level
renderContext
selector hooks for both, and slightly improvedrowSpanning
feature isolation.