Skip to content
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

FormToggle, ToggleControl: Fix docgen in Storybook #64065

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Conversation

mirka
Copy link
Member

@mirka mirka commented Jul 29, 2024

What?

Fixes a documentation regression introduced in #60234 where for FormToggle/ToggleControl, the JSDocs stopped working (in IntelliSense) and the Storybook docgen could not extract the JSDocs and TypeScript types.

Why?

For the docgen in Storybook to work, a ref-forwarded component must have a named export. A contributor passing by would not know this, so if these kinds of regressions happen again we should consider adding an eslint rule. (This is the first regression of this kind I've seen, and I don't expect it to happen a lot.)

Testing Instructions

The Storybook docs for both components should show the main JSDocs, as well as the props table with descriptions (broken docs in trunk for comparison: FormToggle/ToggleControl).

The IntelliSense in your IDE should show the JSDocs for both components.

@mirka mirka added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components Storybook Storybook and its stories for components labels Jul 29, 2024
@mirka mirka self-assigned this Jul 29, 2024
@mirka mirka requested a review from ajitbohra as a code owner July 29, 2024 16:33
@mirka mirka requested a review from a team July 29, 2024 16:34
Copy link

github-actions bot commented Jul 29, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks 👍

Definitely looks like something that the dev environment or CI should have caught 😞

@mirka mirka enabled auto-merge (squash) July 29, 2024 16:45
@mirka mirka merged commit f50e045 into trunk Jul 29, 2024
70 of 71 checks passed
@mirka mirka deleted the fix/toggle-storybook branch July 29, 2024 17:08
@github-actions github-actions bot added this to the Gutenberg 19.0 milestone Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components Storybook Storybook and its stories for components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants