-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Refactor/toolbar item component to typescript #49190
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @margolisj! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
@mike-day hey I just saw in another thread you were going to start more Toolbar related typings and just wanted to let you know I started this and ToolbarGroup. Sry for the @ couldn't think of a better way to send a message to you. |
Thanks for the heads up, @margolisj! |
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 contributing, @margolisj! If you ever do any more of these, feel free to ping me and @ciampo on the PR so we can get it reviewed in a more timely manner 😄
Before we merge, it'll be great if you could rebase and add a changelog entry as well, thanks.
@mirka I'll be able to respond to your comments and possibly fix them, time permitting, but I also did ToolBarGroup. Would you like me to pull that into this and make it a larger PR or leave this here and open another on top of this? |
Great, thank you! Let's make it a separate PR for easier review 👍 |
@mirka + @ciampo Looks like there is a unit test using the function based toolbar item line 85 {
children,
as: Component,
...props
}: React.ComponentPropsWithoutRef< typeof BaseToolbarItem > I added a ts-ignore to that. Another issue from that causes as/Component parameter to default to |
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.
Looks great, thank you for your work on this! 🚀
We can merge once the changelog conflict is resolved.
Congratulations on your first merged pull request, @margolisj! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
What?
Convert the ToolbarItem component to TypeScript.
Why?
This PR is needed as part of an effort to convert ToolbarItem to TypeScript. As mentioned in #35744 .
How?
By adding types to ToolbarItem.
Testing Instructions
Create or otherwise open a post
Add a block that would have some toolbar controls (e.g. Image)
Expected: Toolbar buttons should fundamentally work the same as before: