-
Notifications
You must be signed in to change notification settings - Fork 218
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
chore(storybook): minimal upgrade migration #5309
base: main
Are you sure you want to change the base?
Conversation
|
Branch previewReview the following VRT differencesWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
b361a04
to
6004f3f
Compare
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", |
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.
Question - do we need the react dependency for anything other than Storybook? If not, I can remove it from here because Storybook no longer requires React as a peer dep
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.
Let me confirm but i believe its used for the react wrappers but ill follow up
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.
so looks like react
and react-dom
are used by another storybook that exists in projects/custom-css-vars-viewer
. I don't know if that's even used anymore or if we can remove that project too? Otherwise it appears safe to remove
Also I think we can remove next
as a package too.
icon: html` | ||
<sp-icon-edit hidden slot="icon"></sp-icon-edit> | ||
`, | ||
icon: `<sp-icon-edit hidden slot="icon"></sp-icon-edit>`, |
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.
This version is much stricter about safe template rendering. It's considered unsafe to call a template result via function inside another template result. This is the way to accomplish that same result.
const cem = await import('./custom-elements.json', { | ||
assert: { type: 'json' }, | ||
}); | ||
// const cem = await import('./custom-elements.json', { |
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.
I left this commented out so that we can bring it back in the future. It doesn't take away anything from our developer experience right now to remove it but it was a higher level of effort to load it compatibly with this version.
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.
This actually helps build our args tables dynamically from the source. By removing this all args tables will default to only the few args defined in an args file. not all components use this pattern though. is there a way we can do a follow up ticket to ensure our args tables are accurate with the available API?
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.
That was what it was supposed to do but none of the args tables were being set by this. When I removed it, it caused no changes to the interface so I suspect it wasn't working the way it was supposed to in the first place.
This is also a WIP branch - not ready for review yet.
@@ -148,4 +165,72 @@ export const parameters = { | |||
}, | |||
}; | |||
|
|||
export const decorators = [swcThemeDecorator]; | |||
export const decorators = [ |
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.
how is this different from the projects/story-decorator? can we have one or the other or do we need both?
}, | ||
]; | ||
|
||
export const tags = ['autodocs']; |
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.
can NOT wait for this to go live <3
@@ -277,32 +278,3 @@ export const configuredVisualRegressionPlugin = () => | |||
); | |||
}, | |||
}); | |||
|
|||
export function watchSWC() { |
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.
Do you know what this was doing or why its safe to remove this now?
"@storybook/addon-designs": "^8.0.0", | ||
"@storybook/addon-essentials": "^7.5.0", | ||
"@storybook/addon-links": "^7.5.0", | ||
"@storybook/web-components": "^7.5.0", |
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.
looks like this package was removed but this is how we set our custom manifest (the part you commented out in preview.js). Was this intentional or is it not supported in storybook 8?
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.
Does look like it comes with v8 support: https://www.npmjs.com/package/@storybook/web-components
d596606
to
b4fd473
Compare
b4fd473
to
eec53fe
Compare
Description
This update migrations the SWC Storybook instance off of the
@web/storybook-builder
and@web/storybook-framework-web-components
and onto the latest breaking change (v8) release of@storybook/*
andstorybook
packages.This update does not:
Had to remove the
maintained node versions
entry to the browsers list config because it was causing the Storybook build to fail:Related issue(s)
Motivation and context
Blog post
How has this been tested?
yarn start
: expect no regressions to local StorybookScreenshots
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.