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. |
| const { records: allIcons } = useEntityRecords( | ||
| 'root', | ||
| 'icon', | ||
| { | ||
| per_page: -1, | ||
| }, | ||
| // Only fetch all icons when the inserter modal is open | ||
| { enabled: isInserterOpen } | ||
| ); | ||
|
|
||
| const { record: selectedIcon } = useEntityRecord( 'root', 'icon', icon, { | ||
| enabled: !! icon, | ||
| } ); |
There was a problem hiding this comment.
Let's just use useSelect. We don't need all the extra info from these hooks.
|
Size Change: -35 B (0%) Total Size: 6.84 MB
ℹ️ View Unchanged
|
|
@Mamaduka Thanks for the follow-up! |
|
I think this PR should ship with WP 7.0, so I'll merge it. If there are any fixes that need to be made, I'll address them in a follow-up. |
* Create icons entity * Just use useSelect * Make getIcons selector public * Remove getIcons selector * Minor cleanup --------- Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: 23b566c |
CI run: #10988. See #64595. --- I've included a log of the Gutenberg changes with the following command: ``` git log --reverse --format="- %s" b441348bb7e05af351c250b74283f253acaf9138..23b566c72e9c4a36219ef5d6e62890f05551f6cb | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy ``` - Remove experimental property from Icon block (WordPress/gutenberg#75742) - Real-time collab editing: Fix undo E2E test (WordPress/gutenberg#75740) - Snackbar: Fix scaling issue with snackbars that update their content via a common id (WordPress/gutenberg#75709) - Vips and worker-threads packages: remove private flag so that packages can be published to npm (WordPress/gutenberg#75752) - Update wordpress/vips in root package.json to use a relative path (WordPress/gutenberg#75758) - Fix change-detection and new-post E2E tests after RTC enabled by default (WordPress/gutenberg#75751) - Query: Remove content role from block (WordPress/gutenberg#75760) - `ToggleGroupControl`: Make unselected item color consistent across all variants (WordPress/gutenberg#75737) - Icon-block: fix global-styles selectors (WordPress/gutenberg#75724) - RTC: Add cap check for single taxonomy term entities (WordPress/gutenberg#75708) - Core Data: Create icons entity (WordPress/gutenberg#75773) git-svn-id: https://develop.svn.wordpress.org/trunk@61705 602fd350-edb4-49c9-b593-d223f7449a82
CI run: WordPress/wordpress-develop#10988. See #64595. --- I've included a log of the Gutenberg changes with the following command: ``` git log --reverse --format="- %s" b441348bb7e05af351c250b74283f253acaf9138..23b566c72e9c4a36219ef5d6e62890f05551f6cb | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy ``` - Remove experimental property from Icon block (WordPress/gutenberg#75742) - Real-time collab editing: Fix undo E2E test (WordPress/gutenberg#75740) - Snackbar: Fix scaling issue with snackbars that update their content via a common id (WordPress/gutenberg#75709) - Vips and worker-threads packages: remove private flag so that packages can be published to npm (WordPress/gutenberg#75752) - Update wordpress/vips in root package.json to use a relative path (WordPress/gutenberg#75758) - Fix change-detection and new-post E2E tests after RTC enabled by default (WordPress/gutenberg#75751) - Query: Remove content role from block (WordPress/gutenberg#75760) - `ToggleGroupControl`: Make unselected item color consistent across all variants (WordPress/gutenberg#75737) - Icon-block: fix global-styles selectors (WordPress/gutenberg#75724) - RTC: Add cap check for single taxonomy term entities (WordPress/gutenberg#75708) - Core Data: Create icons entity (WordPress/gutenberg#75773) Built from https://develop.svn.wordpress.org/trunk@61705 git-svn-id: http://core.svn.wordpress.org/trunk@61013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
Awesome, thanks for doing things the right way, and so quickly. :) |
* Create icons entity * Just use useSelect * Make getIcons selector public * Remove getIcons selector * Minor cleanup --------- Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
|
I just cherry-picked this PR to the release/22.6 branch to get it included in the next release: ca046ef |
* Create icons entity * Just use useSelect * Make getIcons selector public * Remove getIcons selector * Minor cleanup --------- Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
What? Why? How?
The Icon Block loads all icons on initial render. This PR removes the ad-hoc approach to get the icon and instead creates an entity and utilizes that. This will prevent unnecessary requests and should improve performance.
Testing Instructions
/wp-json/wp/v2/icon.