[wp-trac] [WordPress Trac] #59969: Conditional loading `build_template_part_block_variations` for performance improvement
WordPress Trac
noreply at wordpress.org
Tue Dec 19 17:35:59 UTC 2023
#59969: Conditional loading `build_template_part_block_variations` for performance
improvement
-------------------------------------------------+-------------------------
Reporter: thekt12 | Owner: thekt12
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 6.5
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion needs-unit- | Focuses:
tests | performance
-------------------------------------------------+-------------------------
Comment (by joemcgill):
Hi @spacedmonkey! Thanks for checking in here. Your
[https://github.com/WordPress/wordpress-develop/pull/4857 last PR] and
initial explorations in
[https://github.com/WordPress/gutenberg/issues/45601 the related Gutenberg
ticket] have been the foundations of the continuing iteration that
@thekt12 has been doing in his PR, as I see it.
The main differences in the approaches so far are that we wanted to avoid
relying on a filter to register callbacks for variations and experiment
with allowing the `$variations` property to be a callable as well as an
array of variation objects in order to get to the same result. I'm not
confident that handling that kind of type juggling is going to work, since
we can't be sure what third party code is expecting that property to only
include an array of objects, so overloading that property with a magic
getter or introducing a new method for hydrating variation data entirely
might be necessary.
I assume changing the `$variations` property to allow it to either be an
array of objects or a callable is the main back-compat concern you have?
If that's not correct, could you elaborate?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59969#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list