-
Notifications
You must be signed in to change notification settings - Fork 351
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 v8.x #1904
base: main
Are you sure you want to change the base?
Upgrade Storybook v8.x #1904
Conversation
Adjust Storybook files accordingly.
Size Change: 0 B Total Size: 1.29 MB ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (35a5605) and published it to npm. You Example: yarn add @khanacademy/perseus@PR1904 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR1904 |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
"style-loader": "^3.3.3", | ||
"tiny-invariant": "^1.3.1", | ||
"typescript": "^5.4.2", | ||
"typescript-coverage-report": "^0.7.0", | ||
"vite-plugin-istanbul": "^5.0.0", | ||
"vite-plugin-turbosnap": "^1.0.3", |
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.
turbosnap is now built into the "@storybook/react-vite" bundle and can be enabled with the standard --stats-json argument
|
||
typescript: { | ||
reactDocgen: "react-docgen", | ||
}, |
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.
Storybook now defaults to react-docgen so no need to specify this here: https://storybook.js.org/docs/api/main-config/main-config-typescript#reactdocgen
tags: [ | ||
//👇 Enables auto-generated documentation for all stories | ||
"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.
New config location (https://storybook.js.org/docs/writing-docs/autodocs)
@@ -34,6 +34,7 @@ | |||
"@phosphor-icons/core": "^2.0.2" | |||
}, | |||
"devDependencies": { | |||
"vite": "^5.1.0" | |||
"vite": "^5.1.0", | |||
"@vitejs/plugin-react": "^4.3.3" |
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.
We now need to specify this dep explicitly.
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.
Nice. Thanks for pushing this along!
apiOptions: {table: {disable: true}}, | ||
backgroundImage: {table: {disable: true}}, | ||
correct: {table: {disable: true}}, | ||
graph: {table: {disable: true}}, | ||
onChange: {table: {disable: true}}, | ||
valid: {table: {disable: true}}, |
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.
@nishasy had thoughts that we shouldn't hide props from the table even if they didn't make sense to edit so that folks could have a view of all the props a component supported.
I'm open to deleting all these {table: { disable: true}}
if folks would like these props shown in Storybook.
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 approve this message! I like seeing the props that should be available just for documentation purposes, even if they're not editable in the table itself. That's also how it's done in Wonder Blocks.
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.
@jeremywiebe / @nishasy - to confirm, I should remove any setting where table: {disable: true}}
is specified?
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.
Confirmed. Let's remove them. :)
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.
Unhided.
Summary:
Nothing is broken. Everything is happy.
Test plan:
yarn start
is happyyarn build-storybook; python3 -m http.server -d storybook-static;
-> openhttp://localhost:8000
in a browseryarn build-storybook --stats-json
works and generates/storybook-static/preview-stats.json
yarn dev
is happyyarn cypress:ci
is happy