-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Test editor styles perf #60940
Test editor styles perf #60940
Conversation
Size Change: +130 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
const aIndex = clientIdMap[ a[ 1 ].clientId ] ?? -1; | ||
const bIndex = clientIdMap[ b[ 1 ].clientId ] ?? -1; | ||
return aIndex - bIndex; | ||
} ); |
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.
Do overrides already have a clientId added to them?
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 don't see the code in the PR that adds that clientId to the override object)
const { overrides, clientIds } = useSelect( | ||
( select ) => ( { | ||
overrides: unlock( select( blockEditorStore ) ).getStyleOverrides(), | ||
clientIds: select( blockEditorStore ).getClientIdsWithDescendants(), |
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.
Does this work for controlled blocks as well?
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.
What if we change getStyleOverrides
to return the sorted overrides? 🤔
For me, this is good, if it solves your style dependency issues |
@ellatrix Just for some context, this was me pulling some of the code out of Block Styles: Extend block style variations as mechanism for achieving section styling to see what the performance impact of this particular bit of code is. That PR is causing some performance issues, and it's not clear where right now, but I don't think it's this bit of code. |
I did notice though that this bit of code now triggers some updates to this component whenever a block is added/moved/removed, not sure there's much impact, but having said that I don't think there's a performance test for block insertion. |
I think it's anyway good to do this separately as a preparatory PR? That PR is huge. |
I guess these changes were forgotten here? |
Agreed. FWIW until all the moving parts to achieve the extended block style variations feature were discovered through #57908. We weren't in a position to split this out as the order issues with style overrides were one of the last hurdles found. Now #57908 has stabilized, there's no reason not to carve out what we can into PRs like this.
Yep. the addition of |
I'll close this as @aaronrobertshaw indicated that he'll make some new PRs with proper descriptions 👍 |
I've put up an alternate PR that includes the addition of |
What?
Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast