WordPress.org

Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#50420 closed defect (bug) (fixed)

Update WordPress Packages

Reported by: ellatrix Owned by: ellatrix
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.5
Component: Editor Keywords: has-patch commit
Focuses: Cc:

Description

The following package versions were changed:
@wordpress/a11y: 2.7.0 -> 2.10.0
@wordpress/annotations: 1.12.3 -> 1.18.0
@wordpress/api-fetch: 3.11.0 -> 3.17.0
@wordpress/autop: 2.6.0 -> 2.8.0
@wordpress/blob: 2.7.0 -> 2.8.0
@wordpress/block-directory: 1.5.8 -> 1.11.0
@wordpress/block-editor: 3.7.8 -> 4.1.0
@wordpress/block-library: 2.14.8 -> 2.20.0
@wordpress/block-serialization-default-parser: 3.5.0 -> 3.6.0
@wordpress/blocks: 6.12.3 -> 6.18.0
@wordpress/components: 9.2.6 -> 9.8.0
@wordpress/compose: 3.11.0 -> 3.17.0
@wordpress/core-data: 2.12.3 -> 2.18.0
@wordpress/data: 4.14.2 -> 4.20.0
@wordpress/data-controls: 1.8.2 -> 1.14.0
@wordpress/date: 3.8.0 -> 3.9.0
@wordpress/dependency-extraction-webpack-plugin: 2.4.0 -> 2.7.0
@wordpress/deprecated: 2.7.0 -> 2.8.0
@wordpress/dom: 2.8.0 -> 2.11.0
@wordpress/dom-ready: 2.7.0 -> 2.9.0
@wordpress/e2e-test-utils: 4.3.1 -> 4.9.0
@wordpress/edit-post: 3.13.10 -> 3.19.0
@wordpress/editor: 9.12.8 -> 9.18.0
@wordpress/element: 2.11.0 -> 2.14.0
@wordpress/escape-html: 1.7.0 -> 1.8.0
@wordpress/format-library: 1.14.8 -> 1.20.0
@wordpress/hooks: 2.7.0 -> 2.8.0
@wordpress/html-entities: 2.6.0 -> 2.7.0
@wordpress/i18n: 3.9.0 -> 3.13.0
@wordpress/icons: 1.1.0 -> 2.2.0
@wordpress/is-shallow-equal: 1.8.0 -> 2.0.0
@wordpress/keyboard-shortcuts: 1.1.2 -> 1.7.0
@wordpress/keycodes: 2.9.0 -> 2.13.0
@wordpress/list-reusable-blocks: 1.13.6 -> 1.19.0
@wordpress/media-utils: 1.7.2 -> 1.13.0
@wordpress/notices: 2.0.2 -> 2.6.0
@wordpress/nux: 3.12.6 -> 3.18.0
@wordpress/plugins: 2.12.0 -> 2.18.0
@wordpress/primitives: 1.1.0 -> 1.5.0
@wordpress/priority-queue: 1.5.1 -> 1.6.0
@wordpress/redux-routine: 3.7.0 -> 3.9.0
@wordpress/rich-text: 3.12.2 -> 3.18.0
@wordpress/scripts: 6.2.0 -> 11.0.0
@wordpress/server-side-render: 1.8.6 -> 1.14.0
@wordpress/shortcode: 2.6.0 -> 2.8.0
@wordpress/token-list: 1.9.0 -> 1.10.0
@wordpress/url: 2.11.0 -> 2.16.0
@wordpress/viewport: 2.13.2 -> 2.19.0
@wordpress/warning: 1.0.0 -> 1.1.0
@wordpress/wordcount: 2.7.0 -> 2.9.0

Attachments (3)

package.patch (627.9 KB) - added by ellatrix 15 months ago.
package.2.patch (704.4 KB) - added by ellatrix 15 months ago.
packages.patch (739.1 KB) - added by ellatrix 15 months ago.

Change History (32)

@ellatrix
15 months ago

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


15 months ago

#2 @SergeyBiryukov
15 months ago

  • Milestone changed from Awaiting Review to 5.5

#3 @gziolo
15 months ago

Listing Gutenberg PRs that must be backported before this lands:

Last edited 15 months ago by gziolo (previous) (diff)

#4 follow-up: @gziolo
15 months ago

@SergeyBiryukov, what would be your recommendation on how to backport all PHP changes applied in those PRs? Should we create a diff PR each of them and attach to this ticket, then commit one by one. I anticipate that we won't be able to merge JS changes until all those individual functionalities are included in trunk. The alternative would be to create one huge diff but it might be hard to review.

#5 @spacedmonkey
15 months ago

A new ticket needs to be created to port this as well
https://github.com/WordPress/gutenberg/pull/22721

#6 @gziolo
15 months ago

Changes to merge:

  • #50257 – remove default "layout" block from WP_Block_Type
  • #50278 – patch for block categories is ready to go, it should be merged when testing this ticket
  • #50263register_block_type_from_metadata is ready to go

Changes to review/update:

  • #49926 – Editor: Introduce WP_Block class
  • #49927 – Editor: Introduce block context

When all the above is merged, we should integrate all required calls to register_block_type_from_metadata as part of this ticket.

#7 in reply to: ↑ 4 @SergeyBiryukov
15 months ago

Replying to gziolo:

@SergeyBiryukov, what would be your recommendation on how to backport all PHP changes applied in those PRs? Should we create a diff PR each of them and attach to this ticket, then commit one by one.

Thanks for the ping! Looks like those PRs have their own Trac tickets? Committing them as part of those tickets, maybe referencing this ticket as well, would be the preferred way I think.

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


15 months ago

#10 @gziolo
15 months ago

WordPress packages were published to npm yesterday. They are based on the last plugin release. Running npx wp-scripts packages-update should do the trick for the linked PR. To make all blocks work, we will still need to update the list of default categories (#50278) that @noisysocks recently reverted.

On my end, there are still two tasks left that aren't blockers for the existing set of core blocks:

  • backport block context logic (#49927)
  • use register_block_type_from_metadata to expose all core blocks on the server

#11 @ellatrix
15 months ago

Synced with Gutenberg 8.4. I included #50278. I'll also update the Github branch so the tests can run.

#12 @prbot
15 months ago

gziolo commented on PR #347:

We need to update node and npm versions according to https://make.wordpress.org/systems/2020/01/21/update-svn1-node-versions-for-gutenberg/:

`
# node --version
v12.16.3
# npm --version
6.14.4
`

#13 @prbot
15 months ago

ellatrix commented on PR #347:

@ntwb @pento Do you have any idea what we should use?

#14 @prbot
15 months ago

ellatrix commented on PR #347:

@ntwb @pento Do you have any idea what we should use?

#15 @prbot
15 months ago

gziolo commented on PR #347:

`php
function gutenberg_enqueue_block_editor_assets_block_directory() {

wp_enqueue_script( 'wp-block-directory' );

wp_enqueue_style( 'wp-block-directory' );

}
add_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' );
`

All that is necessary to enable Block Directory.

#16 @prbot
15 months ago

gziolo commented on PR #347:

Travis works much better with the latest npm but there are some failure in a different place:

https://travis-ci.com/github/WordPress/wordpress-develop/jobs/353584741#L2553

`
Running "qunit:files" (qunit) task
2554Testing tests/qunit/compiled.html .........................................................................................................................................................................................................F.............................................................................................
2555>> Customizer Model Utility functions - global failure
2556>> Message: Uncaught TypeError: Cannot read property '' of undefined
2557>> Actual: null
2558>> Expected: undefined
2559>> TypeError: Cannot read property '
' of undefined
2560>> at file:///home/travis/build/WordPress/wordpress-develop/build/wp-includes/js/dist/a11y.min.js:2:2033
2561>> at HTMLDocument.p (file:///home/travis/build/WordPress/wordpress-develop/build/wp-includes/js/dist/a11y.min.js:2:2360)
2562
2563Testing tests/qunit/index.html Access to XMLHttpRequest at 'file:///wp-admin/admin-ajax.php' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, https.
2564Failed to load resource: net::ERR_FAILED
2565.........................................................................................................................................................................................................F.............................................................................................
2566>> Customizer Model Utility functions - global failure
2567>> Message: Uncaught TypeError: Cannot read property '' of undefined
2568>> Actual: null
2569>> Expected: undefined
2570>> TypeError: Cannot read property '
' of undefined
2571>> at addIntroText (file:///home/travis/build/WordPress/wordpress-develop/build/wp-includes/js/dist/a11y.js:135:56)
2572>> at HTMLDocument.setup (file:///home/travis/build/WordPress/wordpress-develop/build/wp-includes/js/dist/a11y.js:250:5)
2573
2574Warning: 590 tests completed with 2 failed, 0 skipped, and 0 todo.
25751740 assertions (in 9179ms), passed: 1738, failed: 2 Use --force to continue.
2576
2577Aborted due to warnings.
`

#17 @prbot
15 months ago

TimothyBJacobs commented on PR #347:

We're tackling that block directory PHP in #359.

#18 @prbot
15 months ago

ellatrix commented on PR #347:

There are also quite a few PHP unit test failures.

#19 @prbot
15 months ago

ellatrix commented on PR #347:

For the e2e tests: Error: Cannot find module 'puppeteer'
Looking into that now.

@ellatrix
15 months ago

#20 @youknowriad
15 months ago

  • Keywords commit added

#21 @ellatrix
15 months ago

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

In 48177:

Editor: update JavaScript packages

Also update default block categories

Props youknowriad, gziolo, aduth.
Fixes #50420, #50278.

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


15 months ago

#23 @SergeyBiryukov
15 months ago

#50481 was marked as a duplicate.

#24 @prbot
15 months ago

gziolo commented on PR #347:

Great work team!!! 🎉

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


15 months ago

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

This PR tries to improve the shape of package-lock.json file and make it stable. The main change is that both dependencies of WordPress packages that use npm aliases are listed as development dependencies: puppeteer and prettier. It looks like npm doesn't handle those aliases properly when they are used as dependencies of dependencies.

This PR also addresses issue raised by @aduth in Gutenberg: https://github.com/WordPress/gutenberg/issues/22417:

As noted at https://github.com/WordPress/gutenberg/pull/21492#discussion_r420192067 , the version of wp-polyfill shipped in WordPress today is associated with @babel/polyfill@7.4.4. The latest version of @babel/polyfill is 7.8.7. It's assumed this would use a newer version of [core-js](https://github.com/zloirock/core-js) and thus, polyfills for more new language features in use today in Gutenberg.

Since this is a script handle shipped already with Core, it would inevitably need an upstream patch. It could be done sooner in Gutenberg following the pattern such as in #14400 / [Trac#48121](https://core.trac.wordpress.org/ticket/48121).

#26 @gziolo
15 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#27 @prbot
15 months ago

gziolo commented on PR #367:

I executed npm run dev in the project.

It looks like block.json files should be added to the repository. In addition to that, assets for block editor scripts need to be regenerated.

#28 @gziolo
15 months ago

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

In 48213:

Chore: Update package-lock.json file

Improve the shape of package-lock.json file to make it stable. The main change is that both dependencies of WordPress packages that use npm aliases are listed as development dependencies: puppeteer and prettier. This patch includes also block.json files for dynamic blocks copied from WordPress packages.

Props ellatrix.
Fixes #50420.

#29 @gziolo
15 months ago

I only wanted to share an update that I backported all linked tasks in my previous comment:

https://core.trac.wordpress.org/ticket/50420#comment:6

The only task left on my end is to ensure that all blocks are registered on the server with register_block_type_from_metadata to make them exposed in the new block type REST API endpoint.

Note: See TracTickets for help on using tickets.