Skip to content

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Sep 23, 2025

@mui-bot
Copy link

mui-bot commented Sep 23, 2025

Deploy preview: https://deploy-preview-19674--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 ▼-4B(0.00%) ▼-3B(0.00%)
@mui/x-data-grid-premium ▼-22B(0.00%) ▼-20B(-0.01%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro ▼-22B(-0.01%) ▼-30B(-0.02%)
@mui/x-charts-premium ▼-22B(-0.01%) ▼-27B(-0.02%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro ▼-16B(-0.01%) ▼-10B(-0.01%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro ▼-4B(0.00%) ▼-11B(-0.04%)

Details of bundle changes

Generated by 🚫 dangerJS against 1b4cf19

@Janpot Janpot added type: bug It doesn't behave as expected. scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). labels Sep 23, 2025
@Janpot
Copy link
Member Author

Janpot commented Sep 24, 2025

increase caused by vite preload code being included in the output
See vitejs/vite#18551

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 26, 2025
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Sep 30, 2025
@Janpot Janpot marked this pull request as ready for review September 30, 2025 08:33
@Janpot Janpot requested review from a team and flaviendelangle September 30, 2025 08:33
Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

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

Looks perfect!

@Janpot Janpot changed the title [code-infra] Try bundle size stabilizer [code-infra] Stabilize size for bundles with releaseInfo Oct 1, 2025
@Janpot Janpot merged commit 2e35cd4 into mui:master Oct 1, 2025
21 checks passed
upload: !!process.env.CI,
replace: {
// Stabilize release info string
[JSON.stringify(generateReleaseInfo())]: JSON.stringify('__RELEASE_INFO__'),
Copy link
Contributor

Choose a reason for hiding this comment

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

@Janpot Looking at the usage, shouldn't the key and values should be other way round, ie,

replace: {
  // Stabilize release info string
  [JSON.stringify('__RELEASE_INFO__')]: JSON.stringify(generateReleaseInfo()),
}

which would mean that look for __RELEASE_INFO__ and replace with the generateReleaseInfo() value.

Also, the JSON.stringify() call can probably be part of the bundle-size-checker package to simplify the config in repos.

Copy link
Member Author

@Janpot Janpot Oct 1, 2025

Choose a reason for hiding this comment

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

Looking at the usage, shouldn't the key and values should be other way round

No, this PR attempts to exactly revert what X does in their bundles. So we want releaseInfo to be set back to "__RELEASE_INFO__" . That way this value will be constant across releases and not cause slight differences in gzip.

Also, the JSON.stringify() call can probably be part of the bundle-size-checker package to simplify the config in repos.

JSON.stringify() is there to add the quotes with automatic escaping. I think we want to keep supporting the case where you want to replace a value that is not a string literal.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. So it still supports the other search: value use-case. This config is just specific to mui-x.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's similar to how define works. Just for more than only top-level constants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code-infra] The bundle size report have false position on MUI X commercial packages

4 participants