-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Upgrade Storybook to v7, move builder to Vite #37331
base: master
Are you sure you want to change the base?
Conversation
The first access list story fails for me:
Additionally, not sure if this matters, but I do see this warning:
I see some other failures not related to window.msw:
And another on authndialog-loaded:
|
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.
(My mistake for not checking out the corresponding e branch)
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.
It looks like instead of renaming .js
stories to .jsx
, only .jsx
were added.
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.
As I mentioned in #34450, msw-storybook-addon has some problems with resetting the handlers between stories when using res.once
.
For example, if you open the Access List story and then open "Empty with Igs", which uses res.once
, other Access List stories will return 404 from cfg.getAccessManagementListUrl()
. The workaround is to refresh the page between each story.
Now, the Access List story doesn't need to use res.once
at all, it can just use res
instead and the issue is gone. I already fixed it in the teleport.e branch. Other than that, we only have four stories which use res.once
, so perhaps for now we can live with this problem. The issue in msw-storybook-addon repo doesn't mention any solutions to this. mswjs/msw-storybook-addon#82
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.
The stories for DocumentCluster
in teleterm fail with "ambiguous import: FileTransferDirection" and I didn't have time to investigate this. Maybe it's a matter of updating this branch with master?
@ryanclark it looks like you're using chrome right? how did you get localhost to work for you? |
This upgrades Storybook to v7 and moves it over to use Vite as a builder instead of Webpack.
I had to remove some usage of
window.msw
and move it over to using the storybook msw addon, but other than that it was quite painless.Timings
Builds
Webpack - 21s
Vite - 2.7
To the browser opened & something rendered on screen
Webpack - 23.4s
Vite - 9.1s
It actually fixed some stories too
Before:
Now:
Note: I had to remove the (unnecessary) XML header from some SVGs as Vite wasn't liking them