Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 3 months ago

#62329 closed enhancement (fixed)

Theme JSON Resolver: remove theme json merge in resolve_theme_file_uri

Reported by: ramonopoly's profile ramonopoly Owned by: ramonopoly's profile ramonopoly
Milestone: 6.8 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch, gutenberg-merge
Focuses: Cc:

Description (last modified by ramonopoly)

A ticket to trac the syncing of Gutenberg PR https://github.com/WordPress/gutenberg/pull/66662

The change affects WP_Theme_JSON_Resolver::resolve_theme_file_uris().

When setting resolved URIs in an incoming theme json object, remove the unnecessary call to WP_Theme_JSON->merge().

Why?

WP_Theme_JSON_Resolver::resolve_theme_file_uris() only needs to set values for paths in the raw theme json object.

It can then return a new theme object based on the updated JSON source. There's no need for a full and possibly expensive merge.

Change History (5)

#1 @ramonopoly
6 months ago

  • Description modified (diff)

This ticket was mentioned in PR #7698 on WordPress/wordpress-develop by @ramonopoly.


6 months ago
#2

This PR syncs Gutenberg PR https://github.com/WordPress/gutenberg/pull/66662

The change affects WP_Theme_JSON_Resolver::resolve_theme_file_uris().

When setting resolved URIs in an incoming theme json object, remove the unnecessary call to WP_Theme_JSON->merge().

Why?

WP_Theme_JSON_Resolver::resolve_theme_file_uris() only needs to set values for paths in the raw theme json object.

It can then return a new theme object based on the updated JSON source. There's no need for a full and possibly expensive merge.

### Testing

There is existing test coverage. Tests should pass.

Trac ticket: https://core.trac.wordpress.org/ticket/62329

#3 @ramonopoly
6 months ago

  • Owner set to ramonopoly
  • Resolution set to fixed
  • Status changed from new to closed

In 59338:

Theme JSON Resolver: remove theme json merge in resolve_theme_file_uris

This commit affects WP_Theme_JSON_Resolver::resolve_theme_file_uris().

When setting resolved URIs in an incoming theme json object, this commit removes the unnecessary call to WP_Theme_JSON->merge().

Why? WP_Theme_JSON_Resolver::resolve_theme_file_uris() only needs to set values for paths in the raw theme json object. It can then return a new theme object based on the updated JSON source. There's no need for a full and possibly expensive merge.

Follow-up to [61588].

Props ramonopoly, aaronrobertshaw, andrewserong.
Fixes #62329.

@ramonopoly commented on PR #7698:


6 months ago
#4

Committed in r59338 / b6430c28f7f467d894475e01acf86e8dd8781f86

#5 @joemcgill
3 months ago

  • Keywords changed from has-patch gutenberg-merge to has-patch, gutenberg-merge
Note: See TracTickets for help on using tickets.