Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#52991 closed task (blessed) (fixed)

Editor: Update WordPress packages to use with WordPress 5.8

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

Description

In the response to the discussion during the Dev Chat, I'm opening a ticket to group all efforts to keep WordPress packages up to date in the WordPress 5.8 release cycle:

@clorith started a discussion on more frequently merging updates from the Gutenberg plugin in to Core. Highlighting that this would make testing future releases of WordPress features easier without keeping track of which features will remain in the plugin for the time being. There was general support for the idea.​ @chanthaboune is offered her help to move this forward

https://make.wordpress.org/core/2021/03/25/dev-chat-meeting-summary-march-24-2021/

Change History (89)

This ticket was mentioned in Slack in #core-editor by gziolo. View the logs.


4 years ago

This ticket was mentioned in PR #1175 on WordPress/wordpress-develop by gziolo.


4 years ago
#2

  • Keywords has-patch added

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

This PR only updates development dependencies for WordPress packages to align better with the Gutenberg plugin.

#3 @gziolo
4 years ago

In 50685:

Build Tools: Update development dependencies from WP packages

This patch updates only development dependencies for WordPress packages to align better with the Gutenberg plugin.

See #52991.

gziolo commented on PR #1175:


4 years ago
#4

Committed in https://core.trac.wordpress.org/changeset/50685 without the dummy commit.

Trac ticket remains open.

#5 @gziolo
4 years ago

In 50686:

Editor: Ensure @wordpress/inteface package is listed as a dependency

Discovered when backporting changes for WordPress 5.7.1 release.

See #52991.

This ticket was mentioned in PR #1176 on WordPress/wordpress-develop by gziolo.


4 years ago
#6

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

I executed npm run wp-packages-update and npm run build:dev to update the block editor to the latest version based on WordPress packages published to npm.

gziolo commented on PR #1176:


4 years ago
#7

I’m surprised to see it happening, but it looks like the update for WordPress packages works on the first try in core. The version of the Gutenberg plugin (v10.3.1) is ready to land:
https://github.com/WordPress/wordpress-develop/pull/1176
It would be great to learn which PHP changes are missing and need to be backported, but I think we can do it separately. I haven’t tried enabling FSE features or installing the Gutenberg plugin.

youknowriad commented on PR #1176:


4 years ago
#8

I think we should compare the "lib" folder between the two Gutenberg versions used previously and the new one.

youknowriad commented on PR #1176:


4 years ago
#9

Do you know which version was used before?

youknowriad commented on PR #1176:


4 years ago
#10

I think for instance, that there are a number of changes to the block-supports folder (all of them maybe?) that should be backported.

gziolo commented on PR #1176:


4 years ago
#11

Do you know which version was used before?

Not yet, but I'm going to check it soon.

There are some changes in how blocks are aligned when the plugin gets activated:

<img width="1917" alt="Screen Shot 2021-04-07 at 14 43 19" src="https://user-images.githubusercontent.com/699132/113868198-b663d900-97af-11eb-89a6-21707f4176d1.png">

The most important part is that it works with the plugin installed so it feels like we can merge those changes as the first step and backport all the missing bits afterward. What do you think?

youknowriad commented on PR #1176:


4 years ago
#12

The most important part is that it works with the plugin installed so it feels like we can merge those changes as the first step and backport all the missing bits afterward. What do you think?

I don't know to be honest, I wouldn't want to merge a broken experience personally, at least we should identify them and have tickets for them. I'm going through some of theme right now https://github.com/WordPress/gutenberg/compare/v9.9.3...v10.3.2

For example, I see the lazy loading related changes as well.

gziolo commented on PR #1176:


4 years ago
#13

Many of the changes are behind the feature flag for FSE themes on PHP side. I'm not sure how much of the code is also removed from the JS build for those features marked as experimental which is most of the FSE blocks.

youknowriad commented on PR #1176:


4 years ago
#14

Here's what I got so far, I only kept the changes that should probably be backported (not experimental things)

  • Block Supports changes (even if it uses experimental flags, these flags are used in Core blocks, so this is mandatory)
  • Inline lazy loading (I don't know if this impacts the experience if not backported, maybe it's optional and should have its own ticket)
  • New style handles to register and tweak dependencies (classic.css and reset.css, reusable-blocks.css). this is very important
  • Prevent the default editor styles from being loaded. this is very important too
  • Update Reusable block CPT labels
  • editor settings function (you know better for this one)
  • WP_REST_URL_Details_Controller (not sure about that one and whether it's used by stable JS things)
  • Layout block support and « supportsLayout » editor setting. (this might require some theme.json related stuff so we could potentially skip until we backport theme.json stuff)
  • New block category (theme) though maybe it’s just for FSE blocks now (need to confirm that)

gziolo commented on PR #1176:


4 years ago
#15

Thank you @youknowriad for checking. I converted your comment into todo list and marked the last item as done. I took care of it 2 weeks ago.

gziolo commented on PR #1176:


4 years ago
#16

Inline lazy loading (I don't know if this impacts the experience if not backported, maybe it's optional and should have its own ticket)

@aristath, can you help us decide whether it's mandatory to include for WordPress 5.8?

draganescu commented on PR #1176:


4 years ago
#17

WP_REST_URL_Details_Controller arrived via #18042 and would be used by #19387 which is not ready yet.

aristath commented on PR #1176:


4 years ago
#18

inline lazy styles loading has no JS dependencies so it can go in 5.8 👍
It is completely opt-in (by default enabled for FSE but otherwise opt-in is required) and won't break anything out of the box, so it would be great to have it in core and allow developers to start taking advantage of it.

youknowriad commented on PR #1176:


4 years ago
#19

@aristath I'm reading that it can go into its own dedicated ticket right? And updating the packages won't break anything if it's not done at the same time?

aristath commented on PR #1176:


4 years ago
#20

@aristath I'm reading that it can go into its own dedicated ticket right? And updating the packages won't break anything if it's not done at the same time?

Yes, updating the packages won't break anything if not done at the same time. It _can_ be a separate, dedicated ticket.

youknowriad commented on PR #1176:


4 years ago
#21

Did another review of the diff and checked a few items on the list, I think we're good.

We're missing two things:

  • the editor settings refactoring (this can potentially be separate as I don't think it impacts frontend, it's just a refactoring)
  • lazy loading (can we create a ticket and link to it as a reference)

There are three things that we should remember to do when back porting theme.json changes (if they land on 5.8)

  • Fully backport the layout block support,
  • Add a conditional check about the "classic.css" dependency in the style loader (only load it for non theme.json themes),
  • Add the supportsLayout editor setting.

gziolo commented on PR #1176:


4 years ago
#22

I will fix the issues reported by CI, improve PHPDoc comments and test locally.

We're missing two things:

  • the editor settings refactoring (this can potentially be separate as I don't think it impacts frontend, it's just a refactoring)
  • lazy loading (can we create a ticket and link to it as a reference)

Right, those can land separately 👍🏻

We also need to add unit tests for newly added functionality in the follow-up patches

  • block supports
    • align
    • border
    • colors
    • custom classname
    • generated classname
    • layout
    • padding
    • typography
  • block_has_support

#23 @gziolo
4 years ago

In 50761:

Editor: Update WordPress packages to use with WordPress 5.8

In the response to the discussion during the Dev Chat, I'm doing a first pass to keep WordPress packages up to date in the WordPress 5.8 release cycle.

See https://github.com/WordPress/wordpress-develop/pull/1176 for more details.

Props youknowriad, aristath, andraganescu.
See #52991.

youknowriad commented on PR #1176:


4 years ago
#25

Would love if we can run the e2e tests against trunk. I tried running the command but it's failing because of wp-env somehow.

peterwilsoncc commented on PR #1176:


4 years ago
#26

Thanks for following this up folks. It looks like my instinct was correct that it would require more than a simple package update so I'm glad I left it for the experts. :)

gziolo commented on PR #1176:


4 years ago
#27

@peterwilsoncc, actually I also backported changes from 5.7.1 in https://github.com/WordPress/wordpress-develop/commit/a45c8715410b1f362218da80eda9bd0248fd5503 as a temporary step. However, @youknowriad helped to identify missing PHP changes and here we are enjoying all the latest stable features of Gutenberg in WordPress trunk 😄

This ticket was mentioned in Slack in #core-editor by gziolo. View the logs.


4 years ago

This ticket was mentioned in Slack in #core-editor by gziolo. View the logs.


4 years ago

This ticket was mentioned in PR #1226 on WordPress/wordpress-develop by gziolo.


4 years ago
#30

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

First pass, I haven't tested it yet. I plan to take care of it tomorrow.

gziolo commented on PR #1226:


4 years ago
#31

There is one more thing left that I almost missed. For the File block, we need to add an entry point for the JS file used on the frontend.

gziolo commented on PR #1226:


4 years ago
#32

There is one more thing left that I almost missed. For the File block, we need to add an entry point for the JS file used on the frontend and exposed under the wp-block-library-file script handle.

It's a more complex task than I anticipated. Let's land the changes include already and tackle changes to the build system separately.

#33 @gziolo
4 years ago

In 50824:

Editor: Update WordPress packages from Gutenberg 10.5

Applies changes between the Gutenberg plugin v10.4 and v10.5. It contains the latest version of WordPress packages and PHP changes applied to non-experimental features.

Props youknowriad.
See #52991.

This ticket was mentioned in PR #1257 on WordPress/wordpress-develop by gziolo.


4 years ago
#35

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

## TODO

It needs more work. All newly exposed core blocks aren't registered on the server. It requires changes in webpack build and some references for PHP files for most of the blocks.

youknowriad commented on PR #1257:


4 years ago
#36

I updated the todo list with a few required items as well.

#38 @SergeyBiryukov
4 years ago

In 50922:

KSES: Remove duplicate object-position property.

As part of some recent changes, the property was added to the list of safe CSS properties twice.

Follow-up to [50634], [50761].

See #52991.

gziolo commented on PR #1257:


4 years ago
#39

I scanned quickly changes applied between 10.5 and 10.6 and I might have covered all of them with the last commit. We need to double-check: https://github.com/WordPress/gutenberg/compare/release/10.5...release/10.6.

I backported all changes for block supports in https://github.com/WordPress/wordpress-develop/pull/1257/commits/934ec7a4b25af80142b5cc09ce2f27d8e8e36edf. I left there 2 TODO items where I had to removed logic that depends on Global Styles in the layout support. It's something we need to explicitly list for the next round so it's wired correctly.

gziolo commented on PR #1257:


4 years ago
#40

I found the logic that is related to:

Some php changes to support the iframed template editor

https://github.com/WordPress/gutenberg/blob/b5f6955742e784f11828e1dacba4361713135963/lib/client-assets.php#L707-L744

It looks like something that could be done separately.

youknowriad commented on PR #1257:


4 years ago
#41

@gziolo did we include the 10.6.1 package update and php changes here?

gziolo commented on PR #1257:


4 years ago
#42

did we include the 10.6.1 package update and php changes here?

If 10.6.1 was applied this week, then the answer is no.

youknowriad commented on PR #1257:


4 years ago
#43

I noticed that the editor styles are not applied properly (compared to the plugin), not sure why. You can compare with tt1 theme, you'll see that the background is not applied

youknowriad commented on PR #1257:


4 years ago
#44

Nevermind, I was testing with tt1-blocks and theme.json based styles are not backported yet, so we're all good here.

ellatrix commented on PR #1257:


4 years ago
#45

Looking at the iframe stuff. Trying to get this branch running first.

gziolo commented on PR #1257:


4 years ago
#46

I removed the Site Logo block for now because it creates too much friction, and I couldn't find a simple way to make failing tests pass without changing assertions. It needs to be investigated separately.

#47 @gziolo
4 years ago

In 50929:

Editor: Update WordPress packages published for Gutenberg 10.6

It contains several changes in addition to regular update to WordPress packages:

  • All newly exposed blocks are now registered on the server.
  • Dutone block support was added.
  • Border block support was updated.
  • New shared function construct_wp_query_args was added for the family of Query blocks - it might need some further work.

Props youknowriad.
See #52991.

#49 @gziolo
4 years ago

In 50941:

Editor: Update lodash to the latest version 4.17.21

It aligns with the version that Gutenberg uses.

Props peterwilsoncc.
See #52991.

#50 @gziolo
4 years ago

In 50944:

Editor: Add missing unit tests for construct_wp_query_args

Follow-up for [50929].
Props ntsekouras, jorbin.
Fixes #53240. See #52991.

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


4 years ago
#51

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

## TODO

  • [ ] Remove the Post Author PHP code.
  • [ ] Check PHP changes between 10.6 and 10.7.

youknowriad commented on PR #1273:


4 years ago
#52

I think I included all the mandatory php changes but would appreciate confirmation https://github.com/WordPress/gutenberg/compare/v10.6.0...v10.7.0-rc.1

gziolo commented on PR #1273:


4 years ago
#53

I assume that the changes for Block Patterns will be handled separately or do we keep the default ones in WP core for now?

gziolo commented on PR #1273:


4 years ago
#54

Two follow-ups required:

  • Porting gutenberg_extend_block_editor_styles_html but I guess it's related to the template editor integration task
  • Site Logo block needs to be integrated on the server together with changes to the REST API endpoint with settings (theme_mods and stylesheet changes).

#55 @youknowriad
4 years ago

In 50945:

Block Editor: Updated the WordPress packages from Gutenberg 10.7.0 RC.

This also includes:

  • The removal of the Post Author block.
  • Renaming build_query_vars_from_query_block function.
  • Update the block supports.

Props gziolo.
See #52991.
-This line, and those below, will be ignored--

M package-lock.json
M package.json
M src/wp-includes/assets/script-loader-packages.php
M src/wp-includes/block-supports/colors.php
AM src/wp-includes/block-supports/elements.php
D src/wp-includes/block-supports/padding.php
AM src/wp-includes/block-supports/spacing.php
M src/wp-includes/block-supports/typography.php
M src/wp-includes/blocks/column/block.json
M src/wp-includes/blocks/index.php
D src/wp-includes/blocks/post-author
D src/wp-includes/blocks/post-author.php
M src/wp-includes/blocks/post-content.php
M src/wp-includes/blocks/post-featured-image.php
M src/wp-includes/blocks/query/block.json
M src/wp-includes/blocks/query-loop/block.json
M src/wp-includes/blocks/query-loop.php
M src/wp-includes/blocks/query-pagination/block.json
M src/wp-includes/blocks/query-pagination-next.php
M src/wp-includes/blocks/query-pagination-numbers.php
M src/wp-includes/blocks/site-tagline/block.json
M src/wp-includes/blocks/site-title/block.json
M src/wp-includes/blocks.php
M src/wp-settings.php
M tests/phpunit/tests/blocks/block.php
M tools/webpack/packages.js

#57 @dd32
4 years ago

AM src/wp-includes/block-supports/elements.php

This has caused a PHP Notice, See https://github.com/WordPress/gutenberg/pull/32135

<?php echo render_block( array( 'blockName' => 'wporg-learn/workshop-details' ) ); ?>

E_NOTICE: Undefined index: attrs in wp-includes/block-supports/elements.php:20

#58 @gziolo
4 years ago

In 50955:

Editor: Add missing unit tests for block_has_support

Follow-up for [50761].
Props ntsekouras.
Fixes #53257. See #52991.

#59 @gziolo
4 years ago

In 50960:

Editor: Fix failing unit test for i18n support in theme.json

As part of the change, I also did some code reorganization to match with how other test fixtures are handled.

Follow-up [50959].

See #52991.

#60 @SergeyBiryukov
4 years ago

In 50967:

Docs: Some documentation and test improvements for WP_Theme_JSON and WP_Theme_JSON_Resolver classes:

  • Add missing @since tags.
  • Update some DocBlocks per the documentation standards.
  • Rename test files and classes per the naming conventions.
  • Fix some code alignment issues reported by WPCS.

Follow-up to [50959], [50960].

See #52991, #53175.

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


4 years ago
#61

This includes the following PRs

The PHP changes are not backported yet, we need to check this diff:

https://github.com/WordPress/gutenberg/compare/51adf3de548dcf49173d96028c1b3ae447d63859...wp/trunk

https://core.trac.wordpress.org/ticket/52991

nosolosw commented on PR #1319:


4 years ago
#62

Fix for enabling custom colors and gradients.

This was already ported.

I've prepared https://github.com/youknowriad/wordpress-develop/pull/1 to address:

  • Update elements block supports.
  • Theme.json presets classes changes and unit test.

noisysocks commented on PR #1319:


4 years ago
#63

The PHP changes are not backported yet, we need to check this diff:

WordPress/gutenberg@51adf3d...wp/trunk

core.trac.wordpress.org/ticket/52991

I had a quick look through and confirmed that all of the widgets PHP changes are to do with making the Gutenberg plugin compatible with core and so don't need to be ported to core.

#64 @youknowriad
4 years ago

In 51051:

Block Editor: Update packages and backport the latest Gutenberg fixes.

This includes the following fixes:

Props nosolosw, noisysocks.
See #52991.

youknowriad commented on PR #1319:


4 years ago
#65

Committed.

#66 @youknowriad
4 years ago

In 51052:

Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests.

In core, you can run tests/gutenberg/run.js script to run the Gutenberg e2e tests
against Core with the plugin being disabled. This test ensures that the integration
of the block editor with Core is working properly.

This commit updates the Gutenberg base branch to be used for the tests to be wp/trunk
which corresponds to the latest packages that are included in Core.

See #52991.

#67 @SergeyBiryukov
4 years ago

In 51054:

Tests: Remove the ::append_to_selector() method from Tests_Theme_wpThemeJson.

The method exists in the WP_Theme_JSON class and appears to be erroneously duplicated in the test class.

Add a unit test that was meant to be included instead, as per https://github.com/WordPress/gutenberg/pull/32190.

Follow-up to [51051].

See #52991.

#68 @peterwilsoncc
4 years ago

In 51062:

Block Editor: Update script versions.

Follow up to [51051].
See #52991.

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


4 years ago
#69

This updates WP to the latest WP packages. It includes the backports from https://github.com/WordPress/gutenberg/pull/32484

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

Todo:

  • [ ] Changes related to theme.json and block supports
  • [ ] Changes related to widgets editor

See the diff in https://github.com/WordPress/gutenberg/pull/32484/files

nosolosw commented on PR #1338:


4 years ago
#70

Prepared https://github.com/youknowriad/wordpress-develop/pull/2 for the changes related to theme.json and block supports.

noisysocks commented on PR #1338:


4 years ago
#71

Changes related to widgets editor

I only see changes to packages/block-library/src/legacy-widget/index.php which should be copied over when grunt build --dev is ran.

youknowriad commented on PR #1338:


4 years ago
#72

Thanks @noisysocks @nosolosw

#73 @youknowriad
4 years ago

In 51089:

Block Editor: Package updates for 5.8 beta 1.

This includes the following fixes:

Widgets Editor:

Widget blocks in the customizer:

Global Styles:

Template Editor:

Miscellaneous:

Performance:

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

youknowriad commented on PR #1338:


4 years ago
#74

Committed.

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


4 years ago
#75

  • Keywords has-unit-tests added

This updates WP to the latest WP packages. It includes the backports from https://github.com/WordPress/gutenberg/pull/32508

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

See the diff in https://github.com/WordPress/gutenberg/pull/32484/files

youknowriad commented on PR #1350:


4 years ago
#76

mmm looks like I created this branch on the core repo, I'll create another one on the fork.

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


4 years ago
#77

This updates WP to the latest WP packages. It includes the backports from https://github.com/WordPress/gutenberg/pull/32508

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

See the diff in https://github.com/WordPress/gutenberg/pull/32508/files

#79 @youknowriad
4 years ago

In 51101:

Block Editor: Package updates for WordPress 5.8 beta 1 (batch2).

This includes the following fixes:

  • Fix inspector opening when clicking outside the widget areas
  • Assume light theme when a transparent background is used
  • Make Post blocks non editable inside Query block
  • Rename QueryLoop to PostTemplate block

Props ntsekouras.
See #52991.

youknowriad commented on PR #1351:


4 years ago
#80

committed.

#81 @youknowriad
4 years ago

In 51104:

Block Editor: Fix typo in the typography block support.

The function wp_typography_get_css_variable_inline_style has been renamed when backported to Core.
But its usage was untouched causing potential php errors on the frontend.

See #52991.

#82 @ryelle
4 years ago

In 51109:

Block Editor: Ignore generated CSS files in Page List and Post Template blocks.

Add SVN ignore property to match existing rule in .gitignore.

Follow up to [51101], [51105].
See #52991, #53309.

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


4 years ago

#84 @desrosj
4 years ago

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

I believe everything here has been addressed.

Please open a new ticket for each beta and RC sync going forward.

#85 @gziolo
4 years ago

@ryelle, thank you for the follow-up. SVN ignore becomes the most annoying part in the process since you need to set it per every folder :(

@desrosj, I know it's on the radar but we really need to look after WP 5.8 is done into ways how we can improve the part of the build process that handles blocks the sync from WordPress packages.

#86 @desrosj
4 years ago

In 51133:

Upgrade/Install: Update the $_old_files list for 5.8.

Follow up to [50761], [50794], [51021].
Props kapilpaul, desrosj.
See #52991, #52846, #53246.
Fixes #53367.

#87 @SergeyBiryukov
4 years ago

In 51153:

Editor, I18N: Remove code from a translatable string in wp_migrate_old_typography_shape().

Replace a trigger_error() call with _doing_it_wrong() for consistency with how similar messages are displayed elsewhere in core.

Follow-up to [51089].

See #52991.

#88 @SergeyBiryukov
4 years ago

In 51159:

Docs: Add missing documentation for wp_migrate_old_typography_shape().

Follow-up to [51089].

See #52991, #52628.

#89 @SergeyBiryukov
4 years ago

In 51245:

Block Editor: Remove empty blocks/query-loop directory.

The Query Loop block was renamed to Post Template.

Follow-up to [51101].

See #52991.

Note: See TracTickets for help on using tickets.