Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#58550 closed task (blessed) (fixed)

Update layout block support definitions to be handled by a function, stabilise the block support

Reported by: andrewserong's profile andrewserong Owned by: isabel_brison's profile isabel_brison
Milestone: 6.3 Priority: normal
Severity: normal Version: 6.3
Component: Editor Keywords: gutenberg-merge has-patch
Focuses: Cc:


Backport changes from the Gutenberg repo relating to stabilising the layout block support.

Two changes that would be good to group together include moving the layout definitions from being stored in theme.json to being output by a PHP function, and stabilising the block support by looking layout support via the layout key with a fallback to __experimentalLayout.

These changes landed in the Gutenberg plugin in the following PRs:

Due to the relationship between the PHP and JS changes for moving layout definitions, backporting the above changes should likely land just after or at the same time as landing the JS packages update for WordPress 6.3.

A note: moving the layout definitions is technically a breaking change in case there were any themes or plugins attempting to override the layout definitions in theme.json. This is unlikely to be common, as overriding layout definitions was both discouraged and the ability to do so was undocumented and would likely have broken block themes that attempted to do it.

Assuming the backports are approved and land for 6.3, I'll write up a dev note covering the change.

Change History (10)

#1 @andrewserong
11 months ago

  • Component changed from General to Editor

#2 @andrewserong
11 months ago

  • Keywords gutenberg-merge added

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

11 months ago

  • Keywords has-patch added

Trac ticket:

🚧 🚧 🚧 This is a WIP and is not yet ready for review 🚧 🚧 🚧

This PR (will) backport the following PRs:

As the changes in this PR will need some JS changes to be backported first, this PR will likely need to land fairly late in the cycle before Beta 1 is released. More specifically, in, the JS is updated to not depend on the PHP version of the layout definitions, and this PR will no longer pass the data to JS from PHP via block settings, so needs to land either at the same time as the JS changes, or just after.

## To-do

  • [ ] Add in the changes for layout stabilisation (not added yet)
  • [ ] Update all failing tests (the tests will ultimately be more verbose with this PR as we will be testing the real layout CSS that gets output, and not the shorter mock data we've been testing previously)

#4 @poena
11 months ago

There is a single theme in the theme directory that uses the layout definitions incorrectly:
I opened an issue in their GitHub repository.

Last edited 11 months ago by poena (previous) (diff)

#5 @andrewserong
11 months ago

Wonderful, thank you for finding that one @poena!

@andrewserong commented on PR #4624:

11 months ago

@tellthemachines @ramonjd, I believe this PR is now ready for review. It'll likely want to wait until it can be tested with the JS changes backport, but I've given it a rebase and updated all the expected test strings, so I believe it's now consistent with where we'd expect it to be for Beta 1 🤞

@ramonopoly commented on PR #4624:

11 months ago

Code looks good to me. No frontend regressions. Packages should be release today so we can give it a final ✅

#8 @audrasjb
11 months ago

  • Type changed from enhancement to task (blessed)

Converting to a task as this can ship after beta 1 is released.

#9 @isabel_brison
11 months ago

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

In 56055:

Editor: stabilise layout and refactor definitions.

Marks the layout support stable and moves layout definitions from theme.json into wp-includes/block-supports/layout.php.

Props andrewserong, poena, ramonopoly, peterwilsoncc.
Fixes #58550.

@isabel_brison commented on PR #4624:

11 months ago

committed in r56055 / 7e9385e.

Note: See TracTickets for help on using tickets.