Make WordPress Core

Opened 5 weeks ago

Last modified 6 days ago

#60315 assigned task (blessed)

Editor: Update the WordPress packages to the latest versions for 6.5

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

Description

This ticket tracks updates to @wordpress npm packages for 6.5 release.

Change History (45)

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


5 weeks ago
#1

  • Keywords has-patch added

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

This PR is going to represent the initial packages update commit for 6.5 to bring all the latest updates from the Gutenberg repository. We will most likely discover shortcomings or requirements that need to be backported within this PR or prior to this PR.

Requirements

  • [ ] The interactivity package and the view scripts need to be built and registered as ES modules.
  • [ ] The navigation block uses an external class that needs to be moved to the block-library package. In progress here https://github.com/WordPress/gutenberg/pull/57979
  • [ ] The preferences package has a dedicate style handle that need to be registered properly

@youknowriad commented on PR #5922:


5 weeks ago
#2

Hey @luisherranz When update the packages, I was forced to update the build config for the Interactivity API related code because these are meant to be esmodules now. I made some incomplete tweaks so far.

  • For example, I don't see the src/wp-includes/blocks/*/view.js files for some reason
  • I'm guessing we also need to add some php code to the script loader of WordPress to "auto register" the modules (the view scripts and the interactivity package so far).
  • Also, I added a new webpack config file to core that is specific to the packages that are written as modules, I'm assuming the interactivity package is just the first one and probably not the last

@luisherranz commented on PR #5922:


5 weeks ago
#3

I'll take a look. Thanks, @youknowriad!

@luisherranz commented on PR #5922:


5 weeks ago
#4

This is a preliminary fix to bundle and register the new Interactivity API modules: https://github.com/WordPress/wordpress-develop/commit/8a06712e29803926237504c814637074f90d32fc

  • It contains a new file called interactivity-api.php which should be removed once the backport for the WP_Interactivity_API class lands. I'll remove it in the backport itself.
  • It contains some extra hardcoded code in the Webpack files due to the fact that the build-module output of the Interactivity API packages still contains React's JSX pragma instead of Preact's. @sirreal is working on that.
  • The @wordpress/interactivity-router package is not working yet. I'll look into it and I'll report back.

@jonsurrell commented on PR #5922:


5 weeks ago
#5

  • It contains some extra hardcoded code in the Webpack files due to the fact that the build-module output of the Interactivity API packages still contains React's JSX pragma instead of Preact's. @sirreal is working on that.

PR with short-term fix is here: https://github.com/WordPress/gutenberg/pull/58258

@luisherranz commented on PR #5922:


5 weeks ago
#6

  • The @wordpress/interactivity-router package is not working yet. I'll look into it and I'll report back.

https://github.com/WordPress/wordpress-develop/commit/5c8c5afbed97e4e1dbd37de0b0f30f3bd3609545 solves the problem with the router, but this fix needs to wait until this PR is committed because without the caniuselite package update, Webpack refuses to bundle:

It also uncovered a bug when @wordpress/interactivity-router is imported statically that we will solve in Gutenberg.

@youknowriad commented on PR #5922:


4 weeks ago
#7

Anyone know why the phpunit are failing on some php versions? Did we use some unsupported syntax or something? I'm having hard time reading the job jobs.

@peterwilsoncc commented on PR #5922:


4 weeks ago
#8

Anyone know why the phpunit are failing on some php versions? Did we use some unsupported syntax or something? I'm having hard time reading the job jobs.

It looks like some of the jobs are hitting the 20 minute timeout limit and getting abandoned.

https://github.com/WordPress/wordpress-develop/blob/cc645160ab91289af4ebc036956be71a582d8595/.github/workflows/phpunit-tests-run.yml#L79

@youknowriad Maybe try bumping the value on this branch to 30 minutes to see if it helps. It shouldn't but me know if it causes issues running the workflows.

@youknowriad commented on PR #5922:


4 weeks ago
#9

@peterwilsoncc I increased the timeout to 30mn and still seeing similar issues at roughly the same moment (20mn)

@youknowriad commented on PR #5922:


4 weeks ago
#10

@costdev I think most of these changes need to be part of a follow-up because these files are copied as is from Gutenberg so I can't make the changes here. So this would require a follow-up package update. That said, I'm going to try to ping the right people responsible for each of these changes in order to make the changes upstream.

@get_dave commented on PR #5922:


4 weeks ago
#11

@ockham @tjcafferkey Are you able to take a look at the review comments regarding Navigation block (ref: https://github.com/WordPress/gutenberg/pull/57754/)?

@youknowriad commented on PR #5922:


4 weeks ago
#12

With the increased timeout, the tests are starting to pass. Here's my suggested plan:

Given that this PR is kind of mandatory for 6.5 and a requirements for other backports to land, we need to try and land it quickly to prevent any potential delays in Beta1 later. So I suggest that we merge the PR with the timeout increase in the tests given that the performance tests don't show any regression in terms of real user WordPress performance.

That said, it's still concerning to me that the tests are so slow with this patch and I'll create a follow-up trac ticket that we'll have to address and identify the problematic change before beta1 while still allowing follow-up backports to happen in the meantime.

@get_dave commented on PR #5922:


4 weeks ago
#13

What @youknowriad suggests seems logical to me, especially if performance tests don't suggest major regressions that a user would experience.

We should not block the packages sync but be sure to followup _in short order_ with debugging _why_ the PHP tests have required a increased timeout.

In terms of performance, looking at the diff I’m suspicious of the PHP changes to the Navigation and Navigation Link blocks.

There have been two major changes:

There was also https://github.com/WordPress/gutenberg/pull/57979 but that just moved all existing rendering code into a class so that's probably the least likely source.

We should start investigating those. Any suggestions for workflows to validate before/after would be greatly appreciated.

@youknowriad commented on PR #5922:


4 weeks ago
#14

@getdave That's good starting point.

The test run fails for some versions even with 60mn of timeout, basically I think we'd need something like 70mn for all the tests to pass. It's a lot. Let's give it one more day before committing this and in the mean time, let's try to comment some of that suspicious code you just shared to see if we find anything.

@get_dave commented on PR #5922:


4 weeks ago
#15

Let's give it one more day before committing this and in the mean time, let's try to comment some of that suspicious code you just shared to see if we find anything.

60 minutes seems excessive. It would be good to try a little bit more debugging first.

I'll try a fork which removes the changes to Nav files so we can rule those changes in/out.

@get_dave commented on PR #5922:


4 weeks ago
#16

Folks I think the culprit is the Navigation Link block file src/wp-includes/blocks/navigation-link.php. Specifically changes made in this PR https://github.com/WordPress/gutenberg/pull/54801/.

You can see that on my fork of this packages sync PR I have reverted the synced changes introduced to src/wp-includes/blocks/navigation-link.php and all the Unit Tests run successfully.

I suspect that these two lines need to be looked at carefully.

@desrosj commented on PR #5922:


4 weeks ago
#18

@getdave Thanks for the update above! I missed it while performing my review. Just wanted it clear that my feedback was given without your new context, so read it with that lens.

@youknowriad commented on PR #5922:


4 weeks ago
#19

With the last commit, I was able to add a code to the bootstrap of the php unit tests to unregister the problematic hooks. Now the tests run properly.

This is going to help us unblock this PR while we work on the different follow-ups for the next package upgrade.

#20 @youknowriad
4 weeks ago

In 57377:

Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.

This patch, somewhat small brings a lot to WordPress.
This includes features like:

  • DataViews.
  • Customization tools like box shadow, background size and repeat.
  • UI improvements in the site editor.
  • Preferences sharing between the post and site editors.
  • Unified panels and editors between post and site editors.
  • Improved template mode in the post editor.
  • Iterations to multiple interactive blocks.
  • Preparing the blocks and UI for pattern overrides.
  • and a lot more.

Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.

#21 @youknowriad
4 weeks ago

I'm leaving this ticket open because there are a number of follow-ups that are yet to be addressed.

  • There are some functions that have been removed without deprecation (raised by @desrosj)
  • We need to update the way the navigation link registers the variations to avoid potential performance issues in unit tests. (currently being addressed by @gaambo and @get_dave

There are also some minor code styles changes that will be part of the next package upgrade.

@youknowriad commented on PR #5922:


4 weeks ago
#22

I went ahead and landed a first version of the package update PR in https://core.trac.wordpress.org/changeset/57377
This will unblock the other backports from the Gutenberg repository.

I've left the ticket open for follow-ups, mainly the deprecated functions and the change for the navigation link variations.

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


4 weeks ago
#23

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

Currently, Gutenberg's latest version is not compatible with WordPress trunk. The following issue triggers.

PHP Fatal error:  Cannot declare class WP_REST_Navigation_Fallback_Controller, because the name is already in use in… class-wp-rest-navigation-fallback-controller.php

This issue is already solved in Gutenberg trunk and will be included in tomorrow's 17.6 stable release.

This changes the Gutenberg minimum compatible version number from 16.5 to 17.6. For versions older than 16.5, the plugin will deactivate when upgrading WordPress to 6.5 beta1 or newer.

Changes are done within Core's _upgrade_core_deactivate_incompatible_plugins() which is invoked during WordPress' upgrade process.

@scruffian commented on PR #5971:


4 weeks ago
#24

I think the correct error message should be:

PHP Fatal error: Cannot declare class WP_Navigation_Block_Renderer, because the name is already in use in plugins/gutenberg/lib/compat/wordpress-6.5/class-wp-navigation-block-renderer.php on line 16

#25 @youknowriad
4 weeks ago

In 57384:

Editor: Update the minimum compatible version of Gutenberg.

Previous Gutenberg versions are not compatible with recent trunk because of the
WP_Navigation_Block_Renderer classname. It's present in both.

Gutenberg has been updated to avoid the use of this class but we need to auto-disable
old plugins to avoid fatals.

Props hellofromtonya.
See #60315.

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


4 weeks ago
#27

  • Keywords has-unit-tests added

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

This PR updates the WordPress packages to the latest version (which is current Gutenberg 17.6 RC3)
It brings with a set of iterations and follow-ups to the initial PR #30428
It also fixes a regression that happened for interactive blocks.

@youknowriad commented on PR #5922:


4 weeks ago
#28

closing this one now, follow-up here #5984

@gziolo commented on PR #5984:


4 weeks ago
#29

There are some remaining comments I left, but they aren't blockers for this PR.

#30 @youknowriad
4 weeks ago

In 57499:

Editor: Update WordPress packages to Gutenberg 16.7 RC3.

It brings with a set of iterations and follow-ups to the initial package update.
It also fixes a regression that happened for interactive blocks.

Props gziolo, luisherranz, cbravobernal.
See #60315.

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


2 weeks ago
#32

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

Updates the WordPress packages with the one included with the Gutenberg 17.7 RC1 release. This is very close to what we'll have for WordPress 6.5 beta1.

@youknowriad commented on PR #6077:


2 weeks ago
#33

Going to land this to let people test WordPress trunk with the latest Gutenberg over the weekend prior to beta 1.

#34 @youknowriad
2 weeks ago

In 57578:

Editor: Update the WordPress packages to Gutenberg 17.7RC1.

This brings the latest and greatest from Gutenberg.
The full changelog is available here
https://github.com/WordPress/gutenberg/releases/tag/v17.7.0-rc.1

Props youknowriad, get_dave.
See #60315.

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


2 weeks ago
#36

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

Updates the WordPress packages with the one included with the latest bug fixes from Gutenberg. This is probably the latest package update for WP 6.5 beta1.

It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/58964

#37 @youknowriad
2 weeks ago

In 57619:

Editor: Update Packages with the latest bug fixes for 6.5 beta1.

It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/58964

Props youknowriad, get_dave.
See #60315.

This ticket was mentioned in PR #6142 on WordPress/wordpress-develop by @get_dave.


6 days ago
#39

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

Updates the WordPress packages with the one included with the latest bug fixes from Gutenberg. This is probably the latest package update for WP 6.5 Beta 2

It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59197

@youknowriad commented on PR #6142:


6 days ago
#40

This is testing well for me so far.

#41 @youknowriad
6 days ago

In 57663:

Editor: Update Packages with the latest bug fixes for 6.5 beta 2.

It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59197

Props youknowriad, get_dave.
See #60315.

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


6 days ago
#43

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

Updates the WordPress packages with the one included with the latest bug fixes from Gutenberg. This is the latest package update for WP 6.5 Beta 2.

It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59208

These PRs were missed by the script in the initial backport.

#44 @youknowriad
6 days ago

In 57669:

Editor: Update Packages with the latest bug fixes for 6.5 beta 2 (Round 2).

It includes all the backports from this Gutenberg PR https://github.com/WordPress/gutenberg/pull/59208

See #60315.

Note: See TracTickets for help on using tickets.