-
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
Quote: update deprecation to expect style block supports #35615
Quote: update deprecation to expect style block supports #35615
Conversation
…we don't allow through an unwanted style attribute of `{ style: 1 }`.
Size Change: +19 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
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.
Nice work on the quick fix here @ramonjd 🏅
✅ The fixture tests all pass for me
✅ Manually pasting deprecated block markup gets successfully migrated
✅ Loading old post with deprecated content still works as expected
This all looks good to me 👍
One tiny suggestion ( please feel free to ignore ) is that now might be a good opportunity to omit the omit
from these deprecations and use the rest operator instead. I'll leave that call to you 🙂
Thanks for the review! 🙇
Good suggestion. Nothing gives me more pleasure than replacing lodash methods. eslint nags about the unused destructured var (no-unused-vars) We could delete the prop: const newAttributes = {
...attributes,
};
delete newAttributes.style;
return newAttributes; Maybe I can raise this in one of the channels and see what the preference would be across the repo. I'll put my hand up to do a lodash cull. 😄 |
Description
Over at #34064, we were hoping to add typography block supports to the Quote Block.
Then we ran into 😱
Long ago, in the dark times, the quote block did have an attribute of
{ style: 1 }
to dictate a particular UI block style, e.g., Large or Cheese-Streamers-With-Comic-Sans.To avoid the legacy
style
attribute hanging around, the Quote Block deprecations needs a teensy tweak to ensure the block is correctly migrated when we it opts-in to block supports that rely on a style attributeHow has this been tested?
Run
npm run fixtures:generate
. The tests should pass.If you want to check manually, activate TT1 blocks.
In
quote/block.json
, opt-in to any of the following block supports for the Core Quote Block:You might have to enable support in your
theme.json
file as well, e.g.,In the Block Editor code view field, paste the contents of core__quote__deprecated.html
It should match the contents of core__quote__deprecated-1.serialized.html
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).