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
refactor: [M3-8184] - Improve local Storybook performance (#10762)
## Description 📝
Performance optimizations for running Storybook locally
The main culprit is using `react-docgen-typescript`; it's parsing every file for docgen info. The package is also [no longer being maintained](styleguidist/react-docgen-typescript#494) (the last release was in [end of 2021](https://github.com/styleguidist/react-docgen-typescript/releases)).
- There's a faster docgen library that Storybook 8 uses, `react-docgen`, however we're missing a lot of typing by using that since it's using a shallower analysis.
- The solution I ended up at was to keep `react-docgen-typescript`, but tighten the scope on what files are parsed for the docgen (Components and Features only). And to also disable `allowSyntheticDefaultImports` and `esModuleInterop` per the [Storybook MUI docs
](https://storybook.js.org/recipes/@mui/material#4-use-material-ui-prop-types-for-better-controls-and-docs)
The time from first paint to Intro loaded on my Intel i7 2019 MBP went from `over 1 minute` to `30s` 🎉
## How to test 🧪
### Reproduction steps
(How to reproduce the issue, if applicable)
- On the develop branch, run Storybook locally and time the time it takes from first paint to Intro loaded
### Verification steps
(How to verify changes)
- Pull down this branch, run Storybook locally and the time from first paint to Intro loaded should be shorter than develop
- The should be no regressions in the typing and loading of stories compared to https://design.linode.com/
0 commit comments