Skip to content

Commit

Permalink
Merge branch 'trunk' into fix/improve-performance-render_block_core_t…
Browse files Browse the repository at this point in the history
…emplate_part
  • Loading branch information
spacedmonkey committed Jun 19, 2023
2 parents 3ada4a6 + 4b180ab commit bb8fa91
Show file tree
Hide file tree
Showing 1,319 changed files with 31,133 additions and 15,635 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const restrictedImports = [
'invoke',
'isArray',
'isBoolean',
'isEmpty',
'isEqual',
'isFinite',
'isFunction',
Expand All @@ -109,6 +110,7 @@ const restrictedImports = [
'maxBy',
'memoize',
'merge',
'mergeWith',
'negate',
'noop',
'nth',
Expand Down
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
/packages/prettier-config @ntwb @gziolo
/packages/scripts @gziolo @ntwb @nerrad @ajitbohra @ryanwelcher
/packages/stylelint-config @ntwb
/test/e2e @kevin940726
/test/e2e @kevin940726 @Mamaduka

# UI Components
/packages/components @ajitbohra
Expand Down Expand Up @@ -125,7 +125,7 @@
/packages/report-flaky-tests @kevin940726

# wp-env
/packages/env @noahtallen @ObliviousHarmony
/packages/env @noahtallen @ObliviousHarmony @t-hamano

# PHP
/lib @spacedmonkey
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ jobs:
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf "wp/$WP_MAJOR" "$PREVIOUS_RELEASE_BRANCH" "$CURRENT_RELEASE_BRANCH" --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf "wp/$WP_MAJOR" "$PREVIOUS_RELEASE_BRANCH" "$CURRENT_RELEASE_BRANCH" --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Compare performance with base branch
if: github.event_name == 'push'
# The base hash used here need to be a commit that is compatible with the current WP version
# The current one is debd225d007f4e441ceec80fbd6fa96653f94737 and it needs to be updated every WP major release.
# The current one is 843a3053aca918bb10b939be28e676f8e71b751b and it needs to be updated every WP major release.
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
run: |
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
./bin/plugin/cli.js perf $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
./bin/plugin/cli.js perf $GITHUB_SHA 843a3053aca918bb10b939be28e676f8e71b751b --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Compare performance with custom branches
if: github.event_name == 'workflow_dispatch'
Expand All @@ -88,7 +88,7 @@ jobs:
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
run: |
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%ct")
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA debd225d007f4e441ceec80fbd6fa96653f94737 $COMMITTED_AT
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 843a3053aca918bb10b939be28e676f8e71b751b $COMMITTED_AT
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,12 @@ jobs:

- name: Docker container debug information
run: |
npm run wp-env run tests-mysql "mysql --version"
npm run wp-env run tests-wordpress "php --version"
npm run wp-env run tests-wordpress "php -m"
npm run wp-env run tests-wordpress "php -i"
npm run wp-env run tests-wordpress "/var/www/html/wp-content/plugins/gutenberg/vendor/bin/phpunit --version"
npm run wp-env run tests-wordpress "locale -a"
npm run wp-env run tests-mysql mysql -- --version
npm run wp-env run tests-wordpress php -- --version
npm run wp-env run tests-wordpress php -m
npm run wp-env run tests-wordpress php -i
npm run wp-env run tests-wordpress /var/www/html/wp-content/plugins/gutenberg/vendor/bin/phpunit -- --version
npm run wp-env run tests-wordpress locale -a
- name: Running single site unit tests
if: ${{ ! matrix.multisite }}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Welcome to the development hub for the WordPress Gutenberg project!

The block editor introduces a modular approach to pages and posts: each piece of content in the editor, from a paragraph to an image gallery to a headline, is its own block. And just like physical blocks, WordPress blocks can be added, arranged, and rearranged, allowing WordPress users to create media-rich pages in a visually intuitive way -- and without work-arounds like shortcodes or custom HTML.

The block editor first became available in December 2018, and we're still hard at work refining the experience, creating more and better blocks, and laying the groundwork for the next three phases of work. The Gutenberg plugin gives you the latest version of the block editor so you can join us in testing bleeding-edge features, start playing with blocks, and maybe get inspired to build your own.
The block editor first became available in December 2018, and we're still hard at work refining the experience, creating more and better blocks, and laying the groundwork for the next three phases of work. The Gutenberg plugin gives you the latest version of the block editor, so you can join us in testing bleeding-edge features, start playing with blocks, and maybe get inspired to build your own.

Check out the [Ways to keep up with Gutenberg & Full Site Editing (FSE)](https://make.wordpress.org/core/2020/05/20/ways-to-keep-up-with-full-site-editing-fse/)

Expand All @@ -31,7 +31,7 @@ Get hands on: check out the [block editor live demo](https://wordpress.org/guten

- **User Documentation:** See the [WordPress Editor documentation](https://wordpress.org/documentation/article/wordpress-block-editor/) for detailed docs on using the editor as an author creating posts and pages.

- **User Support:** If you have run into an issue, you should check the [Support Forums first](https://wordpress.org/support/forums/). The forums are a great place to get help. If you have a bug to report, please [submit it to the Gutenberg repository](https://github.com/wordpress/gutenberg/issues). Please search prior to creating a new bug to confirm its not a duplicate.
- **User Support:** If you have run into an issue, you should check the [Support Forums first](https://wordpress.org/support/forums/). The forums are a great place to get help. If you have a bug to report, please [submit it to the Gutenberg repository](https://github.com/wordpress/gutenberg/issues). Please search prior to creating a new bug to confirm it's not a duplicate.

### Developing for Gutenberg

Expand All @@ -41,7 +41,7 @@ Review the [Create a Block tutorial](/docs/getting-started/create-block/README.m

### Contribute to Gutenberg

Gutenberg is an open-source project and welcomes all contributors from code to design, and from documentation to triage. The project is built by many contributors and volunteers and we'd love your help building it.
Gutenberg is an open-source project and welcomes all contributors from code to design, and from documentation to triage. The project is built by many contributors and volunteers, and we'd love your help building it.

See the [Contributors Handbook](https://developer.wordpress.org/block-editor/contributors/) for all the details on how you can contribute.

Expand Down
10 changes: 8 additions & 2 deletions bin/api-docs/gen-block-lib-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,20 @@ function readBlockJSON( filename ) {
? processObjWithInnerKeys( augmentSupports( blockjson.supports ) )
: [];
const attributes = getTruthyKeys( blockjson.attributes );
const parent = blockjson.parent
? '\n' + `- **Parent:** ${ blockjson.parent.join( ', ' ) }`
: '';
const experimental = blockjson.__experimental
? '\n' + `- **Experimental:** ${ blockjson.__experimental }`
: '';

return `
## ${ blockjson.title }
${ blockjson.description } ([Source](${ sourcefile }))
- **Name:** ${ blockjson.name }
- **Category:** ${ blockjson.category }
- **Name:** ${ blockjson.name }${ experimental }
- **Category:** ${ blockjson.category }${ parent }
- **Supports:** ${ supportsList.sort().join( ', ' ) }
- **Attributes:** ${ attributes.sort().join( ', ' ) }
`;
Expand Down
2 changes: 1 addition & 1 deletion bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ build_files=$(
build/block-library/blocks/*.php \
build/block-library/blocks/*/block.json \
build/block-library/blocks/*/*.{js,js.map,css,asset.php} \
build/block-library/interactive-blocks/*.js \
build/block-library/interactivity/*.{js,js.map,asset.php} \
build/edit-widgets/blocks/*/block.json \
build/widgets/blocks/*.php \
build/widgets/blocks/*/block.json \
Expand Down
121 changes: 0 additions & 121 deletions bin/generate-public-grammar.js

This file was deleted.

65 changes: 65 additions & 0 deletions bin/list-experimental-api-matches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/sh

# Generate a Markdown-formatted list of experimental APIs found across our
# packages and lib, providing GitHub search links for each match.
#
# Experimental APIs must be regularly audited, particularly in the context of
# major WordPress releases. This script allows release leads to generate a list
# to share in release issues.
#
# @see example audit issue for WordPress 6.2:
# https://github.com/WordPress/gutenberg/issues/47196

# Exit if any command fails.
set -e

# Change to the root directory.
cd "$(dirname "$0")"
cd ..

# POSIX: prefer standard grep over rg. Git is assumed present (ls-files), but
# could be replaced with find.
grep_experimental_apis() {
git ls-files packages/* lib \
| grep -E '\.(js|ts|jsx|tsx|php)$' \
| grep -v __tests__ \
| xargs grep -Eo '__experimental\w+'
}

# For each line as `<filepath>:<match>`, rewrite as `<package> <match>`.
namespace() {
awk -F: '
{ print module($1), $2 }
function module(path) {
n = split(path, parts, "/")
if (parts[1] == "lib") return "lib"
return parts[1] "/" parts[2]
}'
}

# Like uniq, but applied across packages: if `__experimentalFoo` appears in
# packages A and B, only keep the occurrence under A.
compact() {
sort | uniq | awk '{
if (known_api[$2]) next
known_api[$2] = 1
print
}'
}

# Output a heading for each package and a link for each experimental API.
format() {
awk '{
if (prev_dir != $1) {
if (NR > 1) print ""
printf "## `%s`\n", $1
prev_dir = $1
}
printf "[`%s`](/WordPress/gutenberg/search?q=%s)\n", $2, $2
}'
}

grep_experimental_apis \
| namespace \
| compact \
| format
3 changes: 1 addition & 2 deletions bin/packages/get-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
const fs = require( 'fs' );
const path = require( 'path' );
const { isEmpty } = require( 'lodash' );

/**
* Absolute path to packages directory.
Expand Down Expand Up @@ -43,7 +42,7 @@ function hasModuleField( file ) {
return false;
}

return ! isEmpty( pkg.module );
return !! pkg.module;
}

/**
Expand Down
Loading

0 comments on commit bb8fa91

Please sign in to comment.