-
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
Pattern Overrides: Memoize controls component #63189
Conversation
{ props.isSelected && isSupportedBlock && ( | ||
<ControlsWithStoreSubscription { ...props } /> | ||
<MemoizedControlsWithStoreSubscription |
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.
Can't we use createBlockEditFilter
like the other hooks?
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 package is different, but I can copy the same logic here. This is still draft PR :)
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.
Oh, maybe we could add a private API for now?
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 is only the editor.BlockEdit
filter in the editor package. Does it make sense to abstract it now?
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.
I think it does at some point anyway, we need to start thinking about the block supports API.
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.
In my case, to actually start building it 😅 Hopefully, I can share something before 6.7 betas.
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.
Block bindings panels should use it too, in case it helps.
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.
@cbravobernal, which component exactly are we talking about?
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.
I'm still working on it, and will move it from block-editor
to editor
package. But is this one:
#62880
Size Change: +55 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
I missed a couple of updates in the child components. This is the reason for the e2e test failures. I also noticed that the
|
8197d15
to
cc989c1
Compare
hasUnsupportedAttributes={ | ||
props.name === 'core/image' && | ||
( !! props.attributes.caption?.length || | ||
!! props.attributes.href?.length ) | ||
} |
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.
I had to lift this condition to avoid passing the whole attribute object.
@cbravobernal, the UI implementation from #62880 will stay in the In that case, as @kevin940726 noted, there's probably no need for optimization here - #63146 (comment). |
Correct, we can close this draft PR and its issue. |
What?
See #63146.
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast