You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried searching for discussions on this but couldn’t find any. Please redirect me if there is a active discussion on this topic.
When installing storybook I noticed it pulls in a lot of dependencies.
For example, running npx storybook@latest init in an empty project (Node v21.6.0, MacOS, React/Vite) results in a package-lock.json with nearly 9,000 lines and a node_modules folder of 231MB.
In a large React project I'm working on, adding Storybook increased node_modules by 110MB and the package-lock diff by ~6,000 lines.
Using a package visualization tool (like this one) it shows that storybook pulls in around 440 packages.
My question is: are there plans to improve this? I understand that most of this size is backend/CLI functionality that doesn’t reach the browser, but I really think this is something we can do better in the JS community.
Would you accept PRs aimed at reducing the package footprint? Here are a few ideas:
I noticed that util was a dependency, but from first sight only the promisify function is being used. promisify is something that can be imported from node:util when used on the backend or replaced with a more "modern" (lightweight) equivalent
A big chunk of the dependencies are a result of jscodeshift. How about moving the migration codemod to a separate package so that it is run on a per-need basis (i.e. npx @storybook/migrate)
...Probably a lot of other things, but wanted to get a sentiment from the community/maintainers before investigating further
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi everyone!
I tried searching for discussions on this but couldn’t find any. Please redirect me if there is a active discussion on this topic.
When installing storybook I noticed it pulls in a lot of dependencies.
For example, running
npx storybook@latest init
in an empty project (Node v21.6.0, MacOS, React/Vite) results in a package-lock.json with nearly 9,000 lines and a node_modules folder of 231MB.In a large React project I'm working on, adding Storybook increased node_modules by 110MB and the package-lock diff by ~6,000 lines.
Using a package visualization tool (like this one) it shows that storybook pulls in around 440 packages.
My question is: are there plans to improve this? I understand that most of this size is backend/CLI functionality that doesn’t reach the browser, but I really think this is something we can do better in the JS community.
Would you accept PRs aimed at reducing the package footprint? Here are a few ideas:
util
was a dependency, but from first sight only thepromisify
function is being used.promisify
is something that can be imported fromnode:util
when used on the backend or replaced with a more "modern" (lightweight) equivalentjscodeshift
. How about moving the migration codemod to a separate package so that it is run on a per-need basis (i.e.npx @storybook/migrate
)Beta Was this translation helpful? Give feedback.
All reactions