-
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
Button : deprecate isSmall
prop
#59734
Changes from 2 commits
d47cf79
eb5c177
56bedcf
d768c2a
63a32ca
bf42120
99cb959
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -49,6 +49,11 @@ function useDeprecatedProps( { | |||
}; | ||||
|
||||
if ( isSmall ) { | ||||
deprecated( 'Button isSmall prop', { | ||||
since: '6.6', | ||||
alternative: 'size="small"', | ||||
version: '6.9', | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I'm thinking we don't really have to do a hard deprecation on this one, since the maintenance cost is very low. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
} ); | ||||
computedSize ??= 'small'; | ||||
} | ||||
|
||||
|
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.
Yes, I personally don't think it's worth it in this particular case, but I'm not going to block it if you or others think it's warranted. I will suggest adding a Dev Note for the next WP release though.
If we're going to throw a warning, we should add a prefix:
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.
I decided to remove the
deprecated()
function for now so it doesn't throw any warnings. In the future, we may need to consider adding warnings along with other props such asisPrimary|isTertiary|isSecondary|isLink
.