joshwooding / vite-plugin-react-docgen-typescript

MIT License
8 stars 7 forks source link

Performance issues with storybook 8/vite 5? #37

Closed viveleroi closed 1 week ago

viveleroi commented 3 weeks ago

We upgraded from storybook 7 to 8 a few months and ago and the live reload time when storybook is open absolutely tanked. With v7 it was almost immediate, < 1 second. With v8, it's taking upwards of 20 seconds. Live reload in our actual app works fine, so it's not a vite or typescript problem as far as we can tell.

All we know so far is that the issue happens when we use reactDocgen: 'react-docgen-typescript' but reactDocgen: 'react-docgen' works fine (outside of missing all types/props). So it's only an issue with storybook, and either this vite plugin or react-docgen-typescript itself.

I'm not clear on whether this plugin was used prior to v8 but judging by our yarn.lock file, it was.

I've asked on the storybook discussions for more help in diagnosing what the core issue would be, but got no reply.

Storybook 8.2.9 Vite 5.3.1 Typescript 5.4.5

What would you suggest we try to better narrow the cause of the delays?

viveleroi commented 2 weeks ago

Ok on further investigation this is an issue in 0.3.1 of this dependency, but not 0.3.0. Forcing 0.3.0 in our project on storybook 8.3.2 resolves the speed problems.

https://github.com/storybookjs/storybook/issues/28269

joshwooding commented 1 week ago

This should have been fixed by #38. Could you test it and see if it helps?

viveleroi commented 4 days ago

Testing v4.1 does solve the hmr performance issue, but cold start times for storybook 8.3.4 are worse. After two tests I would estimate about 2-3x slower.