-
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
Performance: run block variation hook only for matches #62617
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. |
I have an additional performance concern here: #57908 (comment) |
Size Change: +66 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
Flaky tests detected in 632a31c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/9546382055
|
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.
Nice work! Thanks for putting this together @ellatrix 🙇
✅ Approach looks good
✅ Variations are applied correctly in post/site editors
✅ Variations are saved and applied on the frontend still too
Screen.Recording.2024-06-18.at.12.51.41.PM.mp4
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
I just cherry-picked this PR to the wp/6.6-beta-3 branch to get it included in the next release: 2bb7aa6 |
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
What?
See #57908.
Adds an
isMatch
function so we can avoid running the block variation hook when a blocks has class names (which is common), but there are no variation class names. Additionally, avoid the backtracking regex.Why?
Performance.
How?
With an
isMatch
function.Testing Instructions
See things to test in #57908, everything should work correctly.
Testing Instructions for Keyboard
Screenshots or screencast