Skip to content

Commit 2ee7ede

Browse files
adamsilversteinramonjdellatrix
authored andcommitted
Gate client-side media processing as plugin-only (#76700)
Client-side media processing (wasm-vips) adds ~16MB of WASM to the build. Gate the feature behind IS_GUTENBERG_PLUGIN so it remains active in the plugin but is excluded when syncing to WordPress core, reducing core bundle size. Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
1 parent c7c7759 commit 2ee7ede

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lib/client-assets.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,9 @@ function gutenberg_enqueue_latex_to_mathml_loader() {
448448
*
449449
* @see packages/vips/src/loader.ts
450450
*/
451-
add_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_vips_loader' );
451+
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
452+
add_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_vips_loader' );
453+
}
452454
function gutenberg_enqueue_vips_loader() {
453455
wp_enqueue_script_module( '@wordpress/vips/loader' );
454456
}

lib/media/load.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
* @package gutenberg
66
*/
77

8+
// Client-side media processing is currently plugin-only while the feature matures.
9+
if ( ! defined( 'IS_GUTENBERG_PLUGIN' ) || ! IS_GUTENBERG_PLUGIN ) {
10+
return;
11+
}
12+
813
if ( ! gutenberg_is_client_side_media_processing_enabled() ) {
914
return;
1015
}

0 commit comments

Comments
 (0)