-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[5.0.0] Web building slow #5935
Comments
Any chance you can provide a repro repo? |
Unfortunately it's private repo. I'll see if I can create custom repo that reproduces the issue |
I created a new create-react-app and added storybook as dependency. With quick test I saw some 20-30ms longer built times with 5.0.0. Not sure if the difference grows bigger when project gets bigger. |
I finally had time to dig bit deeper on this. Seems that it's all about our create-react-app and typescript that causes the slow compilation times. Only thing I wonder is that why it increased dramatically between v4 and v5 of storybook. Code and build configuration was same on both versions |
It seemed to got worse upgrading from 4->5, since build time was increase about 5 second in our system and only change we had was upgrading storybook. Our project is medium to large sized. To fix typescript slowness I upgraded create-react-app to 2.1.8 (facebook/create-react-app#5820) which enabled async type checking by default and also set in our tsconfig |
I´m also seeing slower build times but Im not using Typescript. The version Im comparing to running Storybook 4 only changing these dependencies $ yarn build-storybook (version 4) $ yarn build-storybook (verison 5) It looks like there are improvements from first time to the second and third time running the script after eachother. But also it looks to me that the build times have increased. |
Same here we went from 40sek to over 2 minutes for the initial build and 2-15sek for the rebuild. Thinking about switching back to 4.x. I'm using babel with typescript. |
@steffenmllr @jniemin Anybody who's using typescript, please take a look at this issue for a possible fix: #6430 TLDR; you should be using |
thanks for the hint but I'm not using |
Ugh, sorry to hear that. @ndelangen any performance hints for @steffenmllr ? |
For anybody who is interested in performance and doing any webpack customization, it's important to understand the webpack configuration. I added a If it's getting slower without any webpack customization, please let us know! |
@shilman Like I wrote in my previous comment, this helped for our project to get back to decent build times.
|
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
@nonameolsson are you using typescript? did you use the workaround here? |
@KamalAman Is there any way to add this early return without modifying storybook itself? The build times are crippling use of storybook in our project. |
@KamalAman Thanks for the detailed report. We've recently started shipping presets to make it easy to configure storybook for common use cases (e.g. add typescript or scss). I think docgen could be good candidate for that for 6.0 (this will be a breaking change). I'm also thinking maybe the current default is not configured properly if it's also running on node_modules and all JS files... cc @igor-dv |
Hi all, I recently upgraded from 5 to 6.0.13 and Storybook is unusably slow. I'm using Safari. A large number of stories are using the Here are some of the problems I'm noticing:
Is there something I can do to debug what's going on? Thanks. |
@jayair have you tried turning off all addons & selectively re-enabling? also try turning off all but one story & selectively re-enabling? |
@shilman Thanks for the reply. The addons trick helped. Using this config dropped the initial load time from 22s to 5s. module.exports = {
"stories": [
"../src/stories/**/*.stories.js"
],
"addons": [
// "@storybook/addon-links",
// "@storybook/addon-essentials",
"@storybook/preset-create-react-app"
]
} Debugging a bit further showed that I haven't completely tried enabling/disabling single stories. I have a few Would it help in performance if I split that up into 99 separate CSF files? Or does that not matter? |
@jayair it's probably |
@shilman I'm in 6.0.16 having a huge slowdown as well. You, in another issue (I can't seem to find it) suggested to turn off reactDocgen entirey and it worked, everything started building in a blink of an eye... but now I don't have controls anymore. If I let reactDoggen turned on, it normally hangs at What you suggested:
So, or I'll work with the slowdown + controls or fast without controls? (If you want to, I can open a new issue because of the version difference) |
There's another setting: You can also add controls by hand: https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#my-controls-arent-being-auto-generated-what-should-i-do |
@shilman I'm sticking to "fast without controls" for now, doing them by hand as instructed. It's working, but it's not, like, 10/10. Thanks for the help anyway :) |
Confirmed, this works:
|
@shilman FYI: Storybook 6 got so slow we tend to use it less frequently. Storybook 6.1.0-alpha.17 started │ ^^^ This is with:
Ok. Huge project + debugging mode, but still. |
Where am I supposed to put the |
/.storybook/main.js |
@Obiwarn we're actively working on perf now. we've got a round of improvements in 6.1 and will continue throughout the 6.x cycle. this is our top priority now. |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I want know if there any config that can ignore some npm package when run React Docgen Typescript Plugin. This wasn't a serious problem at first, until I import |
You can try playing around with the include paths of 'react-docgen-plugin', but I haven't seen any huge speedups from that. |
I'm using |
In addition to the change of configuring We had started with: .storybook/main.js
and we found that updating to a more specific glob pattern shaved off ~75% of what was previously a ~20 second build time: .storybook/main.js
(I still want to dig a little more into exactly why we get so wildly different a result between these two match patterns--we ruled out it just being a matter of the original path including more files to search through--but posting here in case helpful to anyone else seeing slow performance). |
@bregenspan the first glob includes |
@bregenspan This was a massive boost for us, thanks so much for sharing |
I have a similar issue with storybook v6 on
You can reproduce it on reactjs/react-transition-group#741. |
I'm upgrading an enterprise project from Webpack 4 to Webpack 5. I'm seeing significantly slower rebuilds in Storybook on Webpack 5 (~800ms to 5500ms).
There are numerous issues at play and I'm not sure if any are related to Storybook. For the css, I believe the culprit to be I'm still trying to figure out why the rebuild is 2x slower with |
@levymetal which version of storybook are you using? i think there's a this is the first i'm hearing about the |
@shilman I'm on I was wrong about |
I've finally been able to make a repro of the issue we're experiencing. It seems to have something to do with sass imports. When using I've updated the repro here: https://github.com/levymetal/webpack5-css-loader-repro The readme contains detailed instructions, but here's the TLDR:
If you repeat these steps using webpack 4 (switch to the |
Hey @levymetal, Do you still encounter the same issue with the newest version of Storybook? I have updated the
Please reopen this issue, if you think it is still relevant |
Hey @valentinpalkovic, thanks for following up! We ended up solving this a while ago by replacing I just tested the repro and this change alone fixes the issue without needing to update anything else. I also tried updating all deps including Either way, issue is 100% resolved for us and our rebuilds are super fast. Appreciate the work! |
Describe the bug
I have an app build with create-react-app. Upgrading @storybook/react from 4.1.13 to 5.0.0 increased webpack build time from 500ms to 5000ms. Initial startup was increased from 8s to 11s, but the bigger issues is that while doing small change to code completion time went 10 fold.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No increase built time
System:
The text was updated successfully, but these errors were encountered: