-
Notifications
You must be signed in to change notification settings - Fork 3
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
Consider switching from Webpack to Vite #1403
Comments
I've heard good things about Vite! I also don't love the idea of refactoring the config, but I do love the idea of getting experience with Vite! |
I think it would make a lot of sense to switch, here's some reasons:
I'm taking a look to try to size this issue |
Here are things I noticed while testing out the swap:
Conclusion: The lack of caching problem seems like a deal-breaker. I did not look into why it is happening or whether it could be solved. It could be a problem that we have to wait for storybook-builder-vite to solve, or maybe it is a problem that we can fix. Once (if) we can solve that problem, I think the rest of the problems I mentioned seem very solvable. Giving it a 10. If the lack of caching problem is something that storybook-builder-vite fixes, I think this is a 5. I pushed my experiments to the |
I got stuck on something here... There are a couple stories that don't render correctly. I spent most of yesterday trying to debug it and I couldn't figure it out. I'm gonna take a break from this for a while and hopefully when I come back to it with fresh eyes I'll be able to fix it. |
I realized that most of the issues I was having was due to upgrading twing. Newer versions of twing are asynchronous, while the older version we were using was synchronous. I think it is likely that if I switch back to the old version it will fix the issue I was seeing with a couple stories. Storybook will eventually have first-class support for async stories: storybookjs/storybook#12726, so when that comes around it will probably be easier to use an async version of twing. |
It looks like Storybook 7 has added a lot of Vite improvements: https://storybook.js.org/blog/first-class-vite-support-in-storybook/ That issue still looks to be open, though, which is disappointing. Also a little confusing, since it's included in 6.x milestones. |
Storybook 6.3 introduces support for bundlers other than Webpack: https://storybook.js.org/blog/storybook-for-vite/
@calebeby pointed out while reviewing a PR by @gerardo-rodriguez that using Vite might simplify the process we've been using for exposing template source code to stories: https://github.com/cloudfour/cloudfour.com-patterns/pull/1402/files#r670882613
Unfortunately we haven't upgraded to 6.3 yet because of unresolved regressions related, perhaps ironically, to Webpack. See: #1349
While I don't love the idea of refactoring the project's configuration (which is currently pretty Webpack-centric), if the 6.3 upgrade will require some reconfiguration anyway, we might as well consider switching to a bundler we like better and that might gain us some efficiencies.
The text was updated successfully, but these errors were encountered: