-
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
CheckboxControl: Convert component to TypeScript #40915
Conversation
Size Change: +781 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
I won't likely be able to review this PR myself, but I've tagged a few other folks who have experience with previous refactors and should be able to help 💯 |
Nice one! 🌈 Storybook looks good when I test locally, aside from the example not appearing (#40915 (comment)), and I don't see any obvious regressions in the block editor. Would be nice to add a few simple |
Can do a follow-up PR adding some tests 👍 |
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.
Thanks for tackling this one @walbo 👍
This one is looking pretty good. I have a few minor tweaks and questions I think it would be good to address before merging.
✅ Readme prop descriptions match types
✅ Storybook examples are all functioning well
❓ I don't think we really need additional simple examples, e.g. WithLabel
, if we just have default arg values. The conversion guidelines suggest the default story should be an interactive playground for the component. Wouldn't that suffice?
vii. Use the template for the Default story, which will serve as an interactive doc playground.
❓ A ref
prop is appearing in the controls and looks to come from WordPressComponentProps
.
Not sure if this one makes sense here and we need something like WordPressComponentPropsWithoutRef
.
The ref prop is removed from the story and everything appears to function for me if I omit ref
from the CheckboxControl
props type. Perhaps @mirka could point to the proper approach here?
❓ The deprecated heading
prop has a controls table entry. We should probably remove/disable this to discourage its use further.
Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com>
Yes, I agree. Updated the default story to have the same default args as in the example. |
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.
Thanks for the speedy turnaround on this @walbo 🚀
✅ Storybook examples are all functioning well
✅ Simplified examples look good
✅ Readme prop descriptions match types
✅ Deprecated prop no longer advertised in controls or docs
✅ All other review suggestions resolved
Nice work! LGTM 🚢
Thanks for the review and feedback @noisysocks and @aaronrobertshaw. Much appreciated 😃 |
Thank you all for collaborating on this one!
@walbo , feel to ping when the follow-up PR is ready 🙏 |
What?
Converts the
CheckboxControl
component to TypeScript.Why?
Part of the @wordpress/components's TypeScript migration (#35744).
How?
Refactors the current
CheckboxControl
to TypeScript.Testing Instructions
CheckboxControl
continues to function as expected