Block Editor: Optimize 'Connections' inspector controls#56443
Merged
Conversation
Member
Author
|
@c4rl0sbr4v0, I couldn't test the controls with the Image block; the panel isn't rendered for it. I can reproduce the same behavior on `trunk', which is worth debugging separately. |
|
Size Change: +6 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
SantosGuillamot
approved these changes
Nov 23, 2023
Member
Author
|
Thanks for the review, @SantosGuillamot! |
|
Flaky tests detected in ef07edc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6960380662
|
Contributor
|
Thanks @Mamaduka! The optimization makes sense to me 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This is similar to #55721.
A micro-optimization for "Connections" inspector controls to avoid calling
useBlockEditingModefor every block rendered in the editor.Why?
This is an effort to minimize unnecessary store subscriptions created per block. See #54819 (comment).
P.S. While the feature is hidden behind the experimental flag, I think it's good to ship similar optimizations early.
How?
I extracted the primary logic into a separate component, only rendered when a block supports
connectionsand is selected.Testing Instructions
wp-admin/admin.php?page=gutenberg-experimentsTesting Instructions for Keyboard
Same.
Screenshots or screencast