Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WordPress packages #4408

Merged
merged 12 commits into from May 2, 2020
Merged

Update WordPress packages #4408

merged 12 commits into from May 2, 2020

Conversation

swissspidy
Copy link
Collaborator

@swissspidy swissspidy commented Mar 19, 2020

Summary

Fixes #4247
Fixes #4249
Fixes #4274

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@swissspidy swissspidy added the Infrastructure Changes impacting testing infrastructure or build tooling label Mar 19, 2020
@googlebot googlebot added the cla: yes Signed the Google CLA label Mar 19, 2020
@westonruter westonruter added this to the v1.5 milestone Mar 19, 2020
@swissspidy
Copy link
Collaborator Author

Just like in #4247, the following test is failing:

1) Test_AMP_Theme_Support::test_filter_admin_bar_script_loader_tag with data set "admin_bar_scripts_have_dev_mode_with_paired_browsing_app" (Closure Object (...), Closure Object (...))
Expected element for query: //script[ contains( @src, "/amp-paired-browsing-app" ) ]
Failed asserting that null is an instance of class "DOMElement".

And I have no idea why. Any help appreciated.

@schlessera
Copy link
Collaborator

And I have no idea why. Any help appreciated.

This is code that @pierlon has worked on, so he probably has an idea what the culprit might be.

@pierlon
Copy link
Contributor

pierlon commented Mar 19, 2020

A quick guess would be one of the JS dependencies being missing on WP 4.9. I'll take a look into it.

The @wordpress/wp-url package now requires lodash as a dependency. The lodash package is not available in WP 4.9 so we will have to register it ourselves.
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no Has not signed the Google CLA and removed cla: yes Signed the Google CLA labels Mar 20, 2020
@pierlon
Copy link
Contributor

pierlon commented Mar 20, 2020

@googlebot I consent.

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Signed the Google CLA and removed cla: no Has not signed the Google CLA labels Mar 20, 2020
@pierlon
Copy link
Contributor

pierlon commented Mar 20, 2020

Turns out @wordpress/url now requires lodash as a dependency. In c2fbf09, I've copied lodash into the assets/js/vendor directory and register it as a WP dependency if it does not already exist.

@westonruter
Copy link
Member

E2E tests keep failing with:

 ● Featured Image Notice › should not display a notice, nor suggest cropping, when the image is the expected size
    TimeoutError: waiting for selector ".media-modal li[aria-label="e287a7d4-d2f7-411c-9d71-0c2a427dd99b"]" failed: timeout 3000ms exceeded
      36 | 
      37 | 	// Wait for upload.
    > 38 | 	await page.waitForSelector( `.media-modal li[aria-label="${ filename }"]` );
         | 	           ^
      39 | 
      40 | 	return fileWithExtension;
      41 | }
      at new WaitTask (../../node_modules/puppeteer/lib/DOMWorld.js:549:28)
      at DOMWorld._waitForSelectorOrXPath (../../node_modules/puppeteer/lib/DOMWorld.js:478:22)
      at DOMWorld.waitForSelector (../../node_modules/puppeteer/lib/DOMWorld.js:432:17)
      at Frame.waitForSelector (../../node_modules/puppeteer/lib/FrameManager.js:627:47)
      at Frame.<anonymous> (../../node_modules/puppeteer/lib/helper.js:112:23)
      at Page.waitForSelector (../../node_modules/puppeteer/lib/Page.js:1122:29)
      at waitForSelector (utils/upload-media.js:38:13)
          at runMicrotasks (<anonymous>)
      at Object.<anonymous> (specs/block-editor/featured-image-notice.js:30:3)
  ● Featured Image Notice › should display a notice when the image is too small, but not suggest cropping
    TimeoutError: waiting for selector ".media-modal li[aria-label="05f7c977-7766-423a-81f3-2a1ba256b1d5"]" failed: timeout 3000ms exceeded
      36 | 
      37 | 	// Wait for upload.
    > 38 | 	await page.waitForSelector( `.media-modal li[aria-label="${ filename }"]` );
         | 	           ^
      39 | 
      40 | 	return fileWithExtension;
      41 | }
      at new WaitTask (../../node_modules/puppeteer/lib/DOMWorld.js:549:28)
      at DOMWorld._waitForSelectorOrXPath (../../node_modules/puppeteer/lib/DOMWorld.js:478:22)
      at DOMWorld.waitForSelector (../../node_modules/puppeteer/lib/DOMWorld.js:432:17)
      at Frame.waitForSelector (../../node_modules/puppeteer/lib/FrameManager.js:627:47)
      at Frame.<anonymous> (../../node_modules/puppeteer/lib/helper.js:112:23)
      at Page.waitForSelector (../../node_modules/puppeteer/lib/Page.js:1122:29)
      at waitForSelector (utils/upload-media.js:38:13)
          at runMicrotasks (<anonymous>)
      at Object.<anonymous> (specs/block-editor/featured-image-notice.js:41:3)

@pierlon
Copy link
Contributor

pierlon commented Mar 20, 2020

Turns out its a puppeteer issue (see WordPress/gutenberg#20268 and puppeteer/puppeteer#5420).

We could wait for it to be fixed upstream, or use this patch to overcome the issue now:

Index: tests/e2e/utils/upload-media.js
<+>UTF-8
===================================================================
--- tests/e2e/utils/upload-media.js	(revision c2fbf090a63065d5b8f5490d2d188c32b39701b6)
+++ tests/e2e/utils/upload-media.js	(date 1584742106698)
@@ -24,8 +24,9 @@
 	const fileExtension = fileExtensionMatches[ 0 ];
 
 	// Wait for media modal to appear and upload video.
-	await page.waitForSelector( '.media-modal input[type=file]' );
-	const inputElement = await page.$( '.media-modal input[type=file]' );
+	const inputSelector = '.media-modal input[type=file]';
+	await page.waitForSelector( inputSelector );
+	const inputElement = await page.$( inputSelector );
 	const testMediaPath = path.join( __dirname, '..', 'assets', file );
 	const filename = uuidv4();
 
@@ -34,6 +35,10 @@
 	fs.copyFileSync( testMediaPath, tmpFileName );
 	await inputElement.uploadFile( tmpFileName );
 
+	await page.evaluate( ( input ) => {
+		document.querySelector( input ).dispatchEvent( new Event( 'change', { bubbles: true } ) );
+	}, inputSelector );
+
 	// Wait for upload.
 	await page.waitForSelector( `.media-modal li[aria-label="${ filename }"]` );
 

@westonruter
Copy link
Member

I suppose it depends on WordPress 5.4… do these updates improve compatibility with 5.4 or are they more targeted for 5.5-alpha (aka current Gutenberg)? If the former, then let's do the patch. If the latter, then it can wait for 1.5.1.

@pierlon
Copy link
Contributor

pierlon commented Mar 20, 2020

I'm not sure how these changes will improve compatibility with WordPress in anyway actually; I'm only aware of them affecting the DX and and build process.

@westonruter
Copy link
Member

OK, then this can wait for v1.5.1, unless @swissspidy sees differently. The puppeteer issue has been open for more than a month, so it doesn't look like it is getting resolved before 1.5.

@westonruter westonruter modified the milestones: v1.5, v1.5.1 Mar 20, 2020
@westonruter westonruter modified the milestones: v1.5.1, v1.5.2, v1.6 Mar 31, 2020
@pierlon
Copy link
Contributor

pierlon commented Apr 10, 2020

It seems there are only lint errors here to resolve. Would you want me to resolve them @swissspidy?

@swissspidy
Copy link
Collaborator Author

@pierlon sure, feel free!

@westonruter westonruter added the dependencies Pull requests that update a dependency file label Apr 16, 2020
@westonruter westonruter merged commit 64d0523 into develop May 2, 2020
@westonruter westonruter deleted the update/wp-packages branch May 2, 2020 17:09
@westonruter westonruter removed this from the v1.6 milestone May 2, 2020
@westonruter westonruter added this to the v1.6 milestone Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Signed the Google CLA dependencies Pull requests that update a dependency file Infrastructure Changes impacting testing infrastructure or build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants