Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
What I did
This implements option D from https://www.notion.so/chromatic-ui/Vite4-support-c986d1e531e34ec7b70b72f4698c0328.
I did this by returning our vite version range to only encompass version 3, so Storybook will continue to use vite 3 for now, but users can upgrade their apps to vite 4 without issue. This should work so long as the newer framework plugins that those users put into their
vite.config.js
files don't cause problems in vite 3. I tested react locally, and storybook's vite 3 worked fine with the newer@vitejs/plugin-react
intended for use with vite 4. I'm not positive all plugins will work that way, but hopefully CI will suss that out, since the repros are using the newer vite + plugins.I've also forced the older version of the react plugin to be used for mdx processing, removed the react plugin from non-react frameworks, and re-enabled the story disabled in #20210.
How to test
I'm hopeful CI will be instructive here. You could also create a sandbox and try out different versions of packages, but you may need to use
--no-link
because of version mismatches with the repros.