-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Inline Commenting: Optimize store selector and misc changes #66592
Conversation
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. |
@@ -22,7 +22,7 @@ import { store as editorStore } from '../../store'; | |||
import AddCommentButton from './comment-button'; | |||
import AddCommentToolbarButton from './comment-button-toolbar'; | |||
|
|||
const threadsEmptyArray = []; | |||
const EMPTY_ARRAY = []; |
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.
This matches the name used in other places and makes it easier to search the code base.
Size Change: -9 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
1e94909
to
58d03a6
Compare
postId: select( editorStore ).getCurrentPostId(), | ||
postId: _postId, | ||
postStatus: getEditedPostAttribute( 'status' ), | ||
threads: data ?? EMPTY_ARRAY, |
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.
Nit: could also fall back to an array outside of the selector and we wouldn't need the constant.
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.
Let's leave it for now. The component seems to change more rapidly now that the general concept has landed and we have the updated designs.
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.
Tests well and code makes sense 👍 Thanks @Mamaduka 🚀
Flaky tests detected in 06a1511. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11593524208
|
…s#66592) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
What?
PR updates the
CollabSidebar
component and combines store subscriptions when possible. I've also removed the side effect for settingblockCommentID
.I noticed multiple
useSelect
hook usages when reviewing the #66583.Why?
useSelect
hooks. This reduces the number of store subscriptions.Testing Instructions
Testing Instructions for Keyboard
Same.