Skip to content

Commit

Permalink
Ensure gutenberg assets are enqueued only when needed (#36983)
Browse files Browse the repository at this point in the history
  • Loading branch information
heavyweight authored and matticbot committed Apr 19, 2024
1 parent ce426b7 commit 22dd90f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 22 deletions.
16 changes: 8 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This is an alpha version! The changes listed here are not final.
### Fixed
- Added completed callback for site_launched task
- Fixed a WP.com only issue that forced the Themes menu to always point to Calypso even when the classic interface was set
- Fix enqueuing editor styles
- Themes: Fixed an issue that was showing a broken Theme Showcase action in the active theme details

## [5.24.0] - 2024-04-15
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@ public function remove_strict_kses_filters() {

/**
* Enqueue the assets for the Gutenberg editor
*
* In case the page is singular and has comment closed or front page with comments closed we avoid the enqueueing
*/
public function enqueue_assets() {
if (
! ( is_singular() && comments_open() )
&& ! ( is_front_page() && is_page() && comments_open() )
) {
return;
}

$vbe_cache_buster = filemtime( ABSPATH . '/widgets.wp.com/verbum-block-editor/build_meta.json' );

wp_enqueue_style(
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-assets",
"reference": "3c0124efb5ee2eac5b0c87e75036989e79e7a3eb"
"reference": "d8a2c8bac42753edaed22a61434571bab8e0a780"
},
"require": {
"automattic/jetpack-constants": "^2.0.1",
Expand Down Expand Up @@ -76,7 +76,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-constants",
"reference": "f63ddaa6f9e6fde9bf7cd91876b100d7f570316f"
"reference": "1d1184b3fab21351569b6be7ba408cf4eed10b41"
},
"require": {
"php": ">=7.0"
Expand Down Expand Up @@ -125,12 +125,12 @@
},
{
"name": "automattic/jetpack-mu-wpcom",
"version": "5.24.1-alpha.1713532538",
"version_normalized": "5.24.1.0-alpha1713532538",
"version": "5.24.1-alpha.1713535527",
"version_normalized": "5.24.1.0-alpha1713535527",
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-mu-wpcom",
"reference": "683395924ad39c5afc96607c8ed44d72ef679910"
"reference": "5b8b474bfdd7a9ec1aaf810584af6e79b190067e"
},
"require": {
"automattic/jetpack-assets": "^2.1.8-alpha",
Expand Down Expand Up @@ -203,7 +203,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/jetpack-status",
"reference": "0d76dd85400bd23638a5dcb0783697e3886ede67"
"reference": "6754fca57387bfdbde636583978cfb58db81f47c"
},
"require": {
"automattic/jetpack-constants": "^2.0.1",
Expand Down Expand Up @@ -259,7 +259,7 @@
"dist": {
"type": "path",
"url": "/tmp/jetpack-build/Automattic/scheduled-updates",
"reference": "b647fda6da312f086e0f790b8239556f7290a0e1"
"reference": "7c371c5a370db3a505d3eb7c5d551c5f8b243d67"
},
"require": {
"php": ">=7.0"
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'automattic/jetpack-assets' => array(
'pretty_version' => '2.1.8-alpha.1713286100',
'version' => '2.1.8.0-alpha1713286100',
'reference' => '3c0124efb5ee2eac5b0c87e75036989e79e7a3eb',
'reference' => 'd8a2c8bac42753edaed22a61434571bab8e0a780',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-assets',
'aliases' => array(),
Expand All @@ -22,16 +22,16 @@
'automattic/jetpack-constants' => array(
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'reference' => 'f63ddaa6f9e6fde9bf7cd91876b100d7f570316f',
'reference' => '1d1184b3fab21351569b6be7ba408cf4eed10b41',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-constants',
'aliases' => array(),
'dev_requirement' => false,
),
'automattic/jetpack-mu-wpcom' => array(
'pretty_version' => '5.24.1-alpha.1713532538',
'version' => '5.24.1.0-alpha1713532538',
'reference' => '683395924ad39c5afc96607c8ed44d72ef679910',
'pretty_version' => '5.24.1-alpha.1713535527',
'version' => '5.24.1.0-alpha1713535527',
'reference' => '5b8b474bfdd7a9ec1aaf810584af6e79b190067e',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-mu-wpcom',
'aliases' => array(),
Expand All @@ -49,7 +49,7 @@
'automattic/jetpack-status' => array(
'pretty_version' => '2.2.2-alpha.1713286100',
'version' => '2.2.2.0-alpha1713286100',
'reference' => '0d76dd85400bd23638a5dcb0783697e3886ede67',
'reference' => '6754fca57387bfdbde636583978cfb58db81f47c',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/jetpack-status',
'aliases' => array(),
Expand All @@ -58,7 +58,7 @@
'automattic/scheduled-updates' => array(
'pretty_version' => '0.8.0-alpha.1713517576',
'version' => '0.8.0.0-alpha1713517576',
'reference' => 'b647fda6da312f086e0f790b8239556f7290a0e1',
'reference' => '7c371c5a370db3a505d3eb7c5d551c5f8b243d67',
'type' => 'jetpack-library',
'install_path' => __DIR__ . '/../automattic/scheduled-updates',
'aliases' => array(),
Expand Down

0 comments on commit 22dd90f

Please sign in to comment.