Skip to content

Commit 5a15f6d

Browse files
Merge branch 'trunk' of github.com:karthick-murugan/gutenberg into add/manage-categories-command
2 parents c42b7ef + c239ca4 commit 5a15f6d

File tree

2,048 files changed

+52738
-43702
lines changed

Some content is hidden

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

2,048 files changed

+52738
-43702
lines changed

.eslintrc.js

+17-23
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,6 @@
44
const glob = require( 'glob' ).sync;
55
const { join } = require( 'path' );
66

7-
/**
8-
* Internal dependencies
9-
*/
10-
const { version } = require( './package' );
11-
12-
/**
13-
* Regular expression string matching a SemVer string with equal major/minor to
14-
* the current package version. Used in identifying deprecations.
15-
*
16-
* @type {string}
17-
*/
18-
const majorMinorRegExp =
19-
version.replace( /\.\d+$/, '' ).replace( /[\\^$.*+?()[\]{}|]/g, '\\$&' ) +
20-
'(\\.\\d+)?';
21-
227
/**
238
* The list of patterns matching files used only for development purposes.
249
*
@@ -92,14 +77,6 @@ const restrictedSyntax = [
9277
'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]',
9378
message: 'Path access on WordPress dependencies is not allowed.',
9479
},
95-
{
96-
selector:
97-
'CallExpression[callee.name="deprecated"] Property[key.name="version"][value.value=/' +
98-
majorMinorRegExp +
99-
'/]',
100-
message:
101-
'Deprecated functions must be removed before releasing this version.',
102-
},
10380
{
10481
selector:
10582
'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',
@@ -137,6 +114,11 @@ const restrictedSyntax = [
137114
message:
138115
'Avoid truthy checks on length property rendering, as zero length is rendered verbatim.',
139116
},
117+
{
118+
selector:
119+
'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] > Literal[value=/^toggle\\b/i]',
120+
message: "Avoid using the verb 'Toggle' in translatable strings",
121+
},
140122
];
141123

142124
/** `no-restricted-syntax` rules for components. */
@@ -156,6 +138,7 @@ module.exports = {
156138
'plugin:eslint-comments/recommended',
157139
'plugin:storybook/recommended',
158140
],
141+
plugins: [ 'react-compiler' ],
159142
globals: {
160143
wp: 'off',
161144
globalThis: 'readonly',
@@ -222,6 +205,15 @@ module.exports = {
222205
definedTags: [ 'jest-environment' ],
223206
},
224207
],
208+
'react-compiler/react-compiler': [
209+
'error',
210+
{
211+
environment: {
212+
enableTreatRefLikeIdentifiersAsRefs: true,
213+
validateRefAccessDuringRender: false,
214+
},
215+
},
216+
],
225217
},
226218
overrides: [
227219
{
@@ -236,6 +228,7 @@ module.exports = {
236228
'import/no-unresolved': 'off',
237229
'import/named': 'off',
238230
'@wordpress/data-no-store-string-literals': 'off',
231+
'react-compiler/react-compiler': 'off',
239232
},
240233
},
241234
{
@@ -551,6 +544,7 @@ module.exports = {
551544
{
552545
files: [ 'packages/interactivity*/src/**' ],
553546
rules: {
547+
'react-compiler/react-compiler': 'off',
554548
'react/react-in-jsx-scope': 'error',
555549
},
556550
},

.github/CODEOWNERS

+3-6
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
/packages/data-controls @nerrad
1414

1515
# Blocks
16-
/packages/block-library @ajitbohra
17-
/packages/block-library/src/gallery @geriux
16+
/packages/block-library @ajitbohra @fabiankaegy
17+
/packages/block-library/src/gallery
1818
/packages/block-library/src/comment-template @michalczaplinski
1919
/packages/block-library/src/comments @michalczaplinski
2020
/packages/block-library/src/table-of-contents @ZebulanStanphill
@@ -138,10 +138,7 @@
138138
/lib/compat/*/html-api @dmsnell
139139
/lib/experimental/rest-api.php @timothybjacobs
140140
/lib/experimental/class-wp-rest-* @timothybjacobs
141-
/lib/experimental/class-wp-rest-block-editor-settings-controller.php @timothybjacobs @spacedmonkey @geriux
142-
143-
# Native
144-
/packages/components/src/mobile/global-styles-context @geriux
141+
/lib/experimental/class-wp-rest-block-editor-settings-controller.php @timothybjacobs @spacedmonkey
145142

146143
# Native (Unowned)
147144
*.native.js

.github/PULL_REQUEST_TEMPLATE.md

+6
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ https://github.com/WordPress/gutenberg/blob/trunk/CONTRIBUTING.md -->
2020
<!-- How can you test the changes by using the keyboard only? Please note, this is required for PRs that change the user interface (UI). This ensures the PR can be tested for any possible accessibility regressions. -->
2121

2222
## Screenshots or screencast <!-- if applicable -->
23+
24+
<!-- If you would like to upload screenshots, feel free to use the table below when it is useful to show the difference between before and after the change. -->
25+
26+
|Before|After|
27+
|-|-|
28+
|<!-- Before screenshot here -->|<!-- After screenshot here -->|

.github/workflows/gradle-wrapper-validation.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ jobs:
66
name: 'Validation'
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9+
- name: Checkout repository
10+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1011
with:
1112
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
12-
- uses: gradle/wrapper-validation-action@v3
13+
- name: Validate checksums
14+
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2

.github/workflows/performance.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ jobs:
6969
- name: Compare performance with base branch
7070
if: github.event_name == 'push'
7171
# The base hash used here need to be a commit that is compatible with the current WP version
72-
# The current one is 5f4c9c853b15092ed885d5280edefb973c37d9e9 and it needs to be updated every WP major release.
72+
# The current one is c7722262e65a3f4d0f1a2d1ad29eccb2069509e4 and it needs to be updated every WP major release.
7373
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
7474
run: |
7575
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)
7676
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
7777
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
78-
./bin/plugin/cli.js perf $GITHUB_SHA 5f4c9c853b15092ed885d5280edefb973c37d9e9 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
78+
./bin/plugin/cli.js perf $GITHUB_SHA c7722262e65a3f4d0f1a2d1ad29eccb2069509e4 --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
7979
8080
- name: Compare performance with custom branches
8181
if: github.event_name == 'workflow_dispatch'
@@ -101,7 +101,7 @@ jobs:
101101
CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }}
102102
run: |
103103
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
104-
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA 5f4c9c853b15092ed885d5280edefb973c37d9e9 $COMMITTED_AT
104+
./bin/log-performance-results.js $CODEHEALTH_PROJECT_TOKEN trunk $GITHUB_SHA c7722262e65a3f4d0f1a2d1ad29eccb2069509e4 $COMMITTED_AT
105105
106106
- name: Archive debug artifacts (screenshots, HTML snapshots)
107107
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3

.github/workflows/rnmobile-android-runner.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ concurrency:
1414

1515
jobs:
1616
test:
17-
runs-on: macos-12
18-
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
17+
runs-on: macos-13
18+
if: false
19+
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
1920
strategy:
2021
matrix:
2122
native-test-name: [gutenberg-editor-rendering]
@@ -28,7 +29,7 @@ jobs:
2829
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
2930

3031
- name: Use desired version of Java
31-
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
32+
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
3233
with:
3334
distribution: 'corretto'
3435
java-version: '17'
@@ -37,7 +38,7 @@ jobs:
3738
uses: ./.github/setup-node
3839

3940
- name: Restore tests setup cache
40-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
41+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
4142
with:
4243
path: |
4344
~/.appium
@@ -47,12 +48,12 @@ jobs:
4748
run: npm run native test:e2e:setup
4849

4950
- name: Gradle cache
50-
uses: gradle/actions/setup-gradle@473878a77f1b98e2b5ac4af93489d1656a80a5ed # v4.2.0
51+
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
5152

5253
# AVD cache disabled as it caused emulator termination to hang indefinitely.
5354
# https://github.com/ReactiveCircus/android-emulator-runner/issues/385
5455
# - name: AVD cache
55-
# uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
56+
# uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5657
# id: avd-cache
5758
# with:
5859
# path: |

.github/workflows/rnmobile-ios-runner.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ concurrency:
1414

1515
jobs:
1616
test:
17-
runs-on: macos-12
18-
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
17+
runs-on: macos-13
18+
if: false
19+
#if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
1920
strategy:
2021
matrix:
2122
xcode: ['14.2']
@@ -27,7 +28,7 @@ jobs:
2728
with:
2829
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
2930

30-
- uses: ruby/setup-ruby@a2bbe5b1b236842c1cb7dd11e8e3b51e0a616acc # v1.202.0
31+
- uses: ruby/setup-ruby@7a6302104fbeea3c6aaa43b1b91e08f7d6623279 # v1.209.0
3132
with:
3233
# `.ruby-version` file location
3334
working-directory: packages/react-native-editor/ios
@@ -42,7 +43,7 @@ jobs:
4243
uses: ./.github/setup-node
4344

4445
- name: Restore tests setup cache
45-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
46+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
4647
with:
4748
path: |
4849
~/.appium
@@ -55,15 +56,15 @@ jobs:
5556
run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt
5657

5758
- name: Restore build cache
58-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
59+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5960
with:
6061
path: |
6162
packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app
6263
packages/react-native-editor/ios/build/WDA
6364
key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }}
6465

6566
- name: Restore pods cache
66-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
67+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
6768
with:
6869
path: |
6970
packages/react-native-editor/ios/Pods

.github/workflows/storybook-check.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check Storybook build
2+
3+
on: pull_request
4+
5+
# Cancels all previous workflow runs for pull requests that have not completed.
6+
concurrency:
7+
# The concurrency group contains the workflow name and the branch name for pull requests
8+
# or the commit hash for any other events.
9+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
22+
23+
- name: Setup Node.js and install dependencies
24+
uses: ./.github/setup-node
25+
26+
- name: Build Storybook
27+
run: npm run storybook:build
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Sync Gutenberg plugin assets to WordPress.org plugin repo
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
paths:
8+
- assets/**
9+
10+
jobs:
11+
sync-assets:
12+
name: Sync assets to WordPress.org plugin repo
13+
runs-on: ubuntu-latest
14+
environment: wp.org plugin
15+
env:
16+
PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg'
17+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
18+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
19+
20+
steps:
21+
- name: Check out Gutenberg assets folder from WP.org plugin repo
22+
run: |
23+
svn checkout "$PLUGIN_REPO_URL/assets" \
24+
--username "$SVN_USERNAME" --password "$SVN_PASSWORD"
25+
26+
- name: Delete everything
27+
run: find assets -type f -not -path 'assets/.svn/*' -delete
28+
29+
- name: Checkout assets from current release
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
with:
32+
sparse-checkout: |
33+
assets
34+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
35+
path: git
36+
37+
- name: Copy files from git checkout to svn working copy
38+
run: cp -R git/assets/* assets
39+
40+
- name: Commit the updated assets
41+
working-directory: ./assets
42+
run: |
43+
svn st | awk '/^?/ {print $2}' | xargs -r svn add
44+
svn st | awk '/^!/ {print $2}' | xargs -r svn rm
45+
svn commit . \
46+
-m "Sync assets for commit $GITHUB_SHA" \
47+
--no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \
48+
--config-option=servers:global:http-timeout=600

.github/workflows/unit-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
# dependency versions are installed and cached.
189189
##
190190
- name: Set up PHP
191-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
191+
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
192192
with:
193193
php-version: '${{ matrix.php }}'
194194
ini-file: development
@@ -283,7 +283,7 @@ jobs:
283283
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
284284

285285
- name: Set up PHP
286-
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2.31.1
286+
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2.32.0
287287
with:
288288
php-version: '7.4'
289289
coverage: none
@@ -296,7 +296,7 @@ jobs:
296296
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> $GITHUB_OUTPUT
297297

298298
- name: Cache PHPCS scan cache
299-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
299+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
300300
with:
301301
path: .cache/phpcs.json
302302
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-phpcs-cache-${{ hashFiles('**/composer.json', 'phpcs.xml.dist') }}

0 commit comments

Comments
 (0)