ETT-260: upgrade to storybook 9 #132
Open
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.
This was a pretty significant upgrade for storybook, and we got some great new features out of it (visual testing locally and accessibility testing).
Some deprecated add-ons were removed, storybook-test was swapped for addon-vitest (hooray!), and there's a new chromatic add-on for visual testing locally in the browser.
I ran into some issues with storybook rendering our styles during the production build. Everything looked fine in the local storybook (i.e.
npm run storybookwhich loads atlocalhost:6006), but when the build ran for chromatic, none of the styles were loading (example storybook build on chromatic). We've had issues with bootstrap styles not loading in storybook in the past, but absolutely none of the styles loading was wild. I read many, many pages of documentation and github issues/stack overflows, and in the end it made the most sense to just inject a<link rel="stylesheet">with our full stylesheet directly into the iframe of storybook. I created a vite custom plugin (in.storybook/main.js) to do exactly that.Currently, all our stories need a new baseline because of the change in default screen sizes. I'm going to see if I can't clean that up and get the stories to match our current baseline, because that's really annoying.
There shouldn't be any change in our stories outside of swapping old syntax for new.