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

Set up tooling to warn/highlight on regressions in package size and dependency graph #29322

Open
Tracked by #29038
JReinhold opened this issue Oct 10, 2024 · 0 comments · May be fixed by #29356
Open
Tracked by #29038

Set up tooling to warn/highlight on regressions in package size and dependency graph #29322

JReinhold opened this issue Oct 10, 2024 · 0 comments · May be fixed by #29356
Assignees

Comments

@JReinhold
Copy link
Contributor

JReinhold commented Oct 10, 2024

We need to ensure that new PRs and upcoming work increases our bundle size and dependency graph significantly, now that we've invested so much effort into optimizing and reducing our footprint.

For each PR we want to highlight the following changes, in comparison with the head commit on next:

  1. Any changes to individual package's dependencies (including transitive), the total dependency install size (if possible) and the total number of dependencies.
  2. Any changes to individual package's devDependencies, that could cause the package's own bundle size to increase, because devDependencies are by default bundled in.
  3. Include links to the visual metafile analysis story in our UI Storybook, so that bundle size changes can more easily be inspected.

To reduce the noise, we'll only report these when we detect changes in package's package.json and/or the global lock-file. The global lock-file can impact the prebundled dependencies, so when we detect changes there, we have to compare and highlight all packages.

The report will be sent as a comment by our GitHub bot

Example comment

The following package's has changes to their dependencies:

@storybook/react

Before After Difference
Bundled size 273 kB 300 kB +28 kB
Dependency count 8 12 +4
Dependency size 3.5 MB 3.8 MB 🚨 +300 kB 🚨
Bundle Size Analyzer "Link to story on next" "Link to story on this branch"

@storybook/svelte

Before After Difference
Bundled size 273 kB 200 kB 🎉 -73 kB 🎉
Dependency count 8 12 +4
Dependency size 3.5 MB 1.5 MB 🎉 -2 MB 🎉
Bundle Size Analyzer "Link to story on next" "Link to story on this branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant