Skip to content

Conversation

arminmeh
Copy link
Contributor

@arminmeh arminmeh commented Jul 31, 2025

Reduces total download for all images in the demo from ~5MB to ~90kB.

I have resized the images down to 120x120 - double than the image size from styles - because of retina displays

I have also made master/detail props static, as it is suggested in https://mui.com/x/react-data-grid/master-detail

Preview
https://deploy-preview-19004--material-ui-x.netlify.app/x/react-data-grid/demos/inventory/

@arminmeh arminmeh added docs Improvements or additions to the documentation. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. labels Jul 31, 2025
@mui-bot
Copy link

mui-bot commented Jul 31, 2025

Deploy preview: https://deploy-preview-19004--material-ui-x.netlify.app/

Bundle size report

Bundle Parsed Size Gzip Size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 🔺+1B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 5badd27

@bernardobelchior
Copy link
Member

Not sure if you already have these issues in a todo, but the rating seems to be cut off in desktop and the experience seems a bit weird in mobile:

Screen.Recording.2025-08-01.at.08.57.28.mov

@@ -33,7 +33,7 @@ export const products: Product[] = [
incoming: 30,
colors: ['Black', 'Silver'],
image:
'https://images.pexels.com/photos/1983037/pexels-photo-1983037.jpeg?_gl=1*bf4yfr*_ga*OTUxMzk3MTE0LjE3NTAxOTYyMTM.*_ga_8JE65Q40S6*czE3NTAxOTYyMTMkbzEkZzEkdDE3NTAxOTYyMjgkajQ1JGwwJGgw',
'https://images.pexels.com/photos/1983037/pexels-photo-1983037.jpeg?w=120&h=120&fit=crop',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we self-host these? I wonder if we might face throttling or the images might become unavailable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a TODO above to update images, but I left that task out of this PR
Update could also include putting them in our assets

CC @alelthomas

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup - adding them to our assets as we did the avatars for the PTO Calendar

@arminmeh
Copy link
Contributor Author

arminmeh commented Aug 1, 2025

Not sure if you already have these issues in a todo, but the rating seems to be cut off in desktop and the experience seems a bit weird in mobile:

My impression was that there is a follow up (based on #18180 (comment)), but I am not sure where to find it
@alelthomas @KenanYusuf maybe you can share a link?

I saw that issues with the ratings, but I also noticed that we put labels in the aggregation in a different columns that the values related to those labels, which looks fine initially, but gets broken if you re-order columns

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick

I have resized the images down to 120x120 - double than the image size from styles - because of retina displays

They have an API option dpr (device pixel ratio) for this.
Using that might yield better results. 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not all images are from the same platform, so I will leave this out for a follow up

@alelthomas
Copy link
Contributor

My impression was that there is a follow up (based on #18180 (comment)), but I am not sure where to find it
@alelthomas @KenanYusuf maybe you can share a link?

I created #18994 to work on the container and visualization issues given that everything looks very constrained still with the current setup. I'm planning on fixing these there!

@arminmeh arminmeh force-pushed the grid-demo-image-size branch from b6f6892 to 5badd27 Compare August 8, 2025 07:36
@arminmeh arminmeh enabled auto-merge (squash) August 8, 2025 07:40
@arminmeh arminmeh merged commit 49d5efd into mui:master Aug 8, 2025
20 checks passed
@arminmeh arminmeh deleted the grid-demo-image-size branch August 8, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants