Skip to content

Commit

Permalink
Clarify block.json comment
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Jul 14, 2023
1 parent b2db932 commit 4a7fc46
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/file/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function gutenberg_block_core_file_update_interactive_view_script( $metadata ) {
function render_block_core_file( $attributes, $content, $block ) {
$should_load_view_script = ! empty( $attributes['displayPreview'] );
$view_js_file = 'wp-block-file-view';
wp_script_add_data( $view_js_file, 'strategy', 'defer' ); // TODO: This should be specified in block.json.
wp_script_add_data( $view_js_file, 'strategy', 'defer' ); // TODO: This should be able to be specified in block.json. See Core-54018.
// If the script already exists, there is no point in removing it from viewScript.
if ( ! wp_script_is( $view_js_file ) ) {
$script_handles = $block->block_type->view_script_handles;
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ function render_block_core_navigation( $attributes, $content, $block ) {
$should_load_view_script = count( array_filter( $needed_script_map ) ) > 0;
} else {
foreach ( $needed_script_map as $view_script_handle => $is_view_script_needed ) {
wp_script_add_data( $view_script_handle, 'strategy', 'async' ); // TODO: This should be specified in block.json.
wp_script_add_data( $view_script_handle, 'strategy', 'async' ); // TODO: This should be able to be specified in block.json. See Core-54018.

// If the script already exists, there is no point in removing it from viewScript.
if ( wp_script_is( $view_script_handle ) ) {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function render_block_core_search( $attributes, $content, $block ) {
}

$view_js_file = 'wp-block-search-view';
wp_script_add_data( $view_js_file, 'strategy', 'async' ); // TODO: This should be specified in block.json.
wp_script_add_data( $view_js_file, 'strategy', 'async' ); // TODO: This should be able to be specified in block.json. See Core-54018.
$should_load_view_script = false;

if ( $input->next_tag() ) {
Expand Down

0 comments on commit 4a7fc46

Please sign in to comment.