-
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
Block Editor: Optimize 'Connections' inspector controls #56443
Conversation
@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
|
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 a lot for the optimization! I've tested it and everything seems to be working fine for the paragraph 🙂 We are about to refactor the whole "connections" experiment and we must keep this in mind.
Thanks for the review, @SantosGuillamot! |
Flaky tests detected in ef07edc. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6960380662
|
Thanks @Mamaduka! The optimization makes sense to me 👍 |
What?
This is similar to #55721.
A micro-optimization for "Connections" inspector controls to avoid calling
useBlockEditingMode
for 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
connections
and is selected.Testing Instructions
wp-admin/admin.php?page=gutenberg-experiments
Testing Instructions for Keyboard
Same.
Screenshots or screencast