[data grid] Ability to let webworker handle serialization when exporting #16440
Labels
component: data grid
This is the name of the generic UI component, not the React module!
feature: Export
new feature
New feature or request
plan: Premium
Impact at least one Premium user
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Summary
As stated in #6772 there is an issue with exporting large amounts of rows, even when using a webworker the serialization can freeze the main thread.
I would like to be able to let the webworker handle serialization when using a webworker. It also hinders us to show the progress of the export, sometimes the alert renders in time, but sometimes it freezes before it can be shown.
Edit:
After some digging, this code seems to be in large part responsible for the freeze:
https://github.com/mui/mui-x/blob/7a960127e541f5c401ecf16e74b59eb351ac5ad5/packages/x-data-grid-premium/src/hooks/features/export/useGridExcelExport.tsx#L143C1-L151C37
apiRef is used in
serializeRowUnsafe
so it can't be sent to the worker unless we can't send it the data it needs to run the functions.Examples
Here's an example of 50 000 rows freezing the main thread https://stackblitz.com/edit/react-s1jtpzft
Motivation
Having a set limit of rows to be exportable without freezing doesn't seem userfriendly and since have webworker support, as much work as possible should be done by the worker.
Search keywords: datagrid, exporting
The text was updated successfully, but these errors were encountered: