-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 foundation for Layout block support refactor (part 1) #3205
Backport foundation for Layout block support refactor (part 1) #3205
Conversation
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
9761152
Compare
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! |
@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. |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good!
@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. |
FWIW, here's a link to the failing tests. |
Sharing some more findings (also posted in Slack):
|
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 |
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.php
in 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.json
file 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.php
What 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-flex
andis-layout-constrained
. Note that outputting these classnames into block markup is not included in this PR, as that forms part of the changes inlayout.php
which 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.