-
-
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
[DataGridPro] Fetch new rows only once when multiple models are changed in one cycle #16101
Conversation
Deploy preview: https://deploy-preview-16101--material-ui-x.netlify.app/ |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
679f628
to
d5c8643
Compare
695e46e
to
25fd944
Compare
It looks like that |
That's super weird. This might be a symptom of an issue on our side. I'll take a look at it to better understand what's going on there. |
packages/x-data-grid-pro/src/tests/dataSource.DataGridPro.test.tsx
Outdated
Show resolved
Hide resolved
a12dc93
to
9d0ff0b
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
packages/x-data-grid-pro/src/hooks/features/dataSource/useGridDataSourceBase.ts
Show resolved
Hide resolved
6aa3cce
to
acc7afa
Compare
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.
Thanks for the additional updates around the test cases.
packages/x-data-grid-premium/src/tests/dataSourceAggregation.DataGridPremium.test.tsx
Show resolved
Hide resolved
9c83124
to
8d65cfd
Compare
This reverts commit 2011736.
e683731
to
1994bb9
Compare
@cherniavskii I had to update the setup once more. as a workaround I have created an empty spy and I call both spy and the mock server with the same params one after the other also, spy is reset on every data source change which updates correctly once mock server config is changed but is kept after re-rendering in addition to this I have changed the way custom cache is used. one test with the cache was flaky erroring on the check of the cache size. Now, each test has it's own instance of the test cache |
Cherry-pick PRs will be created targeting branches: v7.x |
…ed in one cycle (mui#16101) Co-authored-by: Andrew Cherniavskyi <[email protected]>
@@ -324,6 +322,8 @@ export const useGridDataSourceBase = <Api extends GridPrivateApiPro>( | |||
[apiRef], | |||
); | |||
|
|||
const debouncedFetchRows = React.useMemo(() => debounce(fetchRows, 0), [fetchRows]); |
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 wonder if using a microtask callback wouldn't have been better than a timeout (aka task). It would keep the overall update to within the same event loop cycle.
…ed in one cycle (mui#16101) Co-authored-by: Andrew Cherniavskyi <[email protected]>
Extracted from the work in #15378
It is also needed in #15548
This way, it will be easier to cherry pick it to v7