From 70ed0edb3f43c2bb1a57e884ddc33b0b128e8132 Mon Sep 17 00:00:00 2001 From: Anton Vlasenko Date: Wed, 27 Oct 2021 19:01:15 +0200 Subject: [PATCH] Don't use wordpress/warning package for displaying the warning because it's not going to work in the browser. It's intended to be used with Node. --- package-lock.json | 1 - packages/edit-navigation/package.json | 1 - packages/edit-navigation/src/store/actions.js | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91a96087fc4b2f..7406b3ff8eb91e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19120,7 +19120,6 @@ "@wordpress/media-utils": "file:packages/media-utils", "@wordpress/notices": "file:packages/notices", "@wordpress/url": "file:packages/url", - "@wordpress/warning": "file:packages/warning", "classnames": "^2.3.1", "lodash": "^4.17.21", "rememo": "^3.0.0", diff --git a/packages/edit-navigation/package.json b/packages/edit-navigation/package.json index 11978459356f40..d541570e968389 100644 --- a/packages/edit-navigation/package.json +++ b/packages/edit-navigation/package.json @@ -49,7 +49,6 @@ "@wordpress/media-utils": "file:../media-utils", "@wordpress/notices": "file:../notices", "@wordpress/url": "file:../url", - "@wordpress/warning": "file:../warning", "classnames": "^2.3.1", "lodash": "^4.17.21", "rememo": "^3.0.0", diff --git a/packages/edit-navigation/src/store/actions.js b/packages/edit-navigation/src/store/actions.js index bbdad5619ed284..9d2d6e7e04a0b0 100644 --- a/packages/edit-navigation/src/store/actions.js +++ b/packages/edit-navigation/src/store/actions.js @@ -9,7 +9,6 @@ import { difference, zip } from 'lodash'; import { __, sprintf } from '@wordpress/i18n'; import { store as noticesStore } from '@wordpress/notices'; import { store as coreDataStore } from '@wordpress/core-data'; -import { default as logWarning } from '@wordpress/warning'; /** * Internal dependencies @@ -210,7 +209,7 @@ const batchUpdateMenuItems = ( navigationBlock, menuId ) => async ( { .filter( ( { block } ) => ! isBlockSupportedInNav( block ) ) .map( ( { block } ) => block.name ); if ( unsupportedMenuItems.length ) { - logWarning( + window.console.warn( sprintf( // translators: %s: Name of block (i.e. core/legacy-widget) __(