Cleanup: Removal of lodash#32351
Merged
Merged
Conversation
lodash
- Removed specific versions of `@types/lodash` and `lodash` from package.json and yarn.lock to streamline dependency management. - Updated ESLint configuration to include `lodash-es` in the ban-dependencies rule for improved linting accuracy.
|
View your CI Pipeline Execution ↗ for commit 694f7fd
☁️ Nx Cloud last updated this comment at |
f69fd8e to
ff9a845
Compare
JReinhold
approved these changes
Aug 29, 2025
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 48 | 48 | 0 |
| Self size | 30.62 MB | 30.74 MB | 🚨 +117 KB 🚨 |
| Dependency size | 17.61 MB | 17.61 MB | 0 B |
| Bundle Size Analyzer | Link | Link |
@storybook/cli
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 219 | 219 | 0 |
| Self size | 879 KB | 879 KB | 🚨 +90 B 🚨 |
| Dependency size | 81.81 MB | 81.93 MB | 🚨 +117 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/codemod
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 188 | 188 | 0 |
| Self size | 35 KB | 35 KB | 🚨 +42 B 🚨 |
| Dependency size | 76.88 MB | 77.00 MB | 🚨 +117 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
create-storybook
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 49 | 49 | 0 |
| Self size | 1.52 MB | 1.52 MB | 🎉 -60 B 🎉 |
| Dependency size | 48.23 MB | 48.35 MB | 🚨 +117 KB 🚨 |
| Bundle Size Analyzer | node | node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #32347
What I did
Updated dependencies and ESLint configuration to streamline dependency management and improve linting accuracy:
@types/lodashandlodashfrom package.json and yarn.lock to reduce dependency complexitylodash-esin the ban-dependencies rule for improved linting accuracyeslint-disable depend/ban-dependenciescomment to only wrap the specific lodash-es imports in the preview file, making the linting more preciseThese changes help maintain cleaner dependency management while ensuring proper ESLint enforcement across the codebase.
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
Updated On: 2025-09-02 08:53:52 UTC
This PR completes the lodash dependency removal from Storybook's codebase by cleaning up remaining references and improving ESLint enforcement. The changes include:
Dependency Removal: Removes
lodashand@types/lodashfromcode/core/package.json, completing the migration to es-toolkit alternatives that was started in the related PR Core: Fix babel-related size regression #32347Enhanced ESLint Configuration: Updates
scripts/.eslintrc.cjsto ban bothlodashandlodash-esmodules, ensuring comprehensive prevention of future lodash usage across the codebasePrecise Linting Control: Refines the ESLint disable directive in
code/.storybook/preview.tsxto only wrap the specific lodash-es mock imports (lines 41-44) rather than disabling the rule for the entire fileThis work fits into Storybook's broader modernization effort, where lodash functionality has been replaced with es-toolkit utilities like
pick,isEqual, andtoMerged. The es-toolkit library provides similar functionality with better tree-shaking capabilities and smaller bundle sizes. These changes ensure that the lodash removal is complete while maintaining necessary test mocking functionality and preventing future accidental lodash imports through improved linting rules.Confidence score: 5/5