-
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
Remove empty attrs. #54496
Remove empty attrs. #54496
Conversation
Flaky tests detected in 2cc7fc5. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6197299771
|
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.
This seems good to me, thanks @spacedmonkey for following-up on #54496 #54424.
I'm leaving a pre-emptive approval on this because all that remains is filling in the PR description and taking care of some styling issues that CI will reject.
👋 @dmsnell This is on the 6.4 Editor Tasks board, so I'm wondering if this needs to be merged ready for the upcoming 6.4 RC. As @spacedmonkey is away at the moment, I wondered if you could help here. I'm happy to help fix the CS issues, but I'm not sure how high a priority this is or if it's not ready to be merged yet. Thank you! |
* Remove empty attrs. * Fix linter errors --------- Co-authored-by: Sarah Norris <[email protected]>
I just cherry-picked this PR to the 6.4-rc1-2 branch to get it included in the next release: 0afdb21 |
* Add selector as id to layout style overrides. (#55291) * Fix flickering when focusing on global style variations (#55267) * ProgressBar: use text color to ensure enough contrast against background (#55285) * Use text color at different opacities for track and indicator * Add high contrast mode styles * CHANGELOG # Conflicts: # packages/components/CHANGELOG.md * Remove empty attrs. (#54496) * Remove empty attrs. * Fix linter errors --------- Co-authored-by: Sarah Norris <[email protected]> * Add IS_GUTENBERG_PLUGIN flag to LastRevision (#55253) * useBlockPreview: Try outputting EditorStyles to ensure local style overrides are rendered (#55288) * useBlockPreview: Try alternative fix for displaying local style overrides * Avoid duplicate styles, fix rendering issues in Safari * Add more explanatory comments * Remove additional check for styles within the block preview, as it is not needed since EditorStyles handles its own style overrides retrieval * Bug: PHP notice when an image with lightbox is deleted (#55370) * Fix PHP notice when an image with lightbox is deleted * Fix PHP notice when an image with lightbox is deleted --------- Co-authored-by: tellthemachines <[email protected]> Co-authored-by: Aki Hamano <[email protected]> Co-authored-by: Marco Ciampini <[email protected]> Co-authored-by: Jonny Harris <[email protected]> Co-authored-by: Andrew Serong <[email protected]> Co-authored-by: Kishan Jasani <[email protected]>
What?
Following work in #54424, this replaces the
$empty_attrs
object, which used to have a role, with an empty array wherever it was previously used.Why?
The reason for having the property was that the block parser used to create a special object for empty attributes to disambiguate an empty object and an empty array in JSON. Because the block parser no longer creates this special object there's no more need to have an
$empty_attrs
property. It's not causing harm, but its continued presence might confuse people who are wondering what its purpose is.How?
Directly replaces the property lookup with in-place
array()
construction.Testing Instructions
A basic smoke test should verify failure because any problem in the block parser is likely to break a site in obvious ways. Ensure that the test suite passes.