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

Plugin: Backport PHP changes for WordPress 6.0 release #39889

Closed
30 of 36 tasks
gziolo opened this issue Mar 30, 2022 · 36 comments
Closed
30 of 36 tasks

Plugin: Backport PHP changes for WordPress 6.0 release #39889

gziolo opened this issue Mar 30, 2022 · 36 comments
Assignees
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@gziolo
Copy link
Member

gziolo commented Mar 30, 2022

Description

Related Trac ticket 55505.

This is the tracking issue to coordinate the process of backporting all PHP changes added in the Gutenberg plugin that needs to be backported for the WordPress 6.0 release.

Files listed for WP 6.0

lib/block-supports

lib/compat/wordpress-6.0

lib/experimental

Webfonts are still in development. PR #39559 moves the files into the lib/experimentation folder until the API is ready for WordPress Core commit:

Legend:

🟢 – confirmed for WP 6.0
🟡 – needs the decision
🔴 – moved to future WP release

Getting Involved

If you are interested in helping with the efforts, can you comment (or edit the issue's description) with your name next to the file if you plan to help with backporting. It would also help to link to Track issues / GitHub PRs in WordPress core when they are available.

Action items when working on backports:

  • Update the files to follow best practices. Mostly rename functions/classes to use wp_ prefix instead of gutenberg_ and guard with declaration checks for code that needs to be backported to WordPress core.
  • Identify files and functionality that need to be backported to WordPress core.
  • Ensure all files, classes, methods, properties, and functions have @since 6.0.0 documentation tag included.
  • Ensure all functionality backported to WordPress core has unit tests written.
@gziolo gziolo added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Mar 30, 2022
@gziolo gziolo self-assigned this Mar 30, 2022
@Mamaduka
Copy link
Member

@gziolo, I can handle post lock PR for the WP core (mostly later this week).

@gziolo
Copy link
Member Author

gziolo commented Mar 30, 2022

I can handle post lock PR for the WP core (mostly later this week).

Awesome, thank you @Mamaduka ❤️

@hellofromtonya
Copy link
Contributor

hellofromtonya commented Mar 30, 2022

✋ raising my hand to help with audits, prepping and reviewing the PHP code to be ready for Core commit (i.e. compliant with Core standards and practices). A request @peterwilsoncc made is to create smaller patches. I agree. I can help to create these smaller PRs to ease the code review and commit burden / effort.

@ramonjd
Copy link
Member

ramonjd commented Mar 30, 2022

class-wp-style-engine-gutenberg.php (Style Engine)

Thanks for pulling this together @gziolo

We merged the Style Engine class and associated tests with the intention of following up on @youknowriad's suggestion of moving it to the style-engine package directory.

I've got a WIP PR going to do this, following the example of how we copy, parse and build the block-library packages, but it's not ready yet.

If #39736 doesn't look like making the cut, there are a couple of options I see, though I'd lean on @youknowriad's expert opinion.

  1. We leave the Style Engine class and the related changes to lib/block-supports/spacing.php out of WordPress 6.0 (I am happy to take care of the revert spacing.php or whatever else needs to be done there) while we work out a decent way to include it from the packages directory.
  2. We migrate it as-is and deal with subsequent changes in a later WordPress migration.

I suppose I'd be inclined to do the former. The class doesn't bring any new functionality - it's more of a first iteration in a set of long-term changes.

@gziolo
Copy link
Member Author

gziolo commented Mar 31, 2022

  1. We leave the Style Engine class and the related changes to lib/block-supports/spacing.php out of WordPress 6.0 (I am happy to take care of the revert spacing.php or whatever else needs to be done there) while we work out a decent way to include it from the packages directory.
  2. We migrate it as-is and deal with subsequent changes in a later WordPress migration.

Are there any functional changes for block supports introduced in WordPress 6.0 release cycle that need to be included? Maybe we can simply postpone backporting those refactoring until the Style Engine has a stable API. Option (2) doesn't seem like an appealing idea from the WordPress core perspective because we will have to support the current implementation even when the API changes completely. Unless you are sure that the public API of the class is going to stay like this.

@hellofromtonya
Copy link
Contributor

Trac ticket 55505 is now opened for the @wordpress package updates and backporting the PHP changes to Core.

@ramonjd
Copy link
Member

ramonjd commented Mar 31, 2022

The last major update that I'm aware of was Block Supports: Allow skipping serialization of individual features #36293, which affected all block supports files.

@aaronrobertshaw do you see these changes as required for WordPress 6.0?

Maybe we can simply postpone backporting those refactoring until the Style Engine has a stable API.

Agree. What can I do to help here?

Do you need me to roll back the plugin integration of the Style Engine from spacing.php?

I'm thinking we could also abstract the current logic that the Style Engine replaces (and will replace) to make this kind of swapping in and swapping out easier.

@aaronrobertshaw
Copy link
Contributor

The last major update that I'm aware of was #36293, which affected all block supports files.

@aaronrobertshaw do you see these changes as required for WordPress 6.0?

I'm not sure where to draw the line here. #36293 does give us much greater flexibility in applying block supports and fixes some oversights in existing supports that missed allowing skipping serialization.

It was also required for us to neatly re-adopt text-decoration support for the navigation block.

@gziolo
Copy link
Member Author

gziolo commented Apr 1, 2022

In the meantime, I opened #39972 trying the remaining files living in the lib folder. I want to move them to proper subfolders so we exactly know whether they are still experimental, they were shipped in WordPress 5.9 or they should be backported to WordPress core as part of the 6.0 major release.

@gziolo gziolo added [Status] In Progress Tracking issues with work in progress [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. labels Apr 1, 2022
@oandregal
Copy link
Member

class-wp-theme-json-resolver-gutenberg.php

I'm not sure about the changes for the webfonts (get_theme_data) but we're adding some other changes for translating the style variations to that file (see) which should go in WordPress 6.0.

@ramonjd
Copy link
Member

ramonjd commented Apr 4, 2022

I've added a backport PR for block supports spacing.php and utils.php over at WordPress/wordpress-develop#2500 and put my name against it.

Includes the latest changes, that is allowing skipping serialization of individual properties, but removes the reference to the Style Engine. It's very minimal.

If I get time I can add migrations to border, color, dimensions, elements and typography and associated tests to that PR, since all rely on the new utils.php anyway. They seem to be all related and fairly straightforward.

I'd do layout.php separately as it contains a lot more changes.

@youknowriad
Copy link
Contributor

I've opened this WordPress/wordpress-develop#2503 to backport the "global styles variations" related tests. This includes some parts of the theme.json class changes and some parts of the global styles controller changes as well.

@adamziel
Copy link
Contributor

adamziel commented Apr 4, 2022

I've combed through the files that didn't come up in the discussion and don't have anyone assigned in the issue description above. If your name or PR is on the list below, please reply with:

  1. Do you want to include these changes in WordPress 6.0?
  2. Do you have the availability to prepare a backport PR for wordpress-develop?

lib/block-supports

lib/compat/wordpress-6.0

@ramonjd
Copy link
Member

ramonjd commented Apr 4, 2022

typography.php, changed in
Block Supports: Allow skipping serialization of individual features #36293
cc @aaronrobertshaw @andrewserong @ramonjd

For the "Allow skipping serialization of individual features" feature, I've pulled across most of the related changes for lib/block-supports in WordPress/wordpress-develop#2500

@aaronrobertshaw might want to take a look to confirm if things look okay 🙇

Layout is notably absent on that PR as it involves changes beyond #36293 that need auditing.

Edit: Just to clarify, I'll be adding the layout.php migration to WordPress/wordpress-develop#2500 separately as it requires singular attention (it's a bigger diff). So it'll still be in that PR.

@ajlende
Copy link
Contributor

ajlende commented Apr 5, 2022

  1. Do you want to include these changes in WordPress 6.0?
  2. Do you have the availability to prepare a backport PR for wordpress-develop?

Yes and yes. I can make some time for opening a PR to backport duotone.php tomorrow.

@Mamaduka
Copy link
Member

Mamaduka commented Apr 5, 2022

@ajlende, I think we backported those into a minor release, so they should be already in the WP trunk. At least the items I see on that list. But I would recommend double-checking, just in case :)

@Mamaduka
Copy link
Member

Mamaduka commented Apr 5, 2022

I created PR to backport Post Lock fixes - WordPress/wordpress-develop#2508.

@gziolo
Copy link
Member Author

gziolo commented Apr 5, 2022

I created PR to backport Post Lock fixes - WordPress/wordpress-develop#2508.

Backported with https://core.trac.wordpress.org/changeset/53070.

@scruffian
Copy link
Contributor

I've created a PR for the files listed against my name above (and a few extra connected changes)
WordPress/wordpress-develop#2534

@gziolo
Copy link
Member Author

gziolo commented Apr 8, 2022

We still need to backport code that was moved to lib/compat/wordpress-6.0/blocks.php in #40179 and introduced in #36176 by @aristath:

  • wp_enqueue_block_view_script function
  • gutenberg_block_type_metadata_multiple_view_scripts filter's callback

@gziolo
Copy link
Member Author

gziolo commented Apr 8, 2022

We will also have to backport code that is about to be moved to lib/compat/wordpress-6.0/blocks.php in #40186:

  • build_comment_query_vars_from_block function
  • get_comments_pagination_arrow function
  • gutenberg_extend_block_editor_settings_with_discussion_settings filter's callback
  • gutenberg_rest_comment_set_children_as_embeddable filter's callback
  • class-block-library-comment-template-test.php unit test

pento pushed a commit to WordPress/wordpress-develop that referenced this issue Apr 11, 2022
This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: WordPress/gutenberg#39889.

Props scruffian, timothyblynjacobs, oandregal, ajlende, zieleadam.
See #55505.



git-svn-id: https://develop.svn.wordpress.org/trunk@53129 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this issue Apr 11, 2022
This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: WordPress/gutenberg#39889.

Props scruffian, timothyblynjacobs, oandregal, ajlende, zieleadam.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53129


git-svn-id: https://core.svn.wordpress.org/trunk@52718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott pushed a commit to gMagicScott/core.wordpress-mirror that referenced this issue Apr 11, 2022
This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: WordPress/gutenberg#39889.

Props scruffian, timothyblynjacobs, oandregal, ajlende, zieleadam.
See #55505.


Built from https://develop.svn.wordpress.org/trunk@53129


git-svn-id: https://core.svn.wordpress.org/trunk@52718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@oandregal
Copy link
Member

lib/compat/wordpress-6.0/block-editor-settings.php | Assigned @oandregal

I've marked this as done as all changes are part of 5.9 or 6.0.

I'm creating a bugfix that modifies this code for something I ran into but can be done after the beta1. For reference, WordPress/wordpress-develop#2542 and #40185

@oandregal
Copy link
Member

#36327 by @oandregal – it seems to be affecting the part that wasn't backported to 5.9. @oandregal, do you want it to be backported to 6.0?

This PR is trying to adapt from the changes in core. No need to backport.

#31762 and not previously backported. @oandregal, is it fine to skip this one, or do you think this entire segment needs to be backported?

Yeah, no need to backport this one. It's only relevant in relation to a REST endpoint that mobile uses that is yet experimental (see).

@oandregal
Copy link
Member

#39543 by @scruffian

This is also not to be backported. It's code only relevant for Gutenberg.

github-actions bot pushed a commit to gilzow/wordpress-performance that referenced this issue Apr 12, 2022
Related Gutenberg issue: WordPress/gutenberg#39889.

Backporting changes from the Gutenberg plugin:
- new Block Patterns REST API endpoint
- new Block Pattern Categories REST API endpoint
- updates to Query Loop related patterns
- support for custom taxonomies in Query Loop block

Props hellofromtonya, peterwilsoncc, ntsekouras, zieladam, ironprogrammer, spacedmonkey, timothyblynjacobs, antonvlasenko, jsnajdr.
See #55505.



Built from https://develop.svn.wordpress.org/trunk@53152


git-svn-id: https://core.svn.wordpress.org/trunk@52741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
markjaquith pushed a commit to markjaquith/WordPress that referenced this issue Apr 12, 2022
Related Gutenberg issue: WordPress/gutenberg#39889.

Backporting changes from the Gutenberg plugin:
- new Block Patterns REST API endpoint
- new Block Pattern Categories REST API endpoint
- updates to Query Loop related patterns
- support for custom taxonomies in Query Loop block

Props hellofromtonya, peterwilsoncc, ntsekouras, zieladam, ironprogrammer, spacedmonkey, timothyblynjacobs, antonvlasenko, jsnajdr.
See #55505.



Built from https://develop.svn.wordpress.org/trunk@53152


git-svn-id: https://core.svn.wordpress.org/trunk@52741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
adamziel pushed a commit to adamziel/wordpress-develop that referenced this issue Apr 12, 2022
Related Gutenberg issue: WordPress/gutenberg#39889.

Backporting changes from the Gutenberg plugin:
- new Block Patterns REST API endpoint
- new Block Pattern Categories REST API endpoint
- updates to Query Loop related patterns
- support for custom taxonomies in Query Loop block

Props hellofromtonya, peterwilsoncc, ntsekouras, zieladam, ironprogrammer, spacedmonkey, timothyblynjacobs, antonvlasenko, jsnajdr.
See #55505.




git-svn-id: https://develop.svn.wordpress.org/trunk@53152 602fd350-edb4-49c9-b593-d223f7449a82
@adamziel
Copy link
Contributor

adamziel commented Apr 13, 2022

  • wp_enqueue_block_view_script function
  • gutenberg_block_type_metadata_multiple_view_scripts filter's callback

@gziolo Is this the last missing backport as of today? 🎉

Edit: Two more:

@gziolo
Copy link
Member Author

gziolo commented Apr 13, 2022

  • wp_enqueue_block_view_script function
  • gutenberg_block_type_metadata_multiple_view_scripts filter's callback

Let’s move that to WordPress 6.1. It’s a nice improvement for plugin/block developers but let’s not rush it since we didn’t prepare necessary backports on time. I will move code and update docs in Gutenberg to reflect this.

I’m watching progress on both linked PRs and I will land them when they get approved by reviewers. They are being tracked in WordPress ticket: https://core.trac.wordpress.org/ticket/55567.

I think that concludes this issue 🎉

@gziolo gziolo closed this as completed Apr 13, 2022
@gziolo
Copy link
Member Author

gziolo commented Apr 13, 2022

Major props to everyone involved in the process. We wouldn’t make it in such a short time without your invaluable help 🙇‍♂️💯❤️

@gziolo gziolo removed the [Status] In Progress Tracking issues with work in progress label Apr 13, 2022
@gziolo gziolo removed the Backport to WP 6.6 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
No open projects
Archived in project
Development

No branches or pull requests