Skip to content

Block Supports: Backport optimization from Core for Elements Support#55228

Merged
dmsnell merged 1 commit intotrunkfrom
block-supports/backport-optimization-from-core
Oct 11, 2023
Merged

Block Supports: Backport optimization from Core for Elements Support#55228
dmsnell merged 1 commit intotrunkfrom
block-supports/backport-optimization-from-core

Conversation

@dmsnell
Copy link
Copy Markdown
Member

@dmsnell dmsnell commented Oct 10, 2023

What?

Brings over optimization surfaced during the WordPress 6.4 beta release for block supports elements, which entails skipping needless iteration when it's known that the iteration need not continue.

See WordPress/wordpress-develop#5411
See #59544-trac

Why?

Keeps versions in sync. This optimization was performed in Core first in order to quickly address one of a number of performance issues that were raised during testing the beta release of WordPress 6.4. Its fix should also come back to Gutenberg, since that file is normally updated through the package update.

How?

Copies code from Core into Gutenberg in the corresponding file.

Testing Instructions

Verify that the backport is appropriately applied and that all tests pass.

@dmsnell dmsnell added the Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core label Oct 10, 2023
@dmsnell dmsnell requested a review from spacedmonkey as a code owner October 10, 2023 21:22
@github-actions
Copy link
Copy Markdown

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/block-supports/elements.php

Copy link
Copy Markdown
Contributor

@tellthemachines tellthemachines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following up with this! Code changes look good and element supports are working as expected (tested by adding link/heading colors to a few blocks).

e2e failures seem unrelated and pass locally for me.

Brings over optimization surfaced during the WordPress 6.4 beta release for
block supports elements, which entails skipping needless iteration when it's
known that the iteration need not continue.

See WordPress/wordpress-develop#5411
See [#59544-trac](https://core.trac.wordpress.org/ticket/59544)
@dmsnell dmsnell force-pushed the block-supports/backport-optimization-from-core branch from bf07cc1 to 7602b56 Compare October 11, 2023 01:22
@dmsnell dmsnell merged commit 7602b56 into trunk Oct 11, 2023
@dmsnell dmsnell deleted the block-supports/backport-optimization-from-core branch October 11, 2023 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants