Skip to content

Commit 34f8cf7

Browse files
committed
merge trunk into feature branch
2 parents 6fec45f + ee36ebc commit 34f8cf7

File tree

479 files changed

+12255
-5792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

479 files changed

+12255
-5792
lines changed

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const restrictedImports = [
110110
'maxBy',
111111
'memoize',
112112
'merge',
113+
'mergeWith',
113114
'negate',
114115
'noop',
115116
'nth',

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
/packages/prettier-config @ntwb @gziolo
7979
/packages/scripts @gziolo @ntwb @nerrad @ajitbohra @ryanwelcher
8080
/packages/stylelint-config @ntwb
81-
/test/e2e @kevin940726
81+
/test/e2e @kevin940726 @Mamaduka
8282

8383
# UI Components
8484
/packages/components @ajitbohra

.github/workflows/performance.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ jobs:
5959
- name: Compare performance with base branch
6060
if: github.event_name == 'push'
6161
# The base hash used here need to be a commit that is compatible with the current WP version
62-
# The current one is 843a3053aca918bb10b939be28e676f8e71b751b and it needs to be updated every WP major release.
62+
# The current one is 34af5829ac9edb31833167ff6a3b51bea982999c and it needs to be updated every WP major release.
6363
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
6464
run: |
6565
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
6666
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
6767
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
68-
./bin/plugin/cli.js perf $GITHUB_SHA 843a3053aca918bb10b939be28e676f8e71b751b --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
68+
./bin/plugin/cli.js perf $GITHUB_SHA 34af5829ac9edb31833167ff6a3b51bea982999c --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
6969
7070
- name: Compare performance with custom branches
7171
if: github.event_name == 'workflow_dispatch'
@@ -88,7 +88,7 @@ jobs:
8888
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
8989
run: |
9090
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%ct")
91-
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 843a3053aca918bb10b939be28e676f8e71b751b $COMMITTED_AT
91+
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 34af5829ac9edb31833167ff6a3b51bea982999c $COMMITTED_AT
9292
9393
- name: Archive debug artifacts (screenshots, HTML snapshots)
9494
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2

.wp-env.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"wp-content/plugins/gutenberg": ".",
99
"wp-content/mu-plugins": "./packages/e2e-tests/mu-plugins",
1010
"wp-content/plugins/gutenberg-test-plugins": "./packages/e2e-tests/plugins",
11-
"wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes"
11+
"wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes",
12+
"wp-content/themes/gutenberg-test-themes/twentytwentyone": "https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip",
13+
"wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip"
1214
}
1315
}
1416
}

bin/packages/lint-staged-typecheck.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* External dependencies
33
*/
4-
const _ = require( 'lodash' );
54
const path = require( 'path' );
65
const fs = require( 'fs' );
76
const execa = require( 'execa' );
@@ -18,12 +17,14 @@ const tscPath = path.join( repoRoot, 'node_modules', '.bin', 'tsc' );
1817
const changedFiles = process.argv.slice( 2 );
1918

2019
// Transform changed files to package directories containing tsconfig.json.
21-
const changedPackages = _.uniq(
22-
changedFiles.map( ( fullPath ) => {
23-
const relativePath = path.relative( repoRoot, fullPath );
24-
return path.join( ...relativePath.split( path.sep ).slice( 0, 2 ) );
25-
} )
26-
).filter( ( packageRoot ) =>
20+
const changedPackages = [
21+
...new Set(
22+
changedFiles.map( ( fullPath ) => {
23+
const relativePath = path.relative( repoRoot, fullPath );
24+
return path.join( ...relativePath.split( path.sep ).slice( 0, 2 ) );
25+
} )
26+
),
27+
].filter( ( packageRoot ) =>
2728
fs.existsSync( path.join( packageRoot, 'tsconfig.json' ) )
2829
);
2930

bin/plugin/commands/performance.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,6 @@ async function runPerformanceTests( branches, options ) {
337337
performanceTestDirectory,
338338
'test/emptytheme'
339339
),
340-
'https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip',
341-
'https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip',
342340
],
343341
env: {
344342
tests: {
@@ -352,6 +350,15 @@ async function runPerformanceTests( branches, options ) {
352350
performanceTestDirectory,
353351
'packages/e2e-tests/plugins'
354352
),
353+
'wp-content/themes/gutenberg-test-themes':
354+
path.join(
355+
performanceTestDirectory,
356+
'test/gutenberg-test-themes'
357+
),
358+
'wp-content/themes/gutenberg-test-themes/twentytwentyone':
359+
'https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip',
360+
'wp-content/themes/gutenberg-test-themes/twentytwentythree':
361+
'https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip',
355362
},
356363
},
357364
},

changelog.txt

+13-92
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,9 @@
11
== Changelog ==
22

3-
= 16.0.0-rc.4 =
4-
5-
6-
7-
## Changelog
8-
9-
### Various
10-
11-
- Post title: Fix autofocus when iframed. ([51367](https://github.com/WordPress/gutenberg/pull/51367))
12-
13-
14-
15-
16-
## Contributors
17-
18-
The following contributors merged PRs in this release:
19-
20-
@ellatrix
21-
22-
23-
= 16.0.0-rc.3 =
24-
25-
26-
27-
## Changelog
28-
29-
### Bug Fixes
30-
31-
#### Block Library
32-
- Post Template: Output number of columns as classname for backwards compatibility. ([51358](https://github.com/WordPress/gutenberg/pull/51358))
33-
- Query: Fix deprecation error when migrating layout. ([51311](https://github.com/WordPress/gutenberg/pull/51311))
34-
35-
#### Global Styles
36-
- Global styles revisions: Ensure redirect runs once for back button. ([51316](https://github.com/WordPress/gutenberg/pull/51316))
37-
38-
### Code Quality
39-
40-
#### Site Editor
41-
- Rename 'page content lock' to 'page content focus'. ([51280](https://github.com/WordPress/gutenberg/pull/51280))
42-
43-
44-
## Contributors
45-
46-
The following contributors merged PRs in this release:
47-
48-
@andrewserong @noisysocks @ramonjd
49-
50-
51-
= 16.0.0-rc.2 =
52-
53-
54-
55-
## Changelog
56-
57-
### Bug Fixes
58-
59-
#### Global Styles
60-
- Global styles revisions: Ensure redirect runs once for back button. ([51316](https://github.com/WordPress/gutenberg/pull/51316))
61-
62-
#### Block Library
63-
- Query: Fix deprecation error when migrating layout. ([51311](https://github.com/WordPress/gutenberg/pull/51311))
64-
65-
66-
### Code Quality
67-
68-
#### Site Editor
69-
- Rename 'page content lock' to 'page content focus'. ([51280](https://github.com/WordPress/gutenberg/pull/51280))
70-
71-
72-
### Various
73-
74-
- Post title: Fix autofocus when iframed. ([51331](https://github.com/WordPress/gutenberg/pull/51331))
75-
76-
77-
78-
79-
## Contributors
80-
81-
The following contributors merged PRs in this release:
82-
83-
@andrewserong @ellatrix @noisysocks @ramonjd
84-
85-
86-
= 16.0.0-rc.1 =
3+
= 16.0.0 =
874

885
## Changelog
896

90-
### Features
91-
92-
- Add the ability to create a new page in the Site Editor. ([50565](https://github.com/WordPress/gutenberg/pull/50565))
93-
- Add the ability to focus on editing a page's content vs the page's template. ([50857](https://github.com/WordPress/gutenberg/pull/50857))
94-
- Add page details to the Site Editor sidebar. ([50767](https://github.com/WordPress/gutenberg/pull/50767))
95-
967
### Enhancements
978

989
#### Block Editor
@@ -104,15 +15,18 @@ The following contributors merged PRs in this release:
10415
- List View: Allow dragging outside the immediate area by passing down a dropZoneElement. ([50726](https://github.com/WordPress/gutenberg/pull/50726))
10516
- List View: Append when dragging into collapsed blocks. ([50936](https://github.com/WordPress/gutenberg/pull/50936))
10617
- Reinstate Text control outside of settings in Link Control. ([50957](https://github.com/WordPress/gutenberg/pull/50957))
18+
- Update the document title in the template mode of the post editor. ([50864](https://github.com/WordPress/gutenberg/pull/50864))
10719
- Use "Save" instead of "Apply" in Link Control. ([50964](https://github.com/WordPress/gutenberg/pull/50964))
10820
- Use checkbox for `Open in new tab` within Link Control. ([50961](https://github.com/WordPress/gutenberg/pull/50961))
10921
- Visually hide the LinkControl initial/results heading. ([50977](https://github.com/WordPress/gutenberg/pull/50977))
110-
- Update the document title in the template mode of the post editor. ([50864](https://github.com/WordPress/gutenberg/pull/50864))
11122

11223
#### Site Editor
11324
- Add `delete` action for pages in navigation sidebar. ([51101](https://github.com/WordPress/gutenberg/pull/51101))
25+
- Add page details to the Site Editor sidebar. ([50767](https://github.com/WordPress/gutenberg/pull/50767))
11426
- Add Paragraph prompt to Post Content when empty. ([50623](https://github.com/WordPress/gutenberg/pull/50623))
11527
- Add template actions in site editor navigation sidebar. ([51054](https://github.com/WordPress/gutenberg/pull/51054))
28+
- Add the ability to create a new page in the Site Editor. ([50565](https://github.com/WordPress/gutenberg/pull/50565))
29+
- Add the ability to focus on editing a page's content vs the page's template. ([50857](https://github.com/WordPress/gutenberg/pull/50857))
11630
- Directly save if only changing current context. ([50567](https://github.com/WordPress/gutenberg/pull/50567))
11731
- Disable block supports derived design tools when Blocking Editing Mode is not `default`. ([50912](https://github.com/WordPress/gutenberg/pull/50912))
11832
- DocumentActions: Animate between page and template mode. ([51224](https://github.com/WordPress/gutenberg/pull/51224))
@@ -160,11 +74,12 @@ The following contributors merged PRs in this release:
16074
#### Block Editor
16175
- Add inert attribute to disabled blocks that have only disabled descendants. ([51079](https://github.com/WordPress/gutenberg/pull/51079))
16276
- Fix multi-entity multi-property undo redo. ([50911](https://github.com/WordPress/gutenberg/pull/50911))
77+
- Hide the save draft button for published posts. ([51193](https://github.com/WordPress/gutenberg/pull/51193))
16378
- Iframe enqueuing: Add editorStyle and warning. ([50091](https://github.com/WordPress/gutenberg/pull/50091))
16479
- Improvements to how blocks with a 'disabled' editing mode behave. ([51148](https://github.com/WordPress/gutenberg/pull/51148))
16580
- Link Control: Add missing translation. ([51081](https://github.com/WordPress/gutenberg/pull/51081))
81+
- Make sure post content always has correct layout. ([51431](https://github.com/WordPress/gutenberg/pull/51431))
16682
- Navigation: Memoize link value passed to the LinkControl. ([51155](https://github.com/WordPress/gutenberg/pull/51155))
167-
- Hide the save draft button for published posts. ([51193](https://github.com/WordPress/gutenberg/pull/51193))
16883

16984
#### Site Editor
17085
- Browse Mode: Remove horizontal scrollbar during screen transitions. ([51189](https://github.com/WordPress/gutenberg/pull/51189))
@@ -179,11 +94,15 @@ The following contributors merged PRs in this release:
17994
- Freeform/Shortcode: Prevent blocks from converting HTML entities. ([51123](https://github.com/WordPress/gutenberg/pull/51123))
18095
- Navigation: Apply color classes to the navigation container element. ([50968](https://github.com/WordPress/gutenberg/pull/50968))
18196
- Post Template: Set block context via filter. ([50313](https://github.com/WordPress/gutenberg/pull/50313))
97+
- Post Template: Output number of columns as classname for backwards compatibility. ([51358](https://github.com/WordPress/gutenberg/pull/51358))
98+
- Post Title: Fix autofocus when iframed. ([51331](https://github.com/WordPress/gutenberg/pull/51331), [51367](https://github.com/WordPress/gutenberg/pull/51367))
99+
- Query: Fix deprecation error when migrating layout. ([51311](https://github.com/WordPress/gutenberg/pull/51311))
182100
- Term Description: Handle default margin styles. ([51137](https://github.com/WordPress/gutenberg/pull/51137))
183101

184102
#### Global Styles
185103
- DimensionsPanel: Fix site editor error on Columns block level screen. ([51252](https://github.com/WordPress/gutenberg/pull/51252))
186104
- Fluid typography: Ensure max viewport width is used in the editor. ([51146](https://github.com/WordPress/gutenberg/pull/51146))
105+
- Global styles revisions: Ensure redirect runs once for back button. ([51316](https://github.com/WordPress/gutenberg/pull/51316))
187106
- SpacingSizesControl: Fix problem with the slider position being reset when saving global styles. ([50956](https://github.com/WordPress/gutenberg/pull/50956))
188107
- Styles Screen: Ensure variations previews will render in mobile viewports. ([51080](https://github.com/WordPress/gutenberg/pull/51080))
189108

@@ -199,6 +118,7 @@ The following contributors merged PRs in this release:
199118

200119
#### Accessibility
201120
- Add aria labels to the focal point picker component. ([50993](https://github.com/WordPress/gutenberg/pull/50993))
121+
- Block Toolbar: Fix text only label for locked blocks. ([50944](https://github.com/WordPress/gutenberg/pull/50944))
202122
- Fix Navigable Toolbar initialIndex. ([51181](https://github.com/WordPress/gutenberg/pull/51181))
203123
- Fix screen readers not announcing updated `aria-describedby` in Firefox. ([51035](https://github.com/WordPress/gutenberg/pull/51035))
204124
- Link Control: Fix the 'Save' button's disabled state. ([51117](https://github.com/WordPress/gutenberg/pull/51117))
@@ -261,6 +181,7 @@ The following contributors merged PRs in this release:
261181
- Remove legacy logic for `__unstableResolvedAssets`. ([51100](https://github.com/WordPress/gutenberg/pull/51100))
262182
- Remove outdated Babel spread optimization from selectors. ([50987](https://github.com/WordPress/gutenberg/pull/50987))
263183
- Remove the insert.ref field from insertUsage data. ([51130](https://github.com/WordPress/gutenberg/pull/51130))
184+
- Rename 'page content lock' to 'page content focus'. ([51280](https://github.com/WordPress/gutenberg/pull/51280))
264185
- Separate template screens in the Site Editor. ([51040](https://github.com/WordPress/gutenberg/pull/51040))
265186
- Writing flow: Fix tab into iframe. ([50955](https://github.com/WordPress/gutenberg/pull/50955))
266187

docs/contributors/code/react-native/integration-test-guide.md

+15-27
Original file line numberDiff line numberDiff line change
@@ -121,42 +121,32 @@ const radiusSlider = getByTestId( 'Slider Border Radius' );
121121

122122
Note that either a plain string or a regular expression can be passed into these queries. A regular expression is best for querying part of a string (e.g. any element whose accessibility label contains `Unsupported Block. Row 1`). Note that special characters such as `.` need to be escaped.
123123

124-
### Use of `waitFor`
124+
### Use of `find` queries
125125

126-
After rendering the components or firing an event, side effects might happen due to potential state updates so the element we’re looking for might not be yet rendered. In this case, we would need to wait for the element to be available and for this purpose, we can use the `waitFor` function, which periodically executes the provided callback to determine whether the element appeared or not.
126+
After rendering the components or firing an event, side effects might happen due to potential state updates so the element we’re looking for might not be yet rendered. In this case, we would need to wait for the element to be available and for this purpose, we can use the `find*` versions of query functions, which internally use `waitFor` and periodically check whether the element appeared or not.
127127

128128
Here are some examples:
129129

130130
```js
131-
const mediaLibraryButton = await waitFor( () =>
132-
getByText( 'WordPress Media Library' )
133-
);
131+
const mediaLibraryButton = await findByText( 'WordPress Media Library' );
134132
```
135133

136134
```js
137-
const missingBlock = await waitFor( () =>
138-
getByLabelText( /Unsupported Block\. Row 1/ )
139-
);
135+
const missingBlock = await findByLabelText( /Unsupported Block\. Row 1/ );
140136
```
141137

142138
```js
143-
const radiusSlider = await waitFor( () =>
144-
getByTestId( 'Slider Border Radius' )
145-
);
139+
const radiusSlider = await findByTestId( 'Slider Border Radius' );
146140
```
147141

148-
In most cases we’ll use the `waitFor` function, but it’s important to note that it should be restricted to those queries that actually require waiting for the element to be available.
149-
150-
NOTE: The `react-native-testing-library` package provides the `query*` and `find*` functions for this purpose too, but we should avoid using them for now because there’s a [known issue](https://github.com/callstack/react-native-testing-library/issues/379) that would make the test fail.
142+
In most cases we’ll use the `find*` functions, but it’s important to note that it should be restricted to those queries that actually require waiting for the element to be available.
151143

152144
### `within` queries
153145

154146
It’s also possible to query elements contained in other elements via the `within` function, here is an example:
155147

156148
```js
157-
const missingBlock = await waitFor( () =>
158-
getByLabelText( /Unsupported Block\. Row 1/ )
159-
);
149+
const missingBlock = await findByLabelText( /Unsupported Block\. Row 1/ );
160150
const translatedTableTitle = within( missingBlock ).getByText( 'Tabla' );
161151
```
162152

@@ -236,7 +226,7 @@ Here is an example of how to insert a Paragraph block:
236226

237227
```js
238228
// Open the inserter menu
239-
fireEvent.press( await waitFor( () => getByLabelText( 'Add block' ) ) );
229+
fireEvent.press( await findByLabelText( 'Add block' ) );
240230

241231
const blockList = getByTestId( 'InserterUI-Blocks' );
242232
// onScroll event used to force the FlatList to render all items
@@ -249,7 +239,7 @@ fireEvent.scroll( blockList, {
249239
} );
250240

251241
// Insert a Paragraph block
252-
fireEvent.press( await waitFor( () => getByText( `Paragraph` ) ) );
242+
fireEvent.press( await findByText( `Paragraph` ) );
253243
```
254244

255245
### Open block settings
@@ -259,7 +249,7 @@ The block settings can be accessed by tapping the "Open Settings" button after s
259249
```js
260250
fireEvent.press( block );
261251

262-
const settingsButton = await waitFor( () => getByLabelText( 'Open Settings' ) );
252+
const settingsButton = await findByLabelText( 'Open Settings' );
263253
fireEvent.press( settingsButton );
264254
```
265255

@@ -301,9 +291,7 @@ fireEvent.scroll( blockList, {
301291
Sliders found in bottom sheets should be queried using their `testID`:
302292

303293
```js
304-
const radiusSlider = await waitFor( () =>
305-
getByTestId( 'Slider Border Radius' )
306-
);
294+
const radiusSlider = await findByTestId( 'Slider Border Radius' );
307295
fireEvent( radiusSlider, 'valueChange', '30' );
308296
```
309297

@@ -314,8 +302,8 @@ Note that a slider’s `testID` is "Slider " + label. So for a slider with a lab
314302
One caveat when adding blocks is that if they contain inner blocks, these inner blocks are not rendered. The following example shows how we can make a Buttons block render its inner Button blocks (assumes we’ve already obtained a reference to the Buttons block as `buttonsBlock`):
315303

316304
```js
317-
const innerBlockListWrapper = await waitFor( () =>
318-
within( buttonsBlock ).getByTestId( 'block-list-wrapper' )
305+
const innerBlockListWrapper = await within( buttonsBlock ).findByTestId(
306+
'block-list-wrapper'
319307
);
320308
fireEvent( innerBlockListWrapper, 'layout', {
321309
nativeEvent: {
@@ -325,8 +313,8 @@ fireEvent( innerBlockListWrapper, 'layout', {
325313
},
326314
} );
327315

328-
const buttonInnerBlock = await waitFor( () =>
329-
within( buttonsBlock ).getByLabelText( /Button Block\. Row 1/ )
316+
const buttonInnerBlock = await within( buttonsBlock ).findByLabelText(
317+
/Button Block\. Row 1/
330318
);
331319
fireEvent.press( buttonInnerBlock );
332320
```

0 commit comments

Comments
 (0)