-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Composite: fix Storybook docgen #64682
Conversation
a9130e7
to
81aa986
Compare
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Ooh, really nice!
c1ee5da
to
72b49dc
Compare
Flaky tests detected in 72b49dc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10505201717
|
* Move subcomponents to separate files, add default export * Remove custom Storybook args info * Remove subcomponents folder * Do not export `useCompositeStore` in the index.tsx file * CHANGELOG * Update contributing guidelines * Remove unnecessary displayName override on top level composite * Remove default exports * Move CHANGELOG entry under right section * Remove JSDoc prop types * CHANGELOG update * typo --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org>
What?
Refactor how
Composite
components are declared and exported to allow Storybook to generate better docsWhy?
Having Storybook automatically generate docs saves us time and ensures us that our docs are always aligned with the component's implementation.
How?
Inspired by @mirka 's #64654 (comment), the bulk of the change is:
On top of that, I've updated the contributing guidelines accordingly, assuming that this should be the recommended way of declaring / exporting sub-components.
Testing Instructions
Composite (V2)
Storybook docs and examples, make sure that props (and their controls) work as expected, and that the examples also work;