Make shouldShowBlockTools pure function (remove subscription)#73012
Make shouldShowBlockTools pure function (remove subscription)#73012
Conversation
|
Size Change: -4.26 kB (-0.18%) Total Size: 2.42 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in ae9d430. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19270893858
|
Combining selectors where possible is good for performance. This refactor keeps the complexity isolated while eleminating an unnecessary extra subscription.
b255603 to
11c9e40
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
scruffian
left a comment
There was a problem hiding this comment.
This is looking good to me now. You should just check that I didn't miss anything in the rebase!
What?
Quick refactor to remove a top level subscription.
Why?
Minor perf cleanup
How?
useShowBlockToolswas originally created as a source of truth for if the block toolbar was showing in both the top toolbar and floating toolbar. Having it work in both scenarios caused performance issues when it was created, so the top toolbar part was removed. At that time, it made sense that the file be a hook that maintained its own selector. Now, with it only used in one place, the extra subscription is unnecessary, so I'm removing it.Testing Instructions
Everything should work the same as on trunk.
Testing Instructions for Keyboard
Screenshots or screencast