-
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
Block editor: pass patterns selector as setting #58661
Conversation
Size Change: +18 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Flaky tests detected in 537c271. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7784370960
|
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. |
There are unit test failures: tests need to run in an environment where |
Btw, I'm working on a new performance test first so we can track the improvements better |
Awesome, will polish this PR tomorrow |
d0ac501
to
56adeef
Compare
@ellatrix, can you update the PR with testing instructions? |
@Mamaduka I added something, but this PR shouldn't change anything, so just making sure there's no e2e test failures. |
Even if it the other bug appears fixed (nothing has changed there that could have fixed it I think), this PR is still needed to avoid fetching all patterns from the server for every preview that uses the pattern block (or any other selector that depends on a patterns store selector). |
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.
Looks good 👍
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.
Makes sense. Thank you, @ellatrix!
Thank you both :) |
Looking at the performance graph, there's a 10% improvement for the |
(Which was a regression btw) |
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
I just cherry-picked this PR to the more/backports-for-beta3 branch to get it included in the next release: 4b25a88 |
Co-authored-by: ellatrix <ellatrix@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Note that as part of curating the Gutenberg 17.8 changelog, I added the label [Feature] Patterns to this PR to better categorize it. Please let me know if there is a different label that would be a better fit. |
What?
Changes the way patterns are loaded in the block editor to a select function that resolves the patterns in the core store instead of resolving them in the block editor store.
Why?
Currently, when loading previews with patterns, these previews all refetch the patterns from the server because these are all separate block editor instances.
How?
Testing Instructions
Patterns in the inserter should appear. Maybe worth testing other pattern lists in the site editor, but nothing should have changed there, everything should work as before.
We have e2e test coverage for pattern screens.
Testing Instructions for Keyboard
Screenshots or screencast