Repository navigation
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 👍 |
aaronrobertshaw
left a comment
There was a problem hiding this comment.
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. |
aaronrobertshaw
left a comment
There was a problem hiding this comment.
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
CheckboxControlcomponent to TypeScript.Why?
Part of the @wordpress/components's TypeScript migration (#35744).
How?
Refactors the current
CheckboxControlto TypeScript.Testing Instructions
CheckboxControlcontinues to function as expected