Skip to content

[code-infra] Create bundle size package #45911

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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Apr 14, 2025

Extract a package for bundle size checking.

As a baseline in this PR we do

  • Create new package @mui/internal-bundle-size-checker
  • Create 'bundle-size-checker' bin command
  • Support bundle-size-checker.config.mjs to define entry points
  • Create a bundle-size workspace as an isolated invironment to run the bundle size checker in
  • Move the scripts to ESM
  • Remove @mui/styles from bundle size report
  • Remove lodash
  • Add option for output location of size-snapshot.json file
  • Store snapshots under <org>/<repo>/<commit>, don't add branch name
  • Store on every CI run, also PRs, but add a 30days retention for those
  • Move upload to the CLI and make this configurable in the config file
  • Incorporate the sizeDiff functionality from the UI revamp
  • Export a function to generate markdown for the dangerfile
  • Move to the mui-public repository [code-infra] bring bundle size checker to mui-public mui-public#310

To explain the new strategy for storing snapshots: it will allow us to craft a comparison table just by providing PR number. We will fetch the pr info via api. From that result we can get head.sha and base.sha. we use those to get the two S3 urls to compare. We have the AWS secrets available on PRs so we may as well use them. This method of retrieval will be much easier than the one using circleci artifacts (circleci doesn't set cors policy on their API, which forces us to build a proxy that does).

we're changing the S3 urls as follows:

  • add a repository segment, so that we can use this bucket for multiple projects
  • remove base ref, redundant information and potential source of conflict, we can just fetch by sha alone. We're adding the branch as a tag.

new bundle size app

Sorry, something went wrong.

@Janpot Janpot added the scope: code-infra Specific to the core-infra product label Apr 14, 2025
@mui-bot
Copy link

mui-bot commented Apr 14, 2025

Netlify deploy preview

https://deploy-preview-45911--material-ui.netlify.app/

Bundle size report

Total Size Change: -49.3KB(-0.41%) - Total Gzip Change: -15.3KB(-0.37%)
Files: 190 total (0 added, 1 removed, 113 changed)

@mui/stylesparsed: -49.4KB(removed) gzip: -15.3KB(removed)

Show 113 more bundle changes

@mui/labparsed: +2B(0.00%) gzip: -2B(0.00%)
@mui/lab/LoadingButtonparsed: +2B(0.00%) gzip: +3B(+0.01%)
@mui/lab/TabListparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/materialparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/AccordionSummaryparsed: +2B(0.00%) gzip: +15B(+0.05%)
@mui/material/Alertparsed: +2B(0.00%) gzip: +3B(+0.01%)
@mui/material/Autocompleteparsed: +2B(0.00%) gzip: +1B(0.00%)
@mui/material/BottomNavigationActionparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/Breadcrumbsparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/Buttonparsed: +2B(0.00%) gzip: +4B(+0.01%)
@mui/material/ButtonBaseparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/CardActionAreaparsed: +2B(0.00%) gzip: -2B(-0.01%)
@mui/material/Checkboxparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/Chipparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/CircularProgressparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/CssBaselineparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/Fabparsed: +2B(0.00%) gzip: -3B(-0.01%)
@mui/material/FilledInputparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/GlobalStylesparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/IconButtonparsed: +2B(0.00%) gzip: +3B(+0.01%)
@mui/material/Inputparsed: +2B(0.00%) gzip: -2B(-0.01%)
@mui/material/InputBaseparsed: +2B(0.00%) gzip: -2B(-0.01%)
@mui/material/LinearProgressparsed: +2B(0.00%) gzip: -25B(-0.09%)
@mui/material/ListItemButtonparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/MenuItemparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/MobileStepperparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/NativeSelectparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/OutlinedInputparsed: +2B(0.00%) gzip: +2B(+0.01%)
@mui/material/Paginationparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/PaginationItemparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/Radioparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/ScopedCssBaselineparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/Selectparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/Skeletonparsed: +2B(0.00%) gzip: -1B(0.00%)
@mui/material/SpeedDialparsed: +2B(0.00%) gzip: +1B(0.00%)
@mui/material/SpeedDialActionparsed: +2B(0.00%) gzip: +3B(+0.01%)
@mui/material/StepButtonparsed: +2B(0.00%) gzip: +1B(0.00%)
@mui/material/Switchparsed: +2B(0.00%) gzip: -2B(-0.01%)
@mui/material/Tabparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/TablePaginationparsed: +2B(0.00%) gzip: +2B(0.00%)
@mui/material/TableSortLabelparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/Tabsparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/TabScrollButtonparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/material/TextFieldparsed: +2B(0.00%) gzip: +2B(0.00%)
@mui/material/ToggleButtonparsed: +2B(0.00%) gzip: +1B(0.00%)
@mui/systemparsed: +2B(0.00%) gzip: 0B(0.00%)
@mui/utilsparsed: +2B(+0.02%) gzip: +3B(+0.06%)
@mui/lab/Masonryparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/lab/TabPanelparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/lab/Timelineparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/lab/TimelineConnectorparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/lab/TimelineDotparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/lab/TimelineItemparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/lab/TimelineSeparatorparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Accordionparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/AccordionActionsparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/AccordionDetailsparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/AlertTitleparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/AppBarparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Avatarparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/AvatarGroupparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Backdropparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/BottomNavigationparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Boxparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/CardActionsparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/CardContentparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/CardHeaderparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Collapseparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Containerparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Dialogparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/DialogActionsparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/DialogContentparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/DialogContentTextparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Dividerparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Drawerparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/FormControlparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/FormGroupparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/FormHelperTextparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/FormLabelparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Gridparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Iconparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ImageListItemparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ImageListItemBarparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/InputAdornmentparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Linkparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Listparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ListItemparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ListItemAvatarparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ListItemIconparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ListItemSecondaryActionparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ListSubheaderparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Menuparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/MenuListparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Modalparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Paperparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Popperparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/RadioGroupparsed: 0B(0.00%) gzip: +2B(+0.01%)
@mui/material/Ratingparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Snackbarparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/SnackbarContentparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Stepparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/StepIconparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/StepLabelparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Stepperparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/SvgIconparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/SwipeableDrawerparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/Tableparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/TableCellparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/TableContainerparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/TableFooterparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/material/ToggleButtonGroupparsed: 0B(0.00%) gzip: +1B(0.00%)
@mui/system/createBoxparsed: 0B(0.00%) gzip: +1B(+0.01%)
@mui/system/createStyledparsed: 0B(0.00%) gzip: +1B(+0.01%)

Details of bundle changes

Generated by 🚫 dangerJS against 86bf8b0

@Janpot Janpot marked this pull request as ready for review April 22, 2025 09:42
@zannager zannager requested a review from DiegoAndai April 22, 2025 10:59
commit 54328c9
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 13:02:21 2025 +0200

    Update renderMarkdownReport.js

commit a7a84dd
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 12:52:14 2025 +0200

    Update renderMarkdownReport.js

commit d5a4f41
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 12:50:09 2025 +0200

    Update renderMarkdownReport.js

commit 3add681
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 12:48:56 2025 +0200

    Update renderMarkdownReport.js

commit 6d59d4d
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 12:33:44 2025 +0200

    Update renderMarkdownReport.js

commit 2760edc
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 11:44:44 2025 +0200

    Update index.js

commit c0feb51
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 10:55:33 2025 +0200

    Update renderMarkdownReport.js

commit 33673c4
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 10:53:31 2025 +0200

    Update dangerFileContent.ts

commit a48e2c5
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 10:52:54 2025 +0200

    hgf

commit a66d7a5
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 10:36:11 2025 +0200

    Update renderMarkdownReport.js

commit f86dac1
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 10:35:25 2025 +0200

    Update renderMarkdownReport.js

commit 802da05
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 10:23:04 2025 +0200

    Update renderMarkdownReport.js

commit 5d34f9e
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 10:01:17 2025 +0200

    Update fetchSnapshot.js

commit 32c6f0e
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 20:35:18 2025 +0200

    refactor

commit d181d0b
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 18:22:40 2025 +0200

    Update dangerFileContent.ts

commit 54faf15
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 18:22:17 2025 +0200

    Update dangerFileContent.ts

commit fd28d71
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 18:21:59 2025 +0200

    circleciBuildNumber

commit eb65bf0
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 18:08:55 2025 +0200

    Update dangerFileContent.ts

commit 4de9e83
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 18:07:37 2025 +0200

    Update renderMarkdownReport.js

commit 7d83034
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 17:44:25 2025 +0200

    frefer

commit 3578d19
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:52:25 2025 +0200

    Update renderMarkdownReport.js

commit edf282d
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:41:09 2025 +0200

    Update renderMarkdownReport.js

commit 7e5637f
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:40:31 2025 +0200

    Update renderMarkdownReport.js

commit a2830e1
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:39:15 2025 +0200

    Update renderMarkdownReport.js

commit b3d918c
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:38:35 2025 +0200

    add in front for less visual clutter

commit 11af718
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:38:05 2025 +0200

    reduce amount of triangles

commit e15e249
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:28:49 2025 +0200

    Update dangerFileContent.ts

commit d67a4b3
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:28:25 2025 +0200

    frwefre

commit c4fa1c5
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:19:43 2025 +0200

    Update renderMarkdownReport.js

commit ce11999
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:17:47 2025 +0200

    Update renderMarkdownReport.js

commit ea00540
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:16:39 2025 +0200

    Update renderMarkdownReport.js

commit 10c680f
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:16:21 2025 +0200

    Update renderMarkdownReport.js

commit ff49d9b
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:15:49 2025 +0200

    remove loadComparison

commit 41daac9
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:15:08 2025 +0200

    refactor

commit 3ae5757
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 16:01:43 2025 +0200

    fix url

commit a6d5b75
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Tue Apr 22 15:48:56 2025 +0200

    WIP
@Janpot Janpot removed the request for review from DiegoAndai April 23, 2025 14:16
Janpot added 4 commits April 23, 2025 16:19
commit 0fd6675
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 16:11:36 2025 +0200

    Update config.yml

commit 760ceed
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 15:50:18 2025 +0200

    @aws-sdk/credential-providers

commit 2a5fe14
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 15:39:24 2025 +0200

    Update README.md

commit dc04212
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 15:30:25 2025 +0200

    fixes

commit c9f5fb3
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 15:03:31 2025 +0200

    Update pnpm-lock.yaml

commit 6a4d0f5
Author: MUI bot <2109932+Janpot@users.noreply.github.com>
Date:   Wed Apr 23 14:49:32 2025 +0200

    upload functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: code-infra Specific to the core-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants