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

Use wp_register_block_metadata_collection for block metadata perf improvements #543

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
yarn

- name: Build
run: yarn workspaces run build
run: |
yarn build
yarn build:theme:blocks-manifest

- name: Trim the repo down to just the theme
run: |
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"private": true,
"dependencies": {
"@wordpress/scripts": "27.1.0"
"@wordpress/scripts": "30.3.0"
},
"devDependencies": {
"@wordpress/env": "9.2.0"
Expand All @@ -20,6 +20,7 @@
"wp-env": "wp-env",
"build": "yarn workspaces run build",
"build:theme": "yarn workspace wporg-developer-2023 build",
"build:theme:blocks-manifest": "yarn workspace wporg-developer-2023 build-blocks-manifest",
"start:theme": "yarn workspace wporg-developer-2023 start",
"lint:css": "wp-scripts lint-style"
},
Expand Down
5 changes: 5 additions & 0 deletions source/wp-content/themes/wporg-developer-2023/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@
require __DIR__ . '/inc/block-hooks.php';

// Block files
wp_register_block_metadata_collection(
__DIR__ . '/build',
__DIR__ . '/build/blocks-manifest.php'
);

require_once __DIR__ . '/src/cli-command-table/block.php';
require_once __DIR__ . '/src/code-changelog/block.php';
require_once __DIR__ . '/src/code-deprecated/block.php';
Expand Down
3 changes: 2 additions & 1 deletion source/wp-content/themes/wporg-developer-2023/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"private": true,
"devDependencies": {
"@wordpress/eslint-plugin": "^17.7.0",
"@wordpress/scripts": "27.1.0"
"@wordpress/scripts": "30.3.0"
},
"eslintConfig": {
"extends": "../../../../.eslintrc.js"
Expand All @@ -17,6 +17,7 @@
},
"scripts": {
"build": "wp-scripts build",
"build-blocks-manifest": "wp-scripts build-blocks-manifest",
"start": "wp-scripts start",
"lint:js": "wp-scripts lint-js src",
"lint:css": "wp-scripts lint-style *.css src/**/*.scss",
Expand Down
Loading
Loading