-
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
[Regression - Button]: Add deprecation for style.border.radius
number
#33117
Conversation
Size Change: +224 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
Thanks for adding in this deprecation! I had a go at handling both kinds of border radius in #33100, but I think this approach using a deprecation is probably a better way to do it 🙂 |
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.
@ntsekouras Thanks for fixing this! 🙇
I could replicate the validation error using the example block code prior to applying this PR. After applying this the same block code is successfully migrated without error.
Digging into this deeper, it might help to highlight some other recent changes that may have impacted this. Support for both short and longhand CSS properties was recently added in #31641.
Part of that involved distinguishing between a shorthand and longhand value which was done via checking ! isString( value )
. This doesn't take into account the deprecated numerical border radius value for a button block.
If that check was changed it would still cause a different set of block validation errors as it would apply border-radius: 0
where the old ad hoc radius application for buttons excluded that.
This PR's deprecation solves the problem neatly. It also updates the migration of the border support styles to maintain the other newer border support features such as color, style and width, which were added after the button's deprecations had been updated by the looks of it.
Nice work, and thanks again 👍
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 fixing this and adding the deprecation @ntsekouras! This change looks good to me, and I confirmed that the block pattern now renders correctly without throwing an error (and the block's attributes get migrated):
Also confirmed that button blocks with individual radii continue to be rendered as expected:
LGTM.
With all the tests passing and multiple approvals, I'll merge this one now. |
Cherry picked in |
Thanks for working on this, @ntsekouras. |
Description
Fixes: WordPress/pattern-directory#245
Regression from: #33017
The above PR(33017) added support for longhand border radius styles for each corner. This resulted in leaving the existing case of a button block with a number value at
border.style.color
unhandled from deprecations, therefore causing errors.It was discussed in
core-editor
slack, after noticing that a core pattern was causing errors and made all tests fail, as they don't expectconsole
messages.While this PR fixes the regression, we need to handle in another PR the removal of the remote patterns from the tests, as we cannot let the repo's CI depend on something external.
Testing instructions
style.border.radius
as a number (that was the core pattern)Checklist:
*.native.js
files for terms that need renaming or removal).