Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 3 months ago

#55505 closed task (blessed) (fixed)

Update @wordpress packages and backport changes from Gutenberg plugin into Core

Reported by: hellofromtonya's profile hellofromTonya Owned by: gziolo's profile gziolo
Milestone: 6.0 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

  • Update @wordpress packages with packages published from Gutenberg.
  • Backport PHP changes from Gutenberg's lib/compat/wordpress-6.0/ files.

Change History (134)

This ticket was mentioned in PR #2488 on WordPress/wordpress-develop by hellofromtonya.


2 years ago
#1

  • Keywords has-patch added

Backports the block pattern changes from Gutenberg for Core 6.0:

Also being tracked in this Gutenberg issue.

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

gziolo commented on PR #2488:


2 years ago
#2

@ntsekouras can you help with backporting this functionality?

gziolo commented on PR #2488:


2 years ago
#3

I also see files listed in the description that @jsnajdr added, so let's keep him in the loop.

ntsekouras commented on PR #2488:


2 years ago
#4

@ntsekouras can you help with backporting this functionality?

Looking now. Thanks for the ping!

This ticket was mentioned in PR #2503 on WordPress/wordpress-develop by youknowriad.


2 years ago
#5

  • Keywords has-unit-tests added

This PR backports the global styles variations endpoint changes from the Gutenberg plugin.

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

ntsekouras commented on PR #2488:


2 years ago
#6

The sanitization fixes have been merged in GB, so we should update this PR with the changes from that one.

This ticket was mentioned in PR #2500 on WordPress/wordpress-develop by ramonjd.


2 years ago
#7

🚧 Adding this diff pending discussion. Trac ticket to come.

Gutenberg plugin migration to WordPress 6.0 also being tracked in https://github.com/WordPress/gutenberg/issues/39889.

This diff migrates block support spacing, border, color, dimensions, elements and typography and associated tests from Gutenberg 12.9.0 to WordPress 6.0

The goal is to include the latest plugin, while skipping the Style Engine integration, which only features in spacing.php. The Style Engine class doesn't bring any new functionality - it's more of a first iteration in a set of long-term changes.

In summary:

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

gziolo commented on PR #2500:


2 years ago
#8

We already have a Trac ticket https://core.trac.wordpress.org/ticket/55505 that @hellofromtonya opened for all backporting necessary for the Gutenberg plugin.

gziolo commented on PR #2503:


2 years ago
#9

@oandregal and @jorgefilipecosta, we would appreciate your help here.

youknowriad commented on PR #2503:


2 years ago
#10

I think I managed to fix the tests, let's see what CI says.

hellofromtonya commented on PR #2488:


2 years ago
#11

The sanitization https://github.com/WordPress/gutenberg/pull/39970 in GB, so we should update this PR with the changes from that one.

Thanks! I'll grab those changes and apply them to this PR .. shortly.

oandregal commented on PR #2503:


2 years ago
#12

@youknowriad it looks like the only failing test is WP_Test_REST_Schema_Initialization::test_expected_routes_in_schema, which is missing one of the global styles routes.

youknowriad commented on PR #2503:


2 years ago
#13

I guess we need to regenerate that REST API fixtures file, I forgot how to do that. I can the entry manually though.

oandregal commented on PR #2503:


2 years ago
#14

This is working as expected for me.

This is what I've done to test:

Created a styles folder within src/wp-content/themes/twentytwentytwo with two files.

bluish.json whose content was:

{{{json
{

"version": 2,
"title": "Blue style",
"styles": {

"color": {

"background": "blue",
"text": "white"

}

},
"settings": {

"color": {

"palette": [

{ "slug": "blue", "name": "Blue", "color": "blue" }

]

}

}

}
}}}

redish.json whose content was:

{{{json
{

"version": 2,
"title": "Red style",
"styles": {

"color": {

"background": "red",
"text": "white"

}

},
"settings": {

"color": {

"palette": [

{ "slug": "red", "name": "Red", "color": "red" }

]

}

}

}
}}}

Then, I opened the site editor and, in the console, executed this command: wp.apiFetch({path: '/wp/v2/global-styles/themes/twentytwentytwo/variations', method: 'GET'}). Once the request is resolved I saw the content of the style variations.

I've also tested with the existing TwentyTwentyTwo theme with no styles folder and also works fine (the endpoint returns 0 style variations).

aaronrobertshaw commented on PR #2500:


2 years ago
#15

The block support serialization changes included in this PR so far (all except layout.php) look good and cover those introduced in https://github.com/WordPress/gutenberg/pull/36293.

I'm happy to review again once the layout.php updates are also added.

gziolo commented on PR #2500:


2 years ago
#16

I'm happy to review again once the layout.php updates are also added.

This patch looks big already. Can we land that part separately? I could do some additional review pass in 1-2 hours and commit changes if no blockers discovered.

youknowriad commented on PR #2503:


2 years ago
#17

@gziolo Should I go ahead and commit this one?

gziolo commented on PR #2503:


2 years ago
#18

@gziolo Should I go ahead and commit this one?

That would be fantastic, thank you 🙇🏻

#19 @youknowriad
2 years ago

In 53072:

Block Editor: Backport the Global Styles Variations endpoint.

This include the /global-styles/themes/{theme}/variations rest endpoint into core.
The endpoint will be used by the site editor to display alternative theme styles to the user.

Props gziolo, oandregal.
See #55505.

This ticket was mentioned in PR #2516 on WordPress/wordpress-develop by youknowriad.


2 years ago
#21

I compared the global styles controller between Gutenberg and Core, and there's just this small difference that's left.

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

This ticket was mentioned in PR #2518 on WordPress/wordpress-develop by ramonjd.


2 years ago
#22

⚠️ Depends on Trac ticket: https://core.trac.wordpress.org/ticket/55505 which includes the lib/block-supports/utils.php file and the wp_should_skip_block_supports_serialization() function.

Gutenberg plugin migration to WordPress 6.0 also being tracked in https://github.com/WordPress/gutenberg/issues/39889.

This diff migrates block support layout (lib/block-supports/layout.php) from Gutenberg 13 to WordPress 6.0.

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

ramonjd commented on PR #2500:


2 years ago
#23

This patch looks big already. Can we land that part separately? I could do some additional review pass in 1-2 hours and commit changes if no blockers discovered.

Layout over here: https://github.com/WordPress/wordpress-develop/pull/2518

#24 @youknowriad
2 years ago

In 53075:

Block Editor: Synchronize global styles endpoint code with Gutenberg.

This adds a missing fallback to ensure styles property is always defined in the returned data.

Props gziolo.
See #55505.

youknowriad commented on PR #2516:


2 years ago
#25

Committed

#26 @gziolo
2 years ago

In 53076:

Editor: Backport block support changes from the Gutenberg plugin

Migrate spacing, border, color, dimensions, elements and typography and associated tests for block supports in the block editor.

Related changes in Gutenberg:

Props ramonopoly, aaronrobertshaw.
See #55505.

gziolo commented on PR #2518:


2 years ago
#28

wp_should_skip_block_supports_serialization() is already present in WordPress core. Do we have any unit tests that cover the updated functionality?

youknowriad commented on PR #2518:


2 years ago
#29

We do have unit tests that cover the image block related filter. They were added here https://github.com/WordPress/gutenberg/pull/39330

ramonjd commented on PR #2518:


2 years ago
#30

We do have unit tests that cover the image block related filter. They were added here https://github.com/WordPress/gutenberg/pull/39330

Thanks for the tip off. I will pull the tests over in this PR 🙇

This ticket was mentioned in PR #2522 on WordPress/wordpress-develop by ramonjd.


2 years ago
#31

In https://github.com/WordPress/wordpress-develop/pull/2500 we deleted private block supports functions that are no longer used in WordPress 6.0.0.

This PR reinstates them and add deprecation notices as recommended by @peterwilsoncc over in https://github.com/WordPress/wordpress-develop/pull/2500#discussion_r843356361

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

peterwilsoncc commented on PR #2522:


2 years ago
#32

@ramonjd Are you able to move these to src/wp-includes/deprecated.php?

If there are replacement functions, then you can add the new function name as a third parameter to _deprecated_function().

ramonjd commented on PR #2522:


2 years ago
#33

Are you able to move these to src/wp-includes/deprecated.php?

Yes! Will do. Thanks for letting me know. I wasn't aware of that directory.

peterwilsoncc commented on PR #2488:


2 years ago
#34

Code changes look good pending fixes to the tests.

Let's keep the existing blocks in the test suite (ie with tagId, etc) and modify the expected result. The new format can go in as additional tests.

(I say this in the full knowledge it might be part of your own plan)

#35 @peterwilsoncc
2 years ago

In 53082:

Editor: Soft deprecate block supports functions.

Reinstate the functions hard deprecated in [53076]: wp_skip_border_serialization(), wp_skip_dimensions_serialization() and wp_skip_spacing_serialization().

Props ramonopoly.
See #55505.

gziolo commented on PR #2522:


2 years ago
#37

Thank you @peterwilsoncc and @ramonjd for a quick follow-up on that ❤️

gziolo commented on PR #2518:


2 years ago
#38

I refactored one of the tests to use the data provider and included code comments in 293a355.

#39 @gziolo
2 years ago

In 53085:

Editor: Update layout handling for block supports

Backports changes applied in the Gutenberg plugin planned for WordPress 6.0 release. See https://github.com/WordPress/gutenberg/issues/39889.

Props ramonopoly, youknowriad.
See #55505.

This ticket was mentioned in PR #2523 on WordPress/wordpress-develop by adamziel.


2 years ago
#41

Gutenberg plugin migration to WordPress 6.0 also being tracked in https://github.com/WordPress/gutenberg/issues/39889.

This diff moves the localAutosaveInterval editor setting to the preference store introduced in Gutenberg 12.9.0 to WordPress 6.0

Original Pull Request: https://github.com/WordPress/gutenberg/pull/39180

In summary:

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

cc @talldan @noisysocks @michalczaplinski who worked on the original Gutenberg PR

hellofromtonya commented on PR #2488:


2 years ago
#42

This PR captures block patterns and adding custom taxonomies filtering as changes are intermingled in the files. See the list of files backported in the description.

@ntsekouras @ironprogrammer Can you double-check that all changes from the files listed are included in this PR please? Some of the changes "seemed" specific to the Gutenberg plugin; so I didn't include them.

Tests are failing. I'll fix those once confirmed that all changes to be backported from those files are here in this PR.

anton-vlasenko commented on PR #2500:


2 years ago
#43

Please disregard my code review as I haven't noticed that the task is closed 🤦

ironprogrammer commented on PR #2488:


2 years ago
#44

In response to @hellofromtonya:

...Some of the changes "seemed" specific to the Gutenberg plugin; so I didn't include them.

I concur that lib/compat/wordpress-6.0/block-patterns-update.php applies to Gutenberg only.

Tests are failing. I'll fix those once confirmed that all changes to be backported from those files are here in this PR.

Tests needed the new routes to be registered. Please see PR 3 above, which includes updates that get those working. Please review the amendments and feel free to slurp into your PR any changes you agree with.

Please note that for lack of spelunking time today, I did not address the failure for Tests_REST_WpRestBlockPatternsController::test_get_items. It appears the class-level fixture used to clear the Patterns Registry is getting appended to with additional patterns prior to the unit test, which is causing the failure.

This ticket was mentioned in PR #2529 on WordPress/wordpress-develop by Mamaduka.


2 years ago
#45

Backports change from Gutenberg to support server-side home template resolution in the Site Editor.

Original PR https://github.com/WordPress/gutenberg/pull/38817

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

#46 @gziolo
2 years ago

In 53090:

Editor: Add localAutosaveInterval preference to editor settings

Backports changes from the Gutenberg plugin. Original PR in Gutenberg: https://github.com/WordPress/gutenberg/pull/39180.

Props zieleadam, talldanwp.
See #55505.

adamziel commented on PR #2488:


2 years ago
#48

I left some notes, but other than what's already been said – it looks pretty solid. Thank you @hellofromtonya !

adamziel commented on PR #2488:


2 years ago
#49

I left some notes, but other than what's already been said – it looks pretty solid. Thank you @hellofromtonya !

anton-vlasenko commented on PR #2500:


2 years ago
#50

Please disregard my code review as I haven't noticed that the PR is closed 🤦

This ticket was mentioned in PR #2531 on WordPress/wordpress-develop by jsnajdr.


2 years ago
#51

Changes the REST endpoints that get preloaded when displaying a page for post, site and widgets editor, so that they are in sync with what the latest version of Gutenberg to be shipped with Core 6.0 really requests.

This patch finished backport of the `gutenberg_optimize_preload_paths` filter in Gutenberg, and that filter can be removed after this is merged. Trac ticket: https://core.trac.wordpress.org/ticket/55505

Post Editor
The types and taxonomies requests have context changed from edit to view, because these requests were modified in https://github.com/WordPress/gutenberg/pull/37685.

Adding two new preloads: list of reusable blocks (wp_block post type, loaded from /wp/v2/blocks) and permissions for creating pages (OPTIONS /wp/v2/pages). Both requests are made in the useBlockEditorSettings hook, at the top of the post editor React tree.

Site Editor
Like in Post Editor, modify the types request context from edit to view.

The taxonomies preload, together with four other ones, can be removed because the Site Editor doesn't request that data.

Site Editor also doesn't need to preload /wp/v2/settings. These are used only in specialized blocks like Site Title, and by the useTitle hook which is by no means on critical path.

Widgets Editor
Adds a preload for the /wp/v2/widget-types endpoint requested by the registerLegacyWidgetVariations called during initialization.

#52 @gziolo
2 years ago

In 53093:

Site Editor: Resolve homepage template on server-side

Backports change from Gutenberg to support server-side home template resolution in the Site Editor. Original PR https://github.com/WordPress/gutenberg/pull/38817.

Props Mamaduka.
See #55505.

This ticket was mentioned in PR #2533 on WordPress/wordpress-develop by jsnajdr.


2 years ago
#54

Stops loading remote patterns on the post editor and site editor pages. The only place to load remote patterns is going to be the /wp/v2/block-patterns/patterns REST endpoint handler.

This patch does backport of the gutenberg_disable_load_remote_patterns filter in Gutenberg, and that filter can be removed after this is merged.

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

#55 @gziolo
2 years ago

In 53094:

Editor: Update preload paths for post, site and widgets editors

Changes the REST endpoints that get preloaded when displaying a page for post, site and widgets editor, so that they are in sync with what the latest version of Gutenberg to be shipped with Core 6.0 really requests.

Props jsnajdr.
See #55505.

gziolo commented on PR #2533:


2 years ago
#57

Should we also deprecate both methods? They are no longer used in WordPress core with the changes proposed.

/cc @peterwilsoncc and @hellofromtonya

#58 @gziolo
2 years ago

In 53095:

Editor: Remove loading remote patterns from editor pages

Stops loading remote patterns on the post editor and site editor pages. The only place to load remote patterns is going to be the /wp/v2/block-patterns/patterns REST endpoint handler.

Props jsnajdr.
See #55505.

jsnajdr commented on PR #2533:


2 years ago
#60

Should we also deprecate both methods? They are no longer used in WordPress core with the changes proposed.

They will be both called again once https://github.com/WordPress/wordpress-develop/pull/2488 is merged, because one of the backported REST endpoint calls them when served.

gziolo commented on PR #2533:


2 years ago
#61

Should we also deprecate both methods? They are no longer used in WordPress core with the changes proposed.

They will be both called again once #2488 is merged, because one of the backported REST endpoint calls them when served.

Thank you for the clarification and help with all backports. Sounds great 👍🏻

I committed changes with https://core.trac.wordpress.org/changeset/53095.

spacedmonkey commented on PR #2488:


2 years ago
#62

As this contains REST API, someone ( including me ) for the REST API maintainer team should really review this before it get merged into core.

This ticket was mentioned in PR #2534 on WordPress/wordpress-develop by scruffian.


2 years ago
#63

Part of https://github.com/WordPress/gutenberg/issues/39889

This bring across changes to theme export functionality, and related code, and tests.

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

This ticket was mentioned in PR #2543 on WordPress/wordpress-develop by DAreRodz.


2 years ago
#64

Backport changes from Gutenberg to add functions required by Comment Query Loop and related blocks.

From `/lib/compat/wordpress-6.0/blocks.php`:

  • [x] build_comment_query_vars_from_block function
  • [x] get_comments_pagination_arrow function
  • [x] gutenberg_extend_block_editor_settings_with_discussion_settings filter's callback
  • [x] gutenberg_rest_comment_set_children_as_embeddable filter's callback

Tests:

  • x [class-block-library-comment-template-test.php] unit test

Also being tracked in https://github.com/WordPress/gutenberg/issues/39889.

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

DAreRodz commented on PR #2543:


2 years ago
#65

Uh, there's a missing function, I'm taking a look.

scruffian commented on PR #2534:


2 years ago
#67

add-defaultduotone-docs.patch

Thanks, I have pushed these to the PR

TimothyBJacobs commented on PR #2534:


2 years ago
#68

Left what ended up as general feedback, REST API changes look fine to me.

This ticket was mentioned in PR #2554 on WordPress/wordpress-develop by ramonjd.


2 years ago
#69

Let's add @covers annotation to block support tests for test coverage reports! 👍

Props @antonvlasenko

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

#70 @ramonopoly
2 years ago

I've added a couple of code reviews. I'm not sure where to put them since relevant PRs have already been closed.

I've added the covers annotation to block support tests for test coverage reports. Thank you!

https://github.com/WordPress/wordpress-develop/pull/2554

gziolo commented on PR #2534:


2 years ago
#71

I only wanted to mention that this patch includes also changes from https://github.com/WordPress/wordpress-develop/pull/2534 that was listed as requiring backport to WP core.

This ticket was mentioned in PR #2526 on WordPress/wordpress-develop by ajlende.


2 years ago
#72

This PR backports the defaultDuotone option changes from WordPress/gutenberg#38681 and WordPress/gutenberg#39966 in the Gutenberg plugin.

The changes didn't make it into a 5.9.x release, so are being moved in https://github.com/WordPress/gutenberg/pull/40123. Wait for that PR to land before committing these changes.

Gutenberg tracking issue: https://github.com/WordPress/gutenberg/issues/39889

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

#73 @gziolo
2 years ago

In 53128:

Tests: Improve code comments for block supports tests

Follow-up for [53085].

Props ramonopoly, antonvlasenko, peterwilsoncc.
See #55505.

#76 @gziolo
2 years ago

In 53129:

Editor: Add functionality required for theme export in the site editor

This bring across changes to theme export functionality, and related code, and tests. Relates issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/39889.

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

gziolo commented on PR #2534:


2 years ago
#77

Committed with https://core.trac.wordpress.org/changeset/53129. Thank you everyone for the collaboration on this one ❤️

#78 @gziolo
2 years ago

In 53130:

Editor: Add missing defaultDutone changes

Follow-up for [53129].

This PR backports the remaining defaultDuotone option changes added in the Gutenberg plugin. Related PRs: https://github.com/WordPress/gutenberg/pull/38681 and https://github.com/WordPress/gutenberg/pull/39966.

Props oandregal, ajlende.
See #55505.

gziolo commented on PR #2526:


2 years ago
#79

The missing changes were committed in https://core.trac.wordpress.org/changeset/53130. We needed only changes to the theme.json file. Everything else was already in the trunk as pointed out by @oandregal 💯

#80 follow-up: @gziolo
2 years ago

I've added a couple of code reviews. I'm not sure where to put them since relevant PRs have already been closed.

@antonvlasenko, this is awesome. Can you confirm if all your comments were addressed in [53128]?

#82 @gziolo
2 years ago

In 53138:

Editor: Add changes for new Comments Query Loop blocks

Backports changes from Gutenberg to add functions required by Comment Query Loop and related blocks. Related unit tests depends on the new blocks and they will get added seperately.

Props darerodz, timothyblynjacobs.
See #55505.

This ticket was mentioned in PR #2565 on WordPress/wordpress-develop by oandregal.


2 years ago
#84

Trac ticket: https://core.trac.wordpress.org/ticket/55505
Related Gutenberg PR https://github.com/WordPress/gutenberg/pull/40232

This PR increments the theme.json version in use, to signal it follows the schema to be published with WordPress 6.0.

There's no modifications or removals in the existing schema, only additions:

  • title top-level key
  • patterns top-level key
  • settings.color.defaultDuotone setting key

The behavior is the same as before, this serves to semantically mark the new files. This version change will be documented in the block editor handbook as well with a PR sent to the Gutenberg repository.

#85 @gziolo
2 years ago

In 53139:

REST API: Fix the wrong name in the comments controller

It should be embeddable not embedded.
Follow-up [53138].

Props timothyblynjacobs.
See #55505.

#86 @gziolo
2 years ago

In 53140:

Build: Enable React Fast Refresh for block development

Brings the same functionality introduced in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/28273. In effect, it brings React Fast Refresh support to WordPress core for block development with @wordpress/scripts.

Props walbo, antonvlasenko.
See #51750, #55505.
Follow-up [53135].

#87 @gziolo
2 years ago

In 53141:

Build: Bring caniuse-lite to the latest version

This ensures that build tools target the most recent version of browsers supported by WordPress.

Follow-up [53135].
See #51750, #55505.

#88 @gziolo
2 years ago

In 53142:

Editor: Update build_comment_query_vars_from_block from Gutenberg

Follow-up for [53138].
See #55505.

#89 in reply to: ↑ 80 @antonvlasenko
2 years ago

Replying to gziolo:

I've added a couple of code reviews. I'm not sure where to put them since relevant PRs have already been closed.

@antonvlasenko, this is awesome. Can you confirm if all your comments were addressed in [53128]?

Yes, I confirm it.
Thank you, @gziolo.

This ticket was mentioned in PR #2567 on WordPress/wordpress-develop by ironprogrammer.


2 years ago
#90

Continued amendments to @hellofromtonya's backports for https://github.com/WordPress/wordpress-develop/pull/2488.

This PR builds off the original PR, and addresses reviewer commentary from April 8 and onward. Please use this more recent PR going forward.

Original PR 2488:
---

Backports changes from Gutenberg to add support for custom taxonomies filtering [Block Library - Query Loop].

  • x [lib/compat/wordpress-6.0/blocks.php]
  • x [lib/compat/wordpress-6.0/block-patterns.php]
  • x [lib/compat/wordpress-6.0/block-patterns-update.php]
  • x [lib/compat/wordpress-6.0/class-wp-rest-block-pattern-categories-controller.php]
  • x [lib/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php]
  • x [lib/compat/wordpress-6.0/class-wp-rest-block-patterns-controller.php]
  • [x] phpunit/class-wp-rest-block-pattern-categories-controller-test.php
  • [x] phpunit/class-wp-rest-block-patterns-controller-test.php
  • [x] lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php WP_Theme_JSON:: get_patterns()

Also being tracked in https://github.com/WordPress/gutenberg/issues/39889.

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

ironprogrammer commented on PR #2488:


2 years ago
#91

Hi, @TimothyBJacobs and @spacedmonkey -- thank you for your feedback! 🙌🏻 Updates for this last round of comments are being addressed over at https://github.com/WordPress/wordpress-develop/pull/2567 (forked from this PR).

CC @gziolo @adamziel @anton-vlasenko @hellofromtonya

This ticket was mentioned in PR #2569 on WordPress/wordpress-develop by ramonjd.


2 years ago
#92

Hello!

Let's unregister the block in the tear_down method. The block will be unregistered even if the test fails.

See discussion: https://github.com/WordPress/wordpress-develop/pull/2500#discussion_r844275468

Props @gziolo @anton-vlasenko

Corresponding Gutenberg PR:

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

ntsekouras commented on PR #2567:


2 years ago
#93

Don't we need the updates of packages in order to test this properly? I mean the patterns fetch request is triggered through js here: https://github.com/WordPress/gutenberg/pull/39185/files#diff-278a4a275170c4215a2f4e9d5c0c6d831f9328258220a76cda04b8d9f39f01a5R71. And also in the packages we use experimental namespace for the API.

Sorry if I'm missing something, but I'm trying to figure this out and test it properly.

gziolo commented on PR #2567:


2 years ago
#94

@ntsekouras, we decided to split backport commits into as many individual pieces as possible so it's expected that some changes depend on each other. We can test everything once all backports are in place. This is also why we have 3 weeks dedicated to beta testing so we could detect integration issues and fix them.

gziolo commented on PR #2488:


2 years ago
#95

I'm still trying to find out how to go about all those backports to WordPress core. https://github.com/WordPress/wordpress-develop/pull/2567 has failing CI jobs. This branch was passing all CI checks so I consider committing it as is and re-apply all other changes as individual commits directly in WP core.

gziolo commented on PR #2488:


2 years ago
#96

I'm getting closer to have https://github.com/WordPress/wordpress-develop/pull/2567 pass all CI checks.

#97 @gziolo
2 years ago

In 53152:

REST API: Bring new endpoints for Block Patterns from Gutenberg plugin

Related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/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.

gziolo commented on PR #2567:


2 years ago
#98

Committed with https://core.trac.wordpress.org/changeset/53152. Let's address the remaing issues listed in https://github.com/WordPress/wordpress-develop/pull/2488 seperately.

gziolo commented on PR #2488:


2 years ago
#99

I committed all the changes included in https://github.com/WordPress/wordpress-develop/pull/2567 with https://core.trac.wordpress.org/changeset/53152.

We still need to address the reamining feedback listed in this PR.

#100 @gziolo
2 years ago

In 53153:

Tests: Improve test cleanup for block supports

Let's unregister the block in the tear_down method. The block will be unregistered even if the test fails.

Props ramonopoly, antonvlasenko.
See #55505.
Follow-up [53085], [53076].

gziolo commented on PR #2569:


2 years ago
#101

Committed with https://core.trac.wordpress.org/changeset/53153. Thank you for another follow-up 🙇🏻

This ticket was mentioned in PR #2576 on WordPress/wordpress-develop by anton-vlasenko.


2 years ago
#103

This PR aims to fix issue with loading remote patterns multiple times inside the WP_REST_Block_Patterns_Controller::get_items method.

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

#105 @gziolo
2 years ago

In 53154:

REST API: Use snake case convention for field names in Block Patterns

Backports the same changes applied in Gutenberg: https://github.com/WordPress/gutenberg/pull/40254.

Follow-up for [53152].

Props jsnajdr, timothyblynjacobs.
See #55505.

This ticket was mentioned in PR #2575 on WordPress/wordpress-develop by jsnajdr.


2 years ago
#107

Backport of https://github.com/WordPress/gutenberg/pull/39185, namely the part where the gutenberg_remove_block_patterns_settings filter function removes the block patterns fields from settings.

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

#108 @gziolo
2 years ago

In 53155:

Editor: Remove block patterns from server-generated settings

Backport of https://github.com/WordPress/gutenberg/pull/39185 from the Gutenberg plugin. Namely the part where the gutenberg_remove_block_patterns_settings filter function removes the block patterns fields from settings.

Props jsnajdr, zieladam.
See #55505.
Follow-up for [53152].

gziolo commented on PR #2575:


2 years ago
#109

Committed with https://core.trac.wordpress.org/changeset/53155. Thank you again 😄

This ticket was mentioned in PR #2564 on WordPress/wordpress-develop by adamziel.


2 years ago
#110

I executed npm run wp-packages-update, npx grunt copy:js and npm run build to update the block editor to the latest version based on WordPress packages published to npm.

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

gziolo commented on PR #2564:


2 years ago
#111

We still need to use svn:ignore in newly added folders with new blocks to align with the following rules in .gitignore:

/src/wp-includes/blocks/**/*.css
/src/wp-includes/blocks/**/*.js
/src/wp-includes/blocks/**/*.js.map

adamziel commented on PR #2564:


2 years ago
#112

Styles are not loading in the site editor on this branch:

https://i0.wp.com/user-images.githubusercontent.com/205419/162987970-2a761132-2177-4663-9b09-f587f04af242.png

The problem does not occur in trunk:
https://i0.wp.com/user-images.githubusercontent.com/205419/162988035-aeb477ae-bc55-487b-826d-17be1a968b9f.png

gziolo commented on PR #2564:


2 years ago
#113

Create ignorelist.txt:
{{{txt
*.js.map
*.js
*.css
}}}

Run in every new block folder:
{{{bash
svn propset svn:ignore -F ingorelist.txt .
}}}

adamziel commented on PR #2564:


2 years ago
#114

The CSS issue is due to editor.css files not being loaded in the site editor. Broken on the left, working on the right:

https://i0.wp.com/user-images.githubusercontent.com/205419/162993635-cb5cfcdd-9622-4245-a1d9-b62772855c6b.png
https://i0.wp.com/user-images.githubusercontent.com/205419/162993673-80514951-dea8-4d8f-b0a5-15df63558241.png
https://i0.wp.com/user-images.githubusercontent.com/205419/162993655-14d70147-b13a-4f7a-ab94-98c1dce63015.png

This PR doesn't change anything related to the site editor other than bumping the package version in the package.json from 3.0.27 to 4.3.1 – that must be the problem, then?

#115 @gziolo
2 years ago

  • Owner set to gziolo
  • Resolution set to fixed
  • Status changed from new to closed

In 53157:

Editor: Update WordPress packages based based on Gutenberg v13.0 RC3

This is the last step of backports from the Gutenberg plugin for WordPress 6.0 Beta 1 release. It includes all updates WordPress packages published to npm based on the Gutenberg plugin v13.0 RC3 release. This patch also includes all the necessary changes applied to core blocks. New blocks included:

  • Avatar
  • Comment Author Name
  • Comment Content
  • Comment Date
  • Comment Edit Link
  • Comment Rely Link
  • Comment Template
  • Comments Pagination
  • Comments Pagination Next
  • Comments Pagination Previous
  • Comments Query Loop
  • Home Link
  • Post Author Biography
  • Query No Results
  • Read More

See more details in https://github.com/WordPress/wordpress-develop/pull/2564.

Props zieladam, ramonopoly, ocean90.
Fixes #55505.

gziolo commented on PR #2564:


2 years ago
#116

Committed with https://core.trac.wordpress.org/changeset/53157. Awesome work @adamziel wrangling all those tricky changes. Let's tackle the issues with styles in the site editor with a new PR.

adamziel commented on PR #2564:


2 years ago
#117

The CSS issue seems to be a missing backport of https://github.com/WordPress/gutenberg/pull/37193

wordpress-develop trunk relies on __editorAssets which is exactly what the pr above replaced with __unstableResolvedAssets. cc @ellatrix

This ticket was mentioned in PR #2580 on WordPress/wordpress-develop by talldan.


2 years ago
#120

Fixes an issue introduced in https://github.com/WordPress/wordpress-develop/commit/bca9b6d9401b60dfe8fd86eeeeca68b1cad4d929.

A couple of the field names had incorrect casing which resulted in them not being returned by the REST API.

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

#121 @gziolo
2 years ago

In 53171:

REST API: Fix incorrect casing of patterns endpoint schema properties

Follow-up [53154].

Props talldanwp.
See #55505.

#123 @gziolo
2 years ago

I opened a follow-up ticket #55567 for the following WordPress 6.0 Beta and RC releases. This one loads too long and it's hard to identify tasks left.

Last edited 2 years ago by gziolo (previous) (diff)

#124 @gziolo
2 years ago

In 53172:

Tests: Add unit tests for rendering in Comment Template block

Follow-up [53138].

Props darerodz.
See #55505.

gziolo commented on PR #2543:


2 years ago
#125

I backported 3 out of 5 unit tests to WordPress core with https://core.trac.wordpress.org/changeset/53172.

I had some issues with:

  • test_rendering_comment_template
  • test_rendering_comment_template_nested

I would appreciate some help. It can be another PR if that makes it easier.

DAreRodz commented on PR #2543:


2 years ago
#130

Hey, @gziolo, sure! Let me create a new PR for that. I think it would be easier as there are some changes already integrated into trunk.

DAreRodz commented on PR #2543:


2 years ago
#131

I had some issues with:

  • test_rendering_comment_template
  • test_rendering_comment_template_nested

The problem was using

{{{php
render_block_core_comment_template( null, null, $block )
}}}

instead of

{{{php
$block->render()
}}}

in the failing tests.

The second call does (almost) the same thing, but also updates WP_Block_Supports::$block_to_render, which should be not null when get_block_wrapper_attributes() is called. So, I guess render_block_core_comment_template() is not meant to be called directly.

The first call works in Gutenberg, though; I don't know why. 🤷

I've created a new PR here with the test fixes: https://github.com/WordPress/wordpress-develop/pull/2613. I can close this one if you feel so. ☺️

cc: @gziolo

gziolo commented on PR #2543:


2 years ago
#132

I've created a new PR here with the test fixes: https://github.com/WordPress/wordpress-develop/pull/2613. I can close this one if you feel so. ☺️

Awesome, thank you so much 💯

#133 @johnbillion
10 months ago

In 56479:

Editor: Replace some accidental double setting up of tests with proper tearing down.

See #55505, #58955

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


3 months ago

Note: See TracTickets for help on using tickets.