Block Editor: Subscribe only to block editor store in useBlockSync#55041
Conversation
|
Size Change: +1 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 0e9f2b3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6404978106
|
ntsekouras
left a comment
There was a problem hiding this comment.
Nice! I'm wondering if this would improve performance noticeably. Thank you!
|
Thank you both 🙌
While I didn't spot any regressions looking at the performance results in CI here, I'm going to keep an eye on the aggregated results in code vitals. |
|
Makes sense thank you |
|
Great idea! I also noticed this opportunity but you also implemented it 🙂 |
What?
This PR updates an inner subscription inside
useBlockSyncto only subscribe to the block editor store, instead of to all stores.Why?
While doing another quick timeboxing session on #54819 I noticed that we're currently subscribing to all stores in
useBlockSyncwhen syncing back from the block editor store to the controlling entity. However, we're using only the block editor store, so there's no need to subscribe to all other stores.How?
We're just adding the block editor as the store descriptor to subscribe to.
Testing Instructions
Smoke test typing and verify all checks are green.
Testing Instructions for Keyboard
None
Screenshots or screencast
None