diff --git a/plugin/assets/src/polyfills/index.js b/plugin/assets/src/polyfills/index.js deleted file mode 100644 index e3e26050a..000000000 --- a/plugin/assets/src/polyfills/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { useSelect } from '@wordpress/data'; -import '@wordpress/escape-html'; -// eslint-disable-next-line @wordpress/no-unsafe-wp-apis -import { __experimentalRichText } from '@wordpress/rich-text'; - -if ( - window.wp && - window.wp.richText && - ! window.wp.richText.__experimentalRichText -) { - window.wp.richText.__experimentalRichText = __experimentalRichText; -} - -if ( window.wp && window.wp.data && ! window.wp.data.useSelect ) { - window.wp.data.useSelect = useSelect; -} diff --git a/plugin/php/class-block-types.php b/plugin/php/class-block-types.php index 9be6715a5..c6dcd69ef 100644 --- a/plugin/php/class-block-types.php +++ b/plugin/php/class-block-types.php @@ -165,17 +165,6 @@ public function enqueue_block_editor_assets() { } } - // Enqueue RichText polyfills if WP version is less than 5.3. - if ( version_compare( get_bloginfo( 'version' ), '5.3', '<' ) ) { - wp_enqueue_script( - 'material-block-editor-polyfills', - $this->plugin->asset_url( 'assets/js/polyfills.js' ), - [], - $version, - false - ); - } - wp_register_script( 'material-block-editor-js', $this->plugin->asset_url( 'assets/js/block-editor.js' ), diff --git a/webpack.config.js b/webpack.config.js index 24801930c..58996ba3a 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -121,16 +121,6 @@ const assets = { './plugin/assets/css/src/getting-started.css', ], }, - { - name: 'Polyfills', - chunk: 'polyfills', - entry: [ './plugin/assets/src/polyfills/index.js' ], - toBundle: [ - '@wordpress/data', - '@wordpress/escape-html', - '@wordpress/rich-text', - ], - }, { name: 'Settings', chunk: 'settings',