Make WordPress Core

Opened 7 months ago

Closed 6 months ago

Last modified 3 months ago

#61588 closed enhancement (fixed)

Theme.json: enable block-level background image styles

Reported by: ramonopoly's profile ramonopoly Owned by: ramonopoly's profile ramonopoly
Milestone: 6.7 Priority: normal
Severity: normal Version: 6.6
Component: Themes Keywords: has-patch has-unit-tests gutenberg-merge commit
Focuses: Cc:

Description

A ticket to track the Gutenberg PR sync for enabling enable block-level background image styles in theme.json

The merged Gutenberg PR: https://github.com/WordPress/gutenberg/pull/60100

Change History (13)

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


7 months ago
#1

Work in progress...

Syncing source code changes from WordPress/gutenberg#60100

Trac ticket: https://core.trac.wordpress.org/ticket/61588>

@aaronrobertshaw commented on PR #6836:


7 months ago
#2

Thanks for adding the @ticket comments, missed those in my review, sorry.

Latest changes LGTM 🚀

@ramonopoly commented on PR #6836:


7 months ago
#3

I appreciate the quick review!

#4 @noisysocks
6 months ago

  • Keywords commit added
  • Owner set to ramonopoly
  • Status changed from new to assigned

#5 @noisysocks
6 months ago

@ramonopoly: OK to commit this? (Happy to guide you through it. DM me.)

#6 @ramonopoly
6 months ago

@noisysocks Thanks for the ping. Yes, a walkthrough would be appreciated!

#7 @noisysocks
6 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 58797:

Block themes: Enable block-level background image styles

Allows defining background images for blocks in theme.json.

Syncs PHP changes from https://github.com/WordPress/gutenberg/pull/60100.

Props ramonopoly, aaronrobertshaw.
Fixes #61588.

@noisysocks commented on PR #6836:


6 months ago
#8

Committed in r58797.

@mukesh27 commented on PR #6836:


3 months ago
#9

@ramonjd @joemcgill @felixarntz

I ran local Server-Timing benchmarks with and without these PR changes and found that the PR is responsible for ~3% regression.

### Server-Timing benchmarks

Mertic Beta 3 Beta 3 without these PR changes Diff % Diff abs.
Response Time 69.05 65.67 -4.90% -3.38
wp-before-template 30.94 29.67 -4.10% -1.27
wp-template 35.45 34.15 -3.67% -1.30
wp-total 66.87 63.97 -4.34% -2.90

@ramonopoly commented on PR #6836:


3 months ago
#10

I ran local Server-Timing benchmarks with and without these PR changes and found that the PR is responsible for ~3% regression.

Interesting. Thanks for the ping!

I'm at the end of my day, but I wonder if the following needs to be cached:

https://github.com/WordPress/wordpress-develop/pull/6836/files#diff-1be8a8089d87d1b4b6e449c0967680d6f7c170d13f247180a975cbea5e54070fR310

@mukeshpanchal27 Are you comparing against local changes using https://github.com/mukeshpanchal27/compare-wp-performance? Could you share your workflow? Thanks!

@flixos90 commented on PR #6836:


3 months ago
#12

@ramonjd @mukeshpanchal27

I'm at the end of my day, but I wonder if the following needs to be cached:

https://github.com/WordPress/wordpress-develop/pull/6836/files#diff-1be8a8089d87d1b4b6e449c0967680d6f7c170d13f247180a975cbea5e54070fR310

Good suggestion. Let's first verify that that method is indeed responsible for a notable performance decline. Maybe just comment it out and rerun the benchmarks to compare?

@ramonopoly commented on PR #6836:


3 months ago
#13

Let's first verify that that method is indeed responsible for a notable performance decline. Maybe just comment it out and rerun the benchmarks to compare?

Commented over here: https://github.com/WordPress/performance/issues/1572#issuecomment-2415698594

I'm not sure there's much to see here yet.

I also mentioned that I think there needs to be a caching strategy for resolved URIs however:

I think perhaps caching them in WP_Theme_JSON_Resolver as is done with theme_json might work, using get_stylesheet() or get_stylesheet_directory() as a key. I'll add it to my list of things to look into.

Thank you!

Note: See TracTickets for help on using tickets.