gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Plugin: Backport PHP changes for WordPress 6.1 release

Open ockham opened this issue 3 years ago β€’ 47 comments

Description

Related Trac ticket 56467.

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.1 release.

Files listed for WP 6.1

lib/block-supports

  • [x] ~border.php~ https://github.com/WordPress/wordpress-develop/pull/3204 🟒
  • [x] ~colors.php~ https://github.com/WordPress/wordpress-develop/pull/3204 🟒
  • [x] ~dimensions.php~ No changes since WP 6.0.
  • [x] ~duotone.php~ https://github.com/WordPress/wordpress-develop/pull/3210 🟒
  • [x] ~elements.php~ https://github.com/WordPress/wordpress-develop/pull/3204 🟒
  • [x] ~layout.php~ @andrewserong (ref). Blocked by https://github.com/WordPress/wordpress-develop/pull/3212 and https://github.com/WordPress/wordpress-develop/pull/2928. https://github.com/WordPress/wordpress-develop/pull/3199 https://github.com/WordPress/wordpress-develop/pull/3254 🟒
  • [x] ~spacing.php~ https://github.com/WordPress/wordpress-develop/pull/3204 🟒
  • [x] ~typography.php~ https://github.com/WordPress/wordpress-develop/pull/3203 🟒
  • [x] ~utils.php~ No changes since WP 6.0.

lib/compat/wordpress-6.1

lib/experimental

Legend:

🟒 – confirmed for WP 6.1 🟑 – needs decision πŸ”΄ – moved to future WP release

Getting Involved

If you are interested in helping with the effort, 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.1.0 documentation tag included.
  • Ensure all functionality backported to WordPress core has unit tests written.

Note that @hellofromtonya has started work to smoothen the backporting process, by adjusting Gutenberg's test and lint structure to more closely resemble Core's (to avoid having to fix code in backport PRs when they don't pass wordpress-develop's tests even though they did pass Gutenberg's): #43333


Issue modeled after #39889.

ockham avatar Aug 19 '22 16:08 ockham

I'll create a patch for changes in edit-form-blocks.php file.

The gutenberg_add_site_icon_url_to_index feature backport from rest-api.php depends if we merge #43514 or not.

@ntsekouras, correct me if I'm wrong, but the wp-theme-get-post-templates.php doesn't need to be ported into the core.

Mamaduka avatar Aug 25 '22 05:08 Mamaduka

Heads-up that I opened a PR in wordpress-develop: https://github.com/WordPress/wordpress-develop/pull/3131 which implements the same fix as #43597 in block-template-utils.php.

Related track issue: https://core.trac.wordpress.org/ticket/55881#ticket

Aljullu avatar Aug 25 '22 14:08 Aljullu

@ntsekouras, correct me if I'm wrong, but the wp-theme-get-post-templates.php doesn't need to be ported into the core.

Good catch @Mamaduka ! It seems so.

ntsekouras avatar Aug 26 '22 09:08 ntsekouras

Apologies for the mass ping -- I'd like to get the backports work off the ground 😊

tl;dr: If you've added PHP code to Gutenberg's lib/ directory since the WP 6.0 release, it will need backporting to wordpress-develop in order to be included in WP 6.1. Backporting is typically easiest for the people who originally implemented the relevant feature. Please refer to the list in the issue description and leave a comment if you're willing to backport code. If you're unfamiliar with the process of backporting, don't hesitate to ping me (@ockham) or @michalczaplinski -- we're happy to help!

PRs that are strickenthrough are already merged in WordPress Core

lib/block-supports/

  • border.php

    • #42719
    • #42140
    • #42113
    • ~~#41527~~
    • #40531
    • #37770 @ramonjd @glendaviesnz @aaronrobertshaw
  • colors.php

    • #42719
    • #42140
    • #42113
    • #40332 @ramonjd
  • dimensions.php

  • duotone.php

    • ~~#42020~~
    • ~~#39564~~ @jorgefilipecosta @ajlende
  • elements.php

    • #43103
    • #42878
    • #42452
    • #42719
    • #42140
    • #42113
    • #40987
    • #40594
    • ~~#37728~~ @ramonjd @oandregal @scruffian
  • layout.php

    • #43103
    • #43052
    • #42970
    • #42939
    • #42878
    • #42452
    • ~~#42544~~
    • #42719
    • ~~#42085~~
    • ~~#40875~~
    • #41306
    • #41885
    • #41487
    • #41098
    • #41018 @ramonjd @aristath @matiasbenedetto @andrewserong @tellthemachines @youknowriad @glendaviesnz
  • spacing.php

    • #42719
    • #42140
    • #42113
    • ~~#41527~~
    • #40332 @ramonjd @glendaviesnz
  • typography.php

    • #42757
    • #42719
    • #42688
    • ~~#39529~~
    • #42140
    • #42113
    • #40332 @ramonjd
  • utils.php

lib/compat/wordpress-6.1/

lib/experimental/


List modeled after https://github.com/WordPress/gutenberg/issues/39889#issuecomment-1087604073. Created using the script from #43360.

ockham avatar Aug 26 '22 12:08 ockham

I can take care of all the spacing size preset related changes.

glendaviesnz avatar Aug 29 '22 06:08 glendaviesnz

@ockham, @michalczaplinski, do we have a core tracking ticket to reference in Core PRs?

Mamaduka avatar Aug 30 '22 13:08 Mamaduka

@ockham, @michalczaplinski, do we have a core tracking ticket to reference in Core PRs?

@Mamaduka Ah, we didn't -- my apologies! I've filed one now: https://core.trac.wordpress.org/ticket/56467

ockham avatar Aug 30 '22 17:08 ockham

I'm happy to help out with Layout backports. I'm travelling at the moment but can start looking at some of them next week when I'm back. Some of them might have a couple of challenges β€” layout.php currently depends on the style engine work in the style engine package (so just CCing @ramonjd there), which might need to land first?

Also, I was wondering how we deal with PHP changes that require JS changes to be shipped at the same time? I think some of the Layout work might need to happen all at once πŸ€”. There's definitely pieces that can be done in separate PRs first, though, so I'll give it a bit more thought to see what sort of order might work.

Just linking a couple of other pre-requisites for Layout in Gutenberg being merged to core:

  • Trac ticket 55966, which adds in support for additional CSS functions to safecss_filter_attr (like clamp)
  • Core PR (https://github.com/WordPress/wordpress-develop/pull/2928) to add in layout related CSS properties to safe_style_css_filter

I believe the above two tickets/PRs will need to land prior to the layout.php changes being backported.

andrewserong avatar Aug 30 '22 21:08 andrewserong

@ockham,

My backport PRs are ready:

  • https://github.com/WordPress/wordpress-develop/pull/3156
  • https://github.com/WordPress/wordpress-develop/pull/3157

The https://github.com/WordPress/gutenberg/pull/40416 should already be in Core, cherry-picked for a minor release - https://github.com/WordPress/wordpress-develop/pull/2600.

I've only done a minor code quality work for class-wp-theme-json-6-1.php, but happy to help as needed.

Mamaduka avatar Aug 31 '22 06:08 Mamaduka

Small update: In https://github.com/WordPress/wordpress-develop/pull/3154, I'm attempting a package sync to update Core to the latest package versions -- mostly as a dry-run for Beta 1. (I would like to actually merge it once its ready -- see its PR desc for context).

In order to unblock that PR, I've filed a small backport PR to add the $priority param to wp_enqueue_block_support_styles.

ockham avatar Aug 31 '22 08:08 ockham

In order to unblock that PR, I've filed a small backport PR to add the $priority param to wp_enqueue_block_support_styles.

In addition to that, we need to refactor all occurrences of WP_Theme_JSON_Gutenberg and gutenberg_enqueue_block_support_styles in core blocks in the Gutenberg plugin. That might not be trivial as the plugin still supports WordPress 6.0 and 6.1 where some functionality is missing.

gziolo avatar Aug 31 '22 10:08 gziolo

In order to unblock that PR, I've filed a small backport PR to add the $priority param to wp_enqueue_block_support_styles.

In addition to that, we need to refactor all occurrences of WP_Theme_JSON_Gutenberg and gutenberg_enqueue_block_support_styles in core blocks in the Gutenberg plugin. That might not be trivial as the plugin still supports WordPress 6.0 and 6.1 where some functionality is missing.

Good point. Here's one approach for gutenberg_enqueue_block_support_styles: https://github.com/WordPress/gutenberg/pull/43779.

ockham avatar Sep 01 '22 13:09 ockham

Thanks for the nice listβ€”that's a cool script! I've backported https://github.com/WordPress/gutenberg/pull/41648 (in r54079) and checked it off the list in the description.

noisysocks avatar Sep 06 '22 01:09 noisysocks

I'm working on prepping packages/style-engine for inclusion in core.

WIP here: https://github.com/WordPress/wordpress-develop/pull/3199

This will unblock most of the lib/block-supports migrations given that they're using style engine methods.

It requires https://core.trac.wordpress.org/ticket/55966, otherwise I'll need to migrate gutenberg_safecss_filter_attr_allow_css_6_1 to core to make the Style Engine work. 😱

ramonjd avatar Sep 06 '22 04:09 ramonjd

It requires https://core.trac.wordpress.org/ticket/55966, otherwise I'll need to migrate gutenberg_safecss_filter_attr_allow_css_6_1 to core to make the Style Engine work. 😱

I've asked in #core for someone to merge 55966's patch πŸ™‚

ockham avatar Sep 06 '22 10:09 ockham

As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files 😊

@ntsekouras -- Could you file a backport PR for the changes you made to block-template-utils.php and class-gutenberg-rest-templates-controller.php? πŸ™

ockham avatar Sep 06 '22 13:09 ockham

As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files 😊

@jorgefilipecosta -- Could you maybe file a backport PR for https://github.com/WordPress/gutenberg/pull/41791 (affecting block-patterns.php, class-gutenberg-rest-block-patterns-controller.php, and rest-api.php)? πŸ™

ockham avatar Sep 06 '22 13:09 ockham

As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files 😊

@jorgefilipecosta -- Could you maybe file a backport PR for #41791 (affecting block-patterns.php, class-gutenberg-rest-block-patterns-controller.php, and rest-api.php)? πŸ™

Sure πŸ‘

jorgefilipecosta avatar Sep 06 '22 16:09 jorgefilipecosta

As the Feature Freeze is only two weeks away, I'll start pinging some folks who I know have good domain knowledge of certain areas and can help backporting some files 😊

@oandregal -- Could you maybe file a backport PR for #25892 (Quote v2)? πŸ™

ockham avatar Sep 06 '22 16:09 ockham

I'm taking a look at persisted preferences.

talldan avatar Sep 07 '22 06:09 talldan

I'm working on backporting the changes and additions to the Elements API here. The PR has a list of the PRs I'm backporting, the class-wp-theme-json-6-1.php file has other changes unrelated to elements that I won't be adding to said PR, this is the list of the PRs it's NOT going to include:

https://github.com/WordPress/gutenberg/pull/41217 https://github.com/WordPress/gutenberg/pull/41335 https://github.com/WordPress/gutenberg/pull/41527 https://github.com/WordPress/gutenberg/pull/40875 https://github.com/WordPress/gutenberg/pull/42087 https://github.com/WordPress/gutenberg/pull/42085 https://github.com/WordPress/gutenberg/pull/39529 https://github.com/WordPress/gutenberg/pull/42665 https://github.com/WordPress/gutenberg/pull/42544 https://github.com/WordPress/gutenberg/pull/43101 https://github.com/WordPress/gutenberg/pull/43105

MaggieCabrera avatar Sep 07 '22 07:09 MaggieCabrera

  • duotone.php
    • https://github.com/WordPress/gutenberg/pull/42020
    • https://github.com/WordPress/gutenberg/pull/39564
  • class-wp-theme-json-6-1.php
    • https://github.com/WordPress/gutenberg/pull/41335

I'm working on the duotone backports

EDIT: duotone.php is done in https://github.com/WordPress/wordpress-develop/pull/3210 and I've talked with @MaggieCabrera for the class-wp-theme-json-6-1.php changes because they depend on the Elements API backports.

ajlende avatar Sep 07 '22 16:09 ajlende

:wave: sorry for the late response. I've looked at the pings but nothing needs backporting on my side:

  • elements.php
  • block-editor-settings.php
  • lib/experimental/block-editor-settings-mobile.php#L18
    • we should not backport this until mobile confirms the endpoint goes to core, see context. cc @geriux
  • the bits for list v2 have been removed

oandregal avatar Sep 08 '22 11:09 oandregal

@ntsekouras -- Could you file a backport PR for the changes you made to block-template-utils.php and class-gutenberg-rest-templates-controller.php? πŸ™

I'll look at it, but we probably need to wait @jorgefilipecosta for a PR that updates some related logic there.

ntsekouras avatar Sep 08 '22 12:09 ntsekouras

  • https://github.com/WordPress/gutenberg/pull/41302 @ntsekouras

PR: https://github.com/WordPress/wordpress-develop/pull/3214

ntsekouras avatar Sep 08 '22 13:09 ntsekouras

I will take a look at:

  • https://github.com/WordPress/gutenberg/pull/41981
  • https://github.com/WordPress/gutenberg/pull/41140
  • https://github.com/WordPress/gutenberg/pull/41240

Backported in https://github.com/WordPress/wordpress-develop/pull/3215

cbravobernal avatar Sep 08 '22 13:09 cbravobernal

Heads up that I think https://github.com/WordPress/wordpress-develop/pull/3199 (Style engine backport) is baked and ready to land. Thanks to @costdev for helping to prepare.

ramonjd avatar Sep 09 '22 02:09 ramonjd

This wordpress-develop PR backports the following changes:

  • https://github.com/WordPress/gutenberg/pull/42880

ramonjd avatar Sep 09 '22 03:09 ramonjd

PR here for persisted preferences - https://github.com/WordPress/wordpress-develop/pull/3219.

talldan avatar Sep 09 '22 04:09 talldan

I believe the above two tickets/PRs will need to land prior to the layout.php changes being backported.

@andrewserong , those PR seems to be already merged. I guess we can keep going with layout.php. Thanks!!

cbravobernal avatar Sep 09 '22 08:09 cbravobernal