Skip to content

Commit

Permalink
Framework: Move wp-polyfill-ecmascript override to scripts registrati…
Browse files Browse the repository at this point in the history
…on (#11696)
  • Loading branch information
aduth authored and tofumatt committed Nov 9, 2018
1 parent 4dcf338 commit 77bd99b
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,24 @@ function gutenberg_register_scripts_and_styles() {
$live_reload_url
);
}

// Temporary backward compatibility for `wp-polyfill-ecmascript`, which has
// since been absorbed into `wp-polyfill`.
//
// [TODO][REMOVEME] To be removed in Gutenberg v4.5.
gutenberg_override_script(
'wp-polyfill-ecmascript',
null,
array(
'wp-polyfill',
'wp-deprecated',
)
);
wp_script_add_data(
'wp-polyfill-ecmascript',
'data',
'wp.deprecated( "wp-polyfill-ecmascript script handle", { plugin: "Gutenberg", version: "4.5" } );'
);
}
add_action( 'wp_enqueue_scripts', 'gutenberg_register_scripts_and_styles', 5 );
add_action( 'admin_enqueue_scripts', 'gutenberg_register_scripts_and_styles', 5 );
Expand Down Expand Up @@ -980,20 +998,6 @@ function gutenberg_register_vendor_scripts() {
'wp-polyfill',
'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.0.0/polyfill' . $suffix . '.js'
);
// Ensure backwards compatibility after renaming to wp-polyfill.
gutenberg_override_script(
'wp-polyfill-ecmascript',
null,
array(
'wp-polyfill',
'wp-deprecated',
)
);
wp_script_add_data(
'wp-polyfill-ecmascript',
'data',
'wp.deprecated( "wp-polyfill-ecmascript script handle", { plugin: "Gutenberg", version: "4.5" } );'
);
}

/**
Expand Down

0 comments on commit 77bd99b

Please sign in to comment.