Uh oh!
There was an error while loading. Please reload this page.
Backport foundation for Layout block support refactor (part 1) - #3205
Backport foundation for Layout block support refactor (part 1)#3205andrewserong wants to merge 16 commits into
Conversation
andrewserong
commented
Sep 9, 2022
Update: today I've been mostly focused on reviewing PRs in the Gutenberg repo that also touch the files included in this PR. I suspect there'll be a fair few more changes landing in Gutenberg shortly, but so far I think the rough scope of this PR seems to be an okay first step toward backporting the Layout refactor. I'll follow-up early next week to give this a fresh overhaul to roll in recent changes, and see about getting this ready for review. |
96b0844 to
9761152Compareandrewserong
commented
Sep 12, 2022
Update: I think most of the changes are now migrated over correctly for these files, and unit tests are finally passing 🎉 One outstanding task is that I haven't yet migrated over the test for the feature level selectors that was included in WordPress/gutenberg#42087 by @aaronrobertshaw as I wasn't too sure where or how we should best register blocks in core tests. I'll look into that further tomorrow. CC: @tellthemachines I believe the root padding and layout changes have all been migrated over — except for the changes to Since tests are now passing, I'll hook up the trac ticket and switch this over to ready for view. It's quite possible that I've missed things in the process, so please do let me know if anyone catches things that should be fixed up. Thanks! |
aaronrobertshaw
commented
Sep 12, 2022
@andrewserong, we might be able to avoid registering a new block within the bootstrap.php for the feature-level selectors test. From memory, we needed to do that because WordPress was loaded before the tests ran, meaning theme.json generated block metadata too soon effectively ignoring any block registration we did in the specific tests. Now the image block adopts the feature level selectors, it's probably time to switch the test to use that core block. I'm out of time today but will touch base with you tomorrow on this one. |
andrewserong
commented
Sep 13, 2022
Thanks for following up, Aaron! In that case, we might be better off adding the test for the feature level selectors once the image block's |
Uh oh!
There was an error while loading. Please reload this page.
andrewserong
commented
Sep 14, 2022
@ockham, I believe this one should be ready for final review/commit now that we've got approval from @tellthemachines (thanks!) To recap:
|
This PR was committed in https://core.trac.wordpress.org/changeset/54159. However, the added tests from this PR failed. During investigation, I found that this PR tests pass when the Style Engine's commit is not applied, but fails when it is. So this PR's commit was reverted. Next step:
Then it'll be ready again for commit consideration. |
ockham
commented
Sep 14, 2022
FWIW, here's a link to the failing tests. |
ockham
commented
Sep 14, 2022
Sharing some more findings (also posted in Slack):
|
hellofromtonya
commented
Sep 14, 2022
Follow-up: When applying this PR on top of the current
Repeating this same process, tests pass locally in both cases ✅ This leads me to believe the issue from earlier may possibly be related to something within the So, I'm recommitting this PR, but just to make sure, recommitting it on top of |
hellofromtonya
commented
Sep 14, 2022
Committed via https://core.trac.wordpress.org/changeset/54162. |
This PR is the beginnings of an attempt to backport the Layout block support refactor from Gutenberg to WordPress core for the 6.1 release. The goal is to attempt to do this in parts.
layout.phpin a follow-up, once the prerequisite issues have been resolvedNote that in the progress of working on this PR, it also pulls in parts of unrelated changes.
Scope
Still to-do
block.jsonfile is updated with the main sync of Gutenberg packages in Sync Gutenberg packages #3154Included PRs
This change backports the following changes (while also being slightly different in order to align with core files):
Note that it doesn't entirely port over #40875 — the remaining PHP changes for that PR will be explored in a separate PR targeting
layout.phpWhat does this PR do, primarily?
The primary change that this PR seeks to merge in, is the output of root layout styles. On the site's frontend, you should see rules in the global styles output using classnames such as
is-layout-flexandis-layout-constrained. Note that outputting these classnames into block markup is not included in this PR, as that forms part of the changes inlayout.phpwhich will be addressed separately.Trac ticket: https://core.trac.wordpress.org/ticket/56467
Gutenberg tracking issue: WordPress/gutenberg#43440
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.