Skip to content

Conversation

michelengelen
Copy link
Member

@michelengelen michelengelen commented Sep 17, 2025

Some of us use a custom index file to ensure hydration, apply theming, etc is not causing any problems, so the overwrite of this, when restarting the playground was annoying.

Example index file (thanks @romgrk):
https://gist.github.com/michelengelen/4e3be09aab5d2be1a1e346eab07dc7cc

@michelengelen michelengelen self-assigned this Sep 17, 2025
@michelengelen michelengelen added type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). labels Sep 17, 2025
@mui-bot
Copy link

mui-bot commented Sep 17, 2025

Deploy preview: https://deploy-preview-19603--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%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 0e16deb

"icons": "rimraf public/static/icons/* && node ./scripts/buildIcons.js",
"serve": "serve ./export -l 3010",
"create-playground": "cpy --cwd=scripts playground.template.tsx ../../pages/playground --rename=index.tsx",
"create-playground": "if [ ! -f ./pages/playground/index.tsx ]; then cpy --cwd=scripts playground.template.tsx ../../pages/playground --rename=index.tsx; fi",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"create-playground": "if [ ! -f ./pages/playground/index.tsx ]; then cpy --cwd=scripts playground.template.tsx ../../pages/playground --rename=index.tsx; fi",
"create-playground": "cpy --cwd=scripts playground.template.tsx ../../pages/playground --rename=index.tsx --no-overwrite",

https://www.npmjs.com/package/cpy-cli

Copy link
Member

Choose a reason for hiding this comment

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

if we are using a custom cli might as well use it's features 😆

Copy link
Member Author

Choose a reason for hiding this comment

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

I know... but this will exit the command with code 1. that's why I wrapped it in the if

Copy link
Member

Choose a reason for hiding this comment

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

|| true

Copy link
Member Author

Choose a reason for hiding this comment

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

|| true

Will never catch other issues when actually trying to copy

Copy link
Member

Choose a reason for hiding this comment

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

It just won't exit with code 1+, it will still print the error to the console.

Otherwise I would rather we have a node script that does this, instead of having a full if block there 😆

Copy link
Member Author

Choose a reason for hiding this comment

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

I know.... felt super overkill. Benefits of the if are that the command will actually properly fail and not silently ... I don't find the if that disturbing tbh. It should be preferred over the silent fail though

Copy link
Member

Choose a reason for hiding this comment

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

yeah but that if wont work in windows if ppl are using it for some reason, which I believe is the reason to use the copy cli in the first place, instead of simply cp

Copy link
Member Author

Choose a reason for hiding this comment

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

yea, i keep forgetting about those ... did a quick node script and could therefor remove the cpy package as well, since this was the only place it got used anyways!

@michelengelen michelengelen enabled auto-merge (squash) September 17, 2025 12:16
@michelengelen michelengelen merged commit f11cc37 into mui:master Sep 17, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). 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.

3 participants