Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport layout block support layout definition and stabilisation changes for 6.3 #4624

Conversation

andrewserong
Copy link
Contributor

@andrewserong andrewserong commented Jun 16, 2023

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

This PR backports 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 WordPress/gutenberg#50621, 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.

Current status of this PR

This PR is generally working, however as the JS changes have not yet landed, layout support will be broken in the post and site editors. Once the JS changes have landed, this should be able to be merged straight afterwards.

A note on the size of changes in expected test strings

Prior to this PR, the Theme JSON class's tests used a data provider to use an artificially smaller set of layout definitions for the tests. With the layout definitions being moved to PHP, the tests now use closer-to-real data, and more accurately reflect the real CSS output of the layout styles.

To-do

  • Add in the changes for layout stabilisation
  • Update all failing tests

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@andrewserong andrewserong force-pushed the update/move-layout-definitions-to-a-function branch from 175edee to 083a757 Compare June 23, 2023 04:57
@andrewserong andrewserong changed the title [WIP] Backport layout block support layout definition and stabilisation changes for 6.3 Backport layout block support layout definition and stabilisation changes for 6.3 Jun 23, 2023
@andrewserong andrewserong marked this pull request as ready for review June 23, 2023 05:05
@andrewserong
Copy link
Contributor Author

@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 🤞

@ramonjd
Copy link
Member

ramonjd commented Jun 26, 2023

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

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a few nit picks and one comment about naming things.

src/wp-includes/block-supports/layout.php Outdated Show resolved Hide resolved
src/wp-includes/block-supports/layout.php Show resolved Hide resolved
src/wp-includes/class-wp-theme-json.php Show resolved Hide resolved
@tellthemachines
Copy link
Contributor

committed in r56055 / 7e9385e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants