[wp-trac] [WordPress Trac] #61451: Improve performance of block style variation registration and retrieval
WordPress Trac
noreply at wordpress.org
Tue Jun 18 07:24:50 UTC 2024
#61451: Improve performance of block style variation registration and retrieval
---------------------------------------+---------------------
Reporter: aaronrobertshaw | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.6
Component: Editor | Version: trunk
Severity: normal | Resolution:
Keywords: gutenberg-merge has-patch | Focuses:
---------------------------------------+---------------------
Comment (by oandregal):
We've done a couple of things for this ticket:
- The feature now only registers block style variations when the
theme.json is processed (no extra theme.json parsing, no extra query to
retrieve user-data, etc.) + specific paths (user updates the styles of the
block style variations). Ref: https://github.com/WordPress/wordpress-
develop/pull/6844
- Cache the reading of files stored in `styles/` as per
https://github.com/WordPress/wordpress-develop/pull/6843
I'm not sure what's the definition of "done" for this ticket. I believe
the two things above could be good enough for the 6.6, though we should
keep investigating.
Further opportunities / work mentioned or in current investigation are:
- Cache the partial theme.json files _after_ they are processed
(translated). One approach could be
https://github.com/WordPress/gutenberg/pull/62610 If not
- Create a performance test case that includes block style variations
defined in a partial theme.json file, so every PR has that info available.
Also including the `theme.json` file or theme style variations would be
good, though it seems more impactful to test the partials (new standalone
file, the source of variations that are always present, etc.).
- The styles generation for the block style variations use the
`wp_theme_json_data_*` filters. This requires that we re-create some
theme.json structures. We could look at the whether absorbing them as part
of the `WP_Theme_JSON_Resolver` and/or `WP_Theme_JSON` merge is impactful.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61451#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list