-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Account for upcoming changes in styles metadata in WordPress 5.9 #36327
Conversation
This tests as advertised for me. ✅ Code changes LGTM. Types match the core PR. I'd be inclined to approve this one however it might be good to get a second opinion first. |
74fa25e
to
4888cb5
Compare
4888cb5
to
a05a7a2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, works as expected 👍
a05a7a2
to
262e33e
Compare
I see a few e2e test failures. They're related to multi-block selection FAIL specs/editor/various/multi-block-selection.test.js (127.811 s)
● Multi-block selection › should return original focus after failed multi selection attempt
expect(received).toMatchSnapshot()
Snapshot name: `Multi-block selection should return original focus after failed multi selection attempt 1`
- Snapshot - 1
+ Received + 1
<!-- wp:paragraph -->
- <p>2</p>
+ <p>12</p>
<!-- /wp:paragraph -->
506 | await page.keyboard.press( 'Backspace' );
507 |
> 508 | expect( await getEditedPostContent() ).toMatchSnapshot();
| ^
509 | } );
510 |
511 | it( 'should preserve dragged selection on move', async () => {
at Object.<anonymous> (specs/editor/various/multi-block-selection.test.js:508:42)
at runMicrotasks (<anonymous>)
● Multi-block selection › should clear selection when clicking next to blocks
Execution context was destroyed, most likely because of a navigation.
555 |
556 | // Wait for blocks to have updated asynchronously.
> 557 | await page.evaluate( () => new Promise( window.requestIdleCallback ) );
| ^
558 | await testNativeSelection();
559 | expect( await getSelectedFlatIndices() ).toEqual( [] );
560 |
at rewriteError (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:322:15)
at runMicrotasks (<anonymous>)
at ExecutionContext._evaluateInternal (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:271:7)
at ExecutionContext.evaluate (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:140:12)
at Object.<anonymous> (specs/editor/various/multi-block-selection.test.js:557:3)
● Multi-block selection › should select all from empty selection
Execution context was destroyed, most likely because of a navigation.
at rewriteError (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:322:15)
at runMicrotasks (<anonymous>)
at ExecutionContext._evaluateInternal (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:271:7)
at ExecutionContext.evaluate (../../node_modules/puppeteer-core/src/common/ExecutionContext.ts:140:12)
at emulateSelectAll (../e2e-test-utils/build/@wordpress/e2e-test-utils/src/press-key-with-modifier.js:25:2)
at pressKeyWithModifier (../e2e-test-utils/build/@wordpress/e2e-test-utils/src/press-key-with-modifier.js:145:10)
at Object.<anonymous> (specs/editor/various/multi-block-selection.test.js:727:3) |
262e33e
to
c56bf45
Compare
Yeah, I see the same... but they don't feel related. 🤔 Update: The same tests fail after rebasing the PR so it has to be related to the changes here somehow |
4273e42
to
cd13eb3
Compare
Executing
|
cd13eb3
to
af21791
Compare
It seems to me that theme styles are no longer loaded. |
af21791
to
67001f9
Compare
67001f9
to
e22e9d7
Compare
e22e9d7
to
12e4913
Compare
See WordPress/wordpress-develop#1831
In that core PR, we're updating the metadata to "signal" the different kinds of styles the client may receive. It was
globalStyles
in WordPress 5.8 and it'll betheme
orpresets
in WordPress 5.9. This PR makes Gutenberg work with any of those core versions.How to test
Load the editor and verify that the styles look as expected for the following setups: