Make WordPress Core

Opened 10 months ago

Closed 9 months ago

Last modified 7 months ago

#58623 closed task (blessed) (fixed)

Update npm packages to their latest versions for 6.3

Reported by: isabel_brison's profile isabel_brison Owned by: audrasjb's profile audrasjb
Milestone: 6.3 Priority: normal
Severity: normal Version: 6.3
Component: Editor Keywords: gutenberg-merge add-to-field-guide dev-reviewed
Focuses: Cc:

Description

This ticket tracks updates to @wordpress npm packages pre-6.3 beta 1.

Change History (48)

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


10 months ago
#1

  • Keywords has-patch added

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

Currently not working: after installing, there's an error while running the build:js task:

Running "jsvalidate:build" (jsvalidate) task
Validating src/wp-includes/js/media-audiovideo.js  
>> Line 1: Unexpected token )
Validating src/wp-includes/js/media-audiovideo.min.js  
>> Line 1: Unexpected token )
Validating src/wp-includes/js/media-grid.js  
>> Line 1: Unexpected token )
Validating src/wp-includes/js/media-grid.min.js  
>> Line 1: Unexpected token )
Validating src/wp-includes/js/media-models.js  
>> Line 1: Unexpected token )
Validating src/wp-includes/js/media-models.min.js  
>> Line 1: Unexpected token )
Validating src/wp-includes/js/media-views.js  
>> Line 1: Unexpected token )
Validating src/wp-includes/js/media-views.min.js  
>> Line 1: Unexpected token )
Encountered 16 errors.
Warning: Task "jsvalidate:build" failed. Use --force to continue.

I'm not sure if anything should be updated in the webpack config, as the files flagged are built with webpack.

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


10 months ago
#2

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

Alternative to #4698. Updates the @wordpress npm packages without updating browserslist, to avoid the errors from the other PR.

@isabel_brison commented on PR #4699:


10 months ago
#3

PHP unit tests are failing because #4624 hasn't been committed yet.

I'm running into an issue that seems to be related to the framer-motion dependency of @wordpress/components: both the post and site editor crash when a popover is opened. Not entirely sure why this is happening yet.

@youknowriad commented on PR #4699:


10 months ago
#4

Can we instead of avoiding to update browser list, remove that jsvalidation? Why are we validating built/ignored files anyway, maybe it's just a matter of excluding that js folder from some validation command or else, updating the validation rules to be inline with the latest supported browsers.

@spacedmonkey commented on PR #4698:


10 months ago
#5

@tellthemachines This PR will be blocked by https://github.com/WordPress/wordpress-develop/pull/4152. Becasue of upstream changes. Please review this PR, I will commit and we can continue.

joemcgill commented on PR #4699:


10 months ago
#7

Why are we validating built/ignored files anyway...

@youknowriad I was just asking myself this same question when I came across your comment here. From what I can tell this old validation process has become more of a hinderance than a help to our process over the last few releases. Now that it's no longer a maintained library, it may be time to eliminate it completely. Would appreciate you weighing in on the related conversation in Slack.

@ramonopoly commented on PR #4699:


10 months ago
#9

Sync scripts have been updated and committed over at: https://github.com/WordPress/wordpress-develop/pull/4699

@ramonopoly commented on PR #4699:


10 months ago
#10

It seems like is not in this change. https://github.com/WordPress/gutenberg/pull/51866

As far as I know, that PR is marked for backporting to the 16.2RC, which will get backported to core after these packages.

@ramonopoly commented on PR #4699:


10 months ago
#11

Not sure if it's relevant, but if the sync script is blocked by the deprecated nux package, @ockham says:

I guess one workaround -- to unblock the sync script -- would be to add the wp-6.3 dist tag to the latest existing @wordpress/nux package; but I'm not sure if that's possible for a deprecated npm 🤔

Otherwise, I guess we'll have to remove the dependency before running the sync script, and then add it back afterwards

#12 @peterwilsoncc
10 months ago

The changes for the @wordpress/block-serialization-default-parser packages include splitting the block parser PHP classes in to separate files in order to follow the WP coding standards and (at a future date) allow for the use of an auto-loader, see #57832.

In order to maintain the history of the relocated classes, an svn copy will need to be done so @isabel_brison and I are coordinating to do that package on a separate commit.

#13 @peterwilsoncc
10 months ago

In 56048:

Editor: Update block-serialization-default-parser package for WP 6.3 Beta 1.

Update the @wordpress/block-serialization-default-parser to 4.35.1 for WordPress 6.3 Beta 1. These changes split the following classes in to their own files in order to match the WordPress PHP coding standards:

  • WP_Block_Parser_Block
  • WP_Block_Parser_Frame
  • WP_Block_Parser

These classes were previously all included in the src/wp-includes/class-wp-block-parser.php file. In order to maintain backward compatibly for developers requiring the file directly, the relocated classes are replaced with require_once calls in the original file.

In order to retain the commit history of the new files, they have been created using the svn copy command.

Props aristath, rajanpanchal2028, jrf, SergeyBiryukov, costdev, manfcarlo, spacedmonkey, mukesh27, isabel_brison, dd32.
Fixes #57832.
See #58623.

@isabel_brison commented on PR #4699:


10 months ago
#14

Not sure if it's relevant, but if the sync script is blocked by the deprecated nux package, @ockham says:

The problem isn't the nux package (or that might be _a_ problem, but it's not the main one). It's that some packages were published last week and the versions don't seem to have been updated on trunk, so the version bump from the publishing yesterday is actually a lower version than last weeks for some packages. Afaict the sync task picks up the highest version from npm, so it's picking up the wrong versions for a bunch of packages.

@isabel_brison commented on PR #4699:


10 months ago
#15

Can we instead of avoiding to update browser list, remove that jsvalidation?

I'm fine with doing that, but unless we have any volunteers to get it done in the next few hours, let's leave it until after Beta 1. The priority now is updating the npm packages.

#16 @stevenlinx
10 months ago

  • Keywords add-to-field-guide added

@ramonopoly commented on PR #4699:


10 months ago
#17

I've been smoke testing GB 16.1 features and bugfixes.

Things are looking stable! 🙇

I guess we need to commit a few backports to get the unit tests passing (?)

#18 @audrasjb
10 months ago

  • Type changed from enhancement to task (blessed)

Converting to a task as this can ship after beta 1 is released.

#19 follow-up: @Bernhard Reiter
10 months ago

  • Owner set to Bernhard Reiter
  • Resolution set to fixed
  • Status changed from new to closed

In 56065:

Editor: update Wordpress npm packages.

Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.

Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes #58623.

This ticket was mentioned in PR #4722 on WordPress/wordpress-develop by @Bernhard Reiter.


10 months ago
#21

Follow-up to https://github.com/WordPress/wordpress-develop/pull/4699 / r56065.

Includes https://github.com/WordPress/gutenberg/pull/51978, which fixes the following fatal error:

Fatal error: Uncaught Error: Class 'WP_Navigation_Fallback_Gutenberg' not found

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

@Bernhard Reiter commented on PR #4722:


10 months ago
#22

Activating Gutenberg v16.0.0 alongside this PR seems to result in a fatal error:

Fatal error: Cannot declare class WP_REST_Navigation_Fallback_Controller, because the name is already in use in /var/www/src/wp-content/plugins/gutenberg/lib/experimental/class-wp-rest-navigation-fallback-controller.php on line 0

Yay for name collisions. Looks like we'll need another round of npms 😕

@spacedmonkey commented on PR #4722:


10 months ago
#23

Yay for name collisions. Looks like we'll need another round of npms 😕

CC @getdave

@Bernhard Reiter commented on PR #4722:


10 months ago
#25

Activating Gutenberg v16.0.0 alongside this PR seems to result in a fatal error:

Fatal error: Cannot declare class WP_REST_Navigation_Fallback_Controller, because the name is already in use in /var/www/src/wp-content/plugins/gutenberg/lib/experimental/class-wp-rest-navigation-fallback-controller.php on line 0

Yay for name collisions. Looks like we'll need another round of npms 😕

Ah, interesting. Looks like those collisions have been fixed in GB trunk already — they’re just not present in the current stable version (16.0.0). They will be in 16.1.0, which I believe is scheduled for tomorrow 🤔 : (I’ve confirmed that a GB plugin built from current trunk doesn’t fatal upon activation.)

@Bernhard Reiter commented on PR #4722:


10 months ago
#26

What about this Gutenberg reference:

https://github.com/WordPress/wordpress-develop/blob/87a0ad45a51a0294b9056a06f7fcb15082b7ff3b/src/wp-includes/blocks/navigation-submenu.php#L204

I don't see that file updated here.

I'll look into this.

Sidenote, I guess we could really use something like this 😅

@Bernhard Reiter commented on PR #4722:


10 months ago
#28

Thank you for reviewing/approving, folks!

As stated in Slack:

Since the tests on this PR are failing (probably because Core trunkis currently in a broken state), I’m considering only landing [this PR right here] for now (which should unbreak Core) and leave the rest for Beta 2. How does that sound? (It should shave off at least another hour of work for now; whereas landing [this PR] should be a matter of a few minutes only.)

#29 @Bernhard Reiter
10 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening to fix a fatal error.

#30 @Bernhard Reiter
10 months ago

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

In 56076:

Editor: Update npm WordPress npm packages.

This fixes a fatal error in the Navigation block, which was due to a reference
to WP_Navigation_Fallback_Gutenberg that isn’t present in Core under that name.

Follow-up to [56065].
Props ramonjd, isabel_brison, dmsnell.
Fixes #58623.

@ramonopoly commented on PR #4722:


10 months ago
#32

Sidenote, I guess we could really use something like this 😅

I'll add it to a list that I might never return to. I agree though. I'm sure this has been a problem before

thanks @ockham

#33 @Bernhard Reiter
10 months ago

I made a mistake when writing the commit message, so a number of changes that go beyond the npm packages version update aren't documented there. I'll cover those here instead:

  • Amend the replace:source-maps Grunt task to remove source map URLs (added by react-spring) from the block-editor build that would otherwise be flagged by the verify:source-maps task.
  • Modify the copy:block-json Grunt task to include line breaks (and indentation) in the block-json.php file it generates, as that file was rejected by a pre-commit SVN hook on the server due to all of its contents being on just one line.
  • Rewrite a number of calls to str_contains and str_ends_with, which are only available in PHP 8+ and are polyfilled by WordPress for earlier PHP versions, as some of them are called even before WordPress' compat layer is loaded, thus leading to fatals on earlier PHP versions.

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


10 months ago
#34

block_core_navigation_submenu_build_css_colors was deprecated in https://github.com/WordPress/gutenberg/pull/48936 in favour of wp_apply_colors_support

This commit adds a deprecation to core.

See comment: https://github.com/WordPress/wordpress-develop/pull/4699/files#r1243172213

Props to @peterwilsoncc

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

#35 @isabel_brison
10 months ago

In 56126:

Editor: adds deprecation for deleted block_core_navigation_submenu_build_css_colors function.

Adds the block_core_navigation_submenu_build_css_colors function to wp-includes/deprecated.php. Follow-up to #58623.

Props ramonopoly, peterwilsoncc.
See #58623.

@isabel_brison commented on PR #4762:


10 months ago
#36

Committed in r56126 / ab9d5e3

#37 in reply to: ↑ 19 @Hareesh Pillai
9 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This commit inadvertently changed uuid version from 9.0.0 to 8.3.2
It was previously updated in [54296]

In 56065:

Editor: update Wordpress npm packages.

Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.

Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes #58623.

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


9 months ago

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


9 months ago

#40 @JeffPaul
9 months ago

Nice catch & triaging @hareesh-pillai, I see that @audrasjb referenced that there are "several upcoming commits" but not seeing a PR/patch that lines up with that. @bernhard-reiter @isabel_brison is there something pending here? Do you / someone need help to get that ready for review/commit?

#41 @isabel_brison
9 months ago

uuid hasn't been updated back to 9.0.0 in trunk so we should still fix that. I can put up a quick PR.

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


9 months ago
#42

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

Reverts the accidental downgrade of uuid in r56065.

@audrasjb commented on PR #4948:


9 months ago
#43

Thanks for the PR! Approved for commit and backport.

#44 @audrasjb
9 months ago

  • Keywords dev-reviewed added; has-patch removed
  • Owner changed from Bernhard Reiter to audrasjb
  • Status changed from reopened to assigned

#45 @isabel_brison
9 months ago

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

In 56350:

Build/Test Tools: revert downgrade of uuid.

Reverts the accidental downgrade of uuid in [56065] by changing it back to 9.0.0.

Props Hareesh Pillai, JeffPaul, audrasjb.
Fixes #58623.

#46 @isabel_brison
9 months ago

In 56351:

Build/Test Tools: revert downgrade of uuid.

Reverts the accidental downgrade of uuid in [56065] by changing it back to 9.0.0.

Props Hareesh Pillai, JeffPaul, audrasjb.
Reviewed by audrasjb.
Merges [56350] to the 6.3 branch.
See #58623.

@isabel_brison commented on PR #4948:


9 months ago
#47

Committed to trunk in r56350 and 6.3 in r56351.

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


7 months ago

Note: See TracTickets for help on using tickets.