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

BoxControl: Auto-generate readme #67284

Merged
merged 1 commit into from
Nov 26, 2024
Merged

BoxControl: Auto-generate readme #67284

merged 1 commit into from
Nov 26, 2024

Conversation

mirka
Copy link
Member

@mirka mirka commented Nov 25, 2024

What?

Switch the README for BoxControl to an auto-generated one (see also #66035).

Why?

To improve accuracy and maintenance cost.

Testing Instructions

npm run docs:components to verify the changes to the README.

@mirka mirka added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Nov 25, 2024
@mirka mirka requested a review from a team November 25, 2024 21:58
@mirka mirka self-assigned this Nov 25, 2024
@mirka mirka requested a review from ajitbohra as a code owner November 25, 2024 21:58
Copy link

github-actions bot commented Nov 25, 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.

* return (
* <BoxControl
* values={ values }
* onChange={ ( nextValues ) => setValues( nextValues ) }
Copy link
Member Author

Choose a reason for hiding this comment

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

Pet peeve 🙈

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.

Looking great, thanks @mirka! 👍

I think it's mostly a question of a couple of props that I'm not sure we want to omit from the docs. Let me know what you think.


### `onMouseOut`: `function`
Copy link
Member

Choose a reason for hiding this comment

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

What's the thing about those props like onMouseOut and onMouseOver that we previously documented in the README but we no longer do? Does that signal a gap in types perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

The types are correct, it's just the default behavior of react-docgen-typescript to suppress element props that are optional and don't have explicit descriptions. I think that makes sense, especially because onMouseOut and onMouseOver are highly unlikely to be used in common BoxControl use cases, and their inclusion is simply arbitrary (probably only happened because some weird edge case in Gutenberg required it).

What annoys me though is that there's quirk in the API where onMouseOut and onMouseOver should actually just be passed as part of the inputProps prop. That's basically what happens under the hood anyway. I'll address this in a separate PR — it should just be a change in TypeScript metadata.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good, thanks for clarifying 👍

@mirka mirka requested a review from tyxla November 26, 2024 14:23
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.

Looks good, let's 🚢!

@mirka mirka enabled auto-merge (squash) November 26, 2024 16:28
@mirka mirka merged commit 9b90853 into trunk Nov 26, 2024
73 of 78 checks passed
@mirka mirka deleted the autogen-boxcontrol branch November 26, 2024 20:28
@github-actions github-actions bot added this to the Gutenberg 19.8 milestone Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants