Skip to content

Conversation

anmazz
Copy link
Contributor

@anmazz anmazz commented Mar 20, 2025

Summary

Updates Storybook to version 8.6.7 (latest non-beta version as of Mar. 20, 2025).

Breaking change

⚠️ This is potentially a breaking change.

Related issue

Closes #5239

Problem statement

Storybook was using an old version and can be updated to support the latest, version 8.

Solution

I followed the automatic migration as well as the migration guide here: https://storybook.js.org/docs/9/migration-guide
I tried maintaining as much existing code as possible. I believe, for instance, that the "../packages/**/*.stories.mdx", could be removed from main.js, but kept it in for now pending comment.

Major changes

  • Storybook upgraded to version 8.6.7
  • Scripts updated to reflect new storybook script syntax
  • Adds explicit framework @storybook/html-webpack5 and dependencies

Testing and review

Run storybook and verify that storybook version has been upgraded and works as usual.

Dependency updates

Dependency name Previous version New version
@chanzuckerberg/axe-storybook-testing 6.3.1 8.2.2
@storybook/addon-a11y 6.5.16 8.6.7
@storybook/addon-essentials 6.5.16 8.6.7
@storybook/addon-links 6.5.16 8.6.7
@storybook/html 6.5.16 8.6.7
@storybook/html-webpack5 -- 8.6.7
@storybook/addon-webpack5-compiler-babel -- 3.0.5
@storybook/builder-webpack5 3.0.5 --
@storybook/manager-webpack5 6.5.16 --

@mejiaj
Copy link
Contributor

mejiaj commented Aug 21, 2025

@anmazz this would be cool to see merged, thanks for working on this!

I was poking around and noticed there's this weird quirk on refresh where component styles (like Banner) disappear on refresh.

CleanShot.2025-08-20.at.20.50.23.mp4

@anmazz
Copy link
Contributor Author

anmazz commented Aug 21, 2025

@mejiaj set it to explicitly load the scss in preview.js, so should work! I saw the same issue you described and this fixed it for me.

@mejiaj
Copy link
Contributor

mejiaj commented Aug 22, 2025

Nice, it's working for me now too. Thanks @anmazz!

This will be a nice update because storybook is currently on version 6.

@mejiaj
Copy link
Contributor

mejiaj commented Sep 3, 2025

@annepetersen or @heymatthenry this is ready for review.

It's a big jump from 6 → 8, but could help with performance and security.

https://storybook.js.org/docs/8/migration-guide/from-older-version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USWDS: Update storybook to 7.0.x
2 participants