-
-
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
Vite: cleanup custom plugins #19087
Vite: cleanup custom plugins #19087
Conversation
The issue was fixed in vite prior to 3.0, which is the lowest version we support now.
This will make them easier to understand in debug logs, for instance.
We need this to support the new object hooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
Is it possible that this is legitimately broken by vite? https://www.chromatic.com/build?appId=5a375b97f4b14f0020b0cda3&number=27316 The library story itself seems fine: https://www.chromatic.com/component?appId=5a375b97f4b14f0020b0cda3&csfId=addons-interactions-examples-accountform--standard-fail-hover&buildNumber=27316&k=6311e20b836c095043ed053c-1200-interactive-true&h=9&b=-6 |
No this looks like a regression from some recent interactions work. I believe @ghengeveld is aware. |
Issue: Our custom Vite plugins were a bit disorganized, and some are no longer needed.
What I did
I removed the
no-fouc
plugin, which was only needed in versions of Vite < 3, but we only support Vite 3+ now. I also removed the unusedreact-docgen
plugin from the builder (it's in the react framework now instead).This also moves all plugins in the builder to
/plugins
, and renames all plugins with a common naming convention ofstorybook:name-of-plugin
, to aid in identification in error logs. And a major version release seemed like a good time to make that change.Lastly, this incorporates the same change as storybookjs/builder-vite#490, to avoid problems when building typescript with the latest versions of Vite.
How to test
Fire up a vite sandbox, confirm it still works, and that you don't see a flash of unstyled content when the page is first loading up.