Opened 11 hours ago
Last modified 6 hours ago
#65489 new defect (bug)
Icons: There are icon files that are not used in the icon registry
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 7.1 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Build/Test Tools | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Follow-up to #64651
The icons published by the icon registry are determined by this manifest PHP file. This PHP file is copied from this manifest PHP file, which is auto-generated in the Gutenberg repository.
To avoid localizing unused icon labels, we filter all icons from the @wordpress/icons package and extract only the icons that are actually published into the manifest PHP file. Please refer to Gutenberg PR #75684 for details.
However, the Gutenberg sync process copies all SVG icons, adding a large number of icons to the core that are not used in the icon registry. This is not what was intended, so I believe we need to improve the synchronization process.
Change History (4)
This ticket was mentioned in PR #12223 on WordPress/wordpress-develop by @wildworks.
11 hours ago
#1
- Keywords has-patch added
@desrosj commented on PR #12223:
9 hours ago
#2
However, I think I'd like to try an approach similar to WordPress/gutenberg#76715 where SVG icons that are not marked
"public": truedo not get included in the Zip file at all.
I still need to add proper PR descriptions, but https://github.com/WordPress/gutenberg/pull/79338 is a rough idea of what this could look like being handled by WordPress/gutenberg.
#12224 is the PR for wordpress-develop demonstrating that it works.
@wildworks commented on PR #12223:
7 hours ago
#3
I still need to add proper PR descriptions, but https://github.com/WordPress/gutenberg/pull/79338 is a rough idea of what this could look like being handled by WordPress/gutenberg.
Thank you, that approach seems better. Let's close this PR.
#4
@
6 hours ago
Tested on Windows using the local wordpress-develop environment. Checked out PR #12223. Ran npm run build successfully. Verified that the icon library builds successfully (88 SVGs). Confirmed that icons render correctly in the block editor (including Social Icons and Navigation blocks). No missing icons or icon-related console errors were observed.
The core icon registry (
WP_Icons_Registry) only loads the icons listed inicon-library-manifest.php(88 icons), but the build copied every SVG from the@wordpress/iconslibrary (331 files) intowp-includes/images/icon-library. This shipped 243 unused SVG files to core that are never served.This has been the case since the icon library was introduced: the SVG copy used a
*.svgglob, while only the manifest subset is exposed.This PR:
copy:icon-library-imagesGrunt task to the SVGs referenced by the manifest, by parsing itsfilePathentries. It throws if the manifest is missing so the build fails loudly instead of silently copying nothing.wp-includes/images/icon-library, leaving only the 88 manifest-listed icons.## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.8
Used for: Investigating the manifest/SVG mismatch, implementing the Gruntfile change, and regenerating the icon set. All changes were reviewed and verified by me.