-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
CLI: Prebundle more in cli-storybook package #31746
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
Conversation
|
View your CI Pipeline Execution ↗ for commit ff3abbc.
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 324 | 216 | 🎉 -108 🎉 |
| Self size | 235 KB | 582 KB | 🚨 +347 KB 🚨 |
| Dependency size | 99.89 MB | 94.66 MB | 🎉 -5.22 MB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 267 | 185 | 🎉 -82 🎉 |
| Self size | 31 KB | 31 KB | 🎉 -361 B 🎉 |
| Dependency size | 82.77 MB | 78.74 MB | 🎉 -4.03 MB 🎉 |
| Bundle Size Analyzer | Link | Link |
- Downgraded giget from version 2.0.0 to 1.0.0 in package.json and yarn.lock. - Added new dependencies including [email protected], [email protected], and others in yarn.lock. - Updated various package versions for consistency and compatibility.
…rybookjs/storybook into norbert/prebundle-esm-in-cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prebundles additional code in the cli package and migrates Babel-related imports from the external '@babel/*' packages to the internal Storybook packages. The changes include migrating type and function imports in several codemod and automigrate modules and cleaning up dependency entries in package.json files.
- Migrate Babel type and function imports in code/lib/codemod and cli-storybook packages.
- Remove external Babel dependencies and update dependency versions in package.json files.
- Refactor iteration over story entries in the codemod transform.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| code/lib/codemod/src/transforms/find-implicit-spies.ts | Updated Babel imports and iterates over story entries using Object.values |
| code/lib/codemod/package.json | Removed external Babel dependencies |
| code/lib/cli-storybook/src/automigrate/helpers/addon-a11y-parameters.ts | Updated Babel import to internal package |
| code/lib/cli-storybook/src/automigrate/fixes/initial-globals.ts | Updated type usage for Babel Expression |
| code/lib/cli-storybook/package.json | Updated dependency versions and reorganized dependencies |
Comments suppressed due to low confidence (1)
code/lib/codemod/src/transforms/find-implicit-spies.ts:108
- [nitpick] Changing from Object.entries to Object.values is valid if the key is not needed; please confirm that discarding the key does not affect behavior in other parts of the code.
Object.values(csf.stories).forEach(({ name }) => {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
5 files reviewed, no comments
Edit PR Review Bot Settings | Greptile
CLI: Prebundle more in cli-storybook package (cherry picked from commit ad8a398)
What I did
Prebundle more code in the cli package
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>Greptile Summary
Optimizes the CLI package by prebundling more dependencies and reorganizing imports, primarily focusing on Babel-related code and utilities.
code/lib/cli-storybook/package.jsonto reduce production bundle sizestorybook/internal/babelinstead of direct@babel/*dependencies in multiple files@babel/typesdependency and related packages from both CLI and codemod packagescode/lib/codemod/src/transforms/find-implicit-spies.tsby using namespaced Babel type checks