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
|
aaronrobertshaw
left a comment
There was a problem hiding this comment.
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
isMatchfunction 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
isMatchfunction.Testing Instructions
See things to test in #57908, everything should work correctly.
Testing Instructions for Keyboard
Screenshots or screencast