Skip to content
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

Remove UMD list from bundle size comparison code #162

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions contributor-dashboard-legacy/src/pages/SizeComparison.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,6 @@ const CompareTable = memo(function CompareTable({
});
Copy link
Member

@oliviertassinari oliviertassinari May 10, 2024

Choose a reason for hiding this comment

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

Do we need to keep the contributor-dashboard-legacy tool?

Suggested change
});


function getMainBundleLabel(bundleId: string): string {
if (
bundleId === "packages/material-ui/build/umd/material-ui.production.min.js"
) {
return "@mui/material[umd]";
}
if (bundleId === "@material-ui/core/Textarea") {
return "TextareaAutosize";
}
Expand Down
8 changes: 0 additions & 8 deletions tools-public/toolpad/resources/bundleSizeQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import axios from 'axios';

function getMainBundleLabel(bundleId: string): string {
Copy link
Member

@oliviertassinari oliviertassinari May 10, 2024

Choose a reason for hiding this comment

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

I feel like by default we should use the bundleId. @material-ui/core/Textarea looks clearer than TextareaAutosize to me. I recall Sebastian wanted the bundleId to never change so we could always compare sizes with any previous build. While I admire Sebastian for the depth at which he's considering problems, I never felt that this was matching the use case for the tool, removing this constraint feels more pragmatic.

In any case, if we want to keep bundleId immutable, it still feels like we would do this: https://github.com/mui/mui-public/pull/162/files#r1597223021, moving the labels logic to each repository, not have it in https://github.com/mui/mui-public.

if (bundleId === 'packages/material-ui/build/umd/material-ui.production.min.js') {
return '@mui/material[umd]';
}
if (bundleId === '@material-ui/core/Textarea') {
return 'TextareaAutosize';
}
Expand All @@ -23,11 +20,6 @@ function getMainBundleLabel(bundleId: string): string {
.replace(/^@material-ui\/unstyled$/, '@mui/core')
Copy link
Member

@oliviertassinari oliviertassinari May 10, 2024

Choose a reason for hiding this comment

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

Suggested change
.replace(/^@material-ui\/unstyled$/, '@mui/core')
.replace(/^@material-ui\/unstyled$/, '@mui/base')

Actually, it would make more sense to me to host the label logic in https://s3.eu-central-1.amazonaws.com/mui-org-ci/artifacts/master/latest/size-snapshot.json:

Suggested change
.replace(/^@material-ui\/unstyled$/, '@mui/core')

// org rename
.replace(/^@material-ui\/([\w-]+)$/, '@mui/$1')
// path renames
.replace(
/^packages\/material-ui\/material-ui\.production\.min\.js$/,
'packages/mui-material/material-ui.production.min.js',
)
.replace(/^@material-ui\/core\//, '')
.replace(/\.esm$/, '')
);
Expand Down
Loading