Describe the bug
The documentation for Typescript offers TSDocgen as an option for parsing and providing props tables for stories. In my recent experience, and as noted in an recent issue in react-docgen-typescript, each tsx story is individually parsed and visibly pauses the Storybook build. With each TS story that is added, the build gets slower and slower. With only 10 stories, our build time is ~1.5 minutes... HMR is also impaired.
To Reproduce
Steps to reproduce the behavior:
react-docgen-typescript-loader for .tsx? files, as recommended.TSDocgenPlugin, as recommended.
Commenting out both 1 and 2 in our setup results in ~4s builds:

Screenshots

Code snippets
You can view our current Storybook config here on Github. I'm currently working on a PR to reduce our payload sizes with a DLL, so this config will change in the coming days/
System:
Additional context
I've been discussing this in the Discord channel, under support. It was suggested I log this bug.
The documentation needs to be updated to reflect that react-docgen-typescript-webpack-plugin should be replaced with react-docgen-typescript-loader. The Webpack plugin was the initial implementation which was later replaced with a loader.
https://github.com/strothj/react-docgen-typescript-loader/pull/40 was just merged in and published as v3.1.0 which should improve the performance. We were creating a TypeScript program instance for each parsed file. The pull request changes this to reuse the same instance.
Can you report what performance you're getting with only the loader installed and with the new version?
@strothj Absolutely. I'll test it and get back to you...!
@strothj BRAVO! Those two changes-- removing the plugin and updating the package-- dropped build time to ~9s.

@shilman I would recommend updating the documentation for 5.0.5+, depending of course on your own tests.
@clintandrewhall Would you mind submitting a small PR for that?
Credit where it's due. @denieler submitted the pull request which fixed that. :)
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!
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!
Most helpful comment
The documentation needs to be updated to reflect that
react-docgen-typescript-webpack-pluginshould be replaced with react-docgen-typescript-loader. The Webpack plugin was the initial implementation which was later replaced with a loader.https://github.com/strothj/react-docgen-typescript-loader/pull/40 was just merged in and published as
v3.1.0which should improve the performance. We were creating a TypeScript program instance for each parsed file. The pull request changes this to reuse the same instance.Can you report what performance you're getting with only the loader installed and with the new version?