Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt-in all @wordpress packages imports via DEWP #2055

Merged
merged 6 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .externalized.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["@woocommerce/components","@woocommerce/customer-effort-score","@woocommerce/data","@woocommerce/navigation","@woocommerce/settings","@wordpress/api-fetch","@wordpress/data","@wordpress/data-controls","@wordpress/date","@wordpress/deprecated","@wordpress/dom","@wordpress/element","@wordpress/hooks","@wordpress/html-entities","@wordpress/i18n","@wordpress/is-shallow-equal","@wordpress/keycodes","@wordpress/primitives","@wordpress/priority-queue","@wordpress/url","extracted/@wordpress/components","lodash","moment","react","react-dom"]
["@woocommerce/components","@woocommerce/customer-effort-score","@woocommerce/data","@woocommerce/navigation","@woocommerce/settings","@wordpress/api-fetch","@wordpress/components","@wordpress/compose","@wordpress/data","@wordpress/data-controls","@wordpress/date","@wordpress/deprecated","@wordpress/dom","@wordpress/element","@wordpress/hooks","@wordpress/html-entities","@wordpress/i18n","@wordpress/primitives","@wordpress/url","lodash","moment","react","react-dom"]
2 changes: 1 addition & 1 deletion js/src/attribute-mapping/attribute-mapping-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Flex } from 'extracted/@wordpress/components';
import { Flex } from '@wordpress/components';
import { format as formatDate } from '@wordpress/date';

/**
Expand Down
7 changes: 1 addition & 6 deletions js/src/attribute-mapping/attribute-mapping-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { Pagination, Table, TablePlaceholder } from '@woocommerce/components';
import {
CardBody,
CardFooter,
Flex,
FlexItem,
} from 'extracted/@wordpress/components';
import { CardBody, CardFooter, Flex, FlexItem } from '@wordpress/components';
import { useEffect } from '@wordpress/element';
import { recordEvent } from '@woocommerce/tracks';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/account-card/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { Flex, FlexItem, FlexBlock } from 'extracted/@wordpress/components';
import { Flex, FlexItem, FlexBlock } from '@wordpress/components';
import GridiconPhone from 'gridicons/dist/phone';
import { Icon, store as storeIcon } from '@wordpress/icons';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-button/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Button } from 'extracted/@wordpress/components';
import { Button } from '@wordpress/components';
import { Spinner } from '@woocommerce/components';
import { recordEvent } from '@woocommerce/tracks';
import classnames from 'classnames';
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-input-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import classnames from 'classnames';
import { __, sprintf } from '@wordpress/i18n';
import { forwardRef } from '@wordpress/element';
import { __experimentalInputControl as InputControl } from 'extracted/@wordpress/components';
import { __experimentalInputControl as InputControl } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-modal/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Modal } from 'extracted/@wordpress/components';
import { Modal } from '@wordpress/components';
import classnames from 'classnames';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-radio-content-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import { RadioControl } from 'extracted/@wordpress/components';
import { RadioControl } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-select-control/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { SelectControl } from 'extracted/@wordpress/components';
import { SelectControl } from '@wordpress/components';
import classNames from 'classnames';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-standalone-toggle-control/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { ToggleControl } from 'extracted/@wordpress/components';
import { ToggleControl } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-sub-nav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { Fragment } from '@wordpress/element';
import { NavigableMenu } from 'extracted/@wordpress/components';
import { NavigableMenu } from '@wordpress/components';
import { Link } from '@woocommerce/components';
import classnames from 'classnames';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-tab-nav/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { NavigableMenu } from 'extracted/@wordpress/components';
import { NavigableMenu } from '@wordpress/components';
import { Link } from '@woocommerce/components';
import classnames from 'classnames';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/app-tooltip/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { Tooltip } from 'extracted/@wordpress/components';
import { Tooltip } from '@wordpress/components';
import { Children } from '@wordpress/element';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/connected-icon-label/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { Flex, FlexItem } from 'extracted/@wordpress/components';
import { Flex, FlexItem } from '@wordpress/components';
import GridiconCheckmarkCircle from 'gridicons/dist/checkmark-circle';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
import { parsePhoneNumberFromString as parsePhoneNumber } from 'libphonenumber-js';
import { __ } from '@wordpress/i18n';
import { useState, useEffect } from '@wordpress/element';
import {
Flex,
FlexItem,
FlexBlock,
RadioControl,
} from 'extracted/@wordpress/components';
import { Flex, FlexItem, FlexBlock, RadioControl } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useState, useEffect, useRef } from '@wordpress/element';
import { CardDivider } from 'extracted/@wordpress/components';
import { CardDivider } from '@wordpress/components';
import { Spinner } from '@woocommerce/components';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { useState, useEffect, useRef } from '@wordpress/element';
import { Flex } from 'extracted/@wordpress/components';
import { Flex } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import {
useRef,
createInterpolateElement,
} from '@wordpress/element';
import { Notice } from 'extracted/@wordpress/components';
import { Flex } from 'extracted/@wordpress/components';
import { Notice, Flex } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useRef, createInterpolateElement } from '@wordpress/element';
import { CardDivider } from 'extracted/@wordpress/components';
import { CardDivider } from '@wordpress/components';
import { Spinner } from '@woocommerce/components';
import { update as updateIcon } from '@wordpress/icons';
import { getPath, getQuery } from '@woocommerce/navigation';
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/different-currency-notice.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Notice } from 'extracted/@wordpress/components';
import { Notice } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/faqs-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Panel, PanelBody, PanelRow } from 'extracted/@wordpress/components';
import { Panel, PanelBody, PanelRow } from '@wordpress/components';
import { recordEvent } from '@woocommerce/tracks';
import classnames from 'classnames';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { RadioControl } from 'extracted/@wordpress/components';
import { RadioControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { useState, createInterpolateElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { CardDivider } from 'extracted/@wordpress/components';
import { CardDivider } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { ExternalLink } from 'extracted/@wordpress/components';
import { ExternalLink } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { CheckboxControl } from 'extracted/@wordpress/components';
import { CheckboxControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { createInterpolateElement, useState } from '@wordpress/element';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { CardDivider } from 'extracted/@wordpress/components';
import { CardDivider } from '@wordpress/components';
import { useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { CardDivider, Notice } from 'extracted/@wordpress/components';
import { CardDivider, Notice } from '@wordpress/components';
import { noop } from 'lodash';
import { getSetting } from '@woocommerce/settings'; // eslint-disable-line import/no-unresolved
// The above is an unpublished package, delivered with WC, we use Dependency Extraction Webpack Plugin to import it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { CardDivider } from 'extracted/@wordpress/components';
import { CardDivider } from '@wordpress/components';
import { getSetting } from '@woocommerce/settings'; // eslint-disable-line import/no-unresolved
// The above is an unpublished package, delivered with WC, we use Dependency Extraction Webpack Plugin to import it.
// See https://github.com/woocommerce/woocommerce-admin/issues/7781
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { CheckboxControl } from 'extracted/@wordpress/components';
import { CheckboxControl } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { createInterpolateElement, useState } from '@wordpress/element';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/help-popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import classnames from 'classnames';
import { __ } from '@wordpress/i18n';
import { Popover } from 'extracted/@wordpress/components';
import { Popover } from '@wordpress/components';
import { useState } from '@wordpress/element';
import GridiconHelpOutline from 'gridicons/dist/help-outline';
import { recordEvent } from '@woocommerce/tracks';
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/paid-ads/asset-group/asset-group-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useRef, useEffect, Fragment } from '@wordpress/element';
import { SelectControl } from 'extracted/@wordpress/components';
import { SelectControl } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { Tip } from 'extracted/@wordpress/components';
import { Tip } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/paid-ads/asset-group/final-url-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n';
import classnames from 'classnames';
import { useState } from '@wordpress/element';
import { ExternalLink } from 'extracted/@wordpress/components';
import { ExternalLink } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/paid-ads/assetSpecs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __, _x, sprintf } from '@wordpress/i18n';
import { ExternalLink } from 'extracted/@wordpress/components';
import { ExternalLink } from '@wordpress/components';
import { Fragment, createInterpolateElement } from '@wordpress/element';

/**
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/paid-ads/audience-section.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { SelectControl } from 'extracted/@wordpress/components';
import { SelectControl } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/paid-ads/billing-card/billing-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import Gridiconcheckmark from 'gridicons/dist/checkmark';
import { Flex, FlexBlock } from 'extracted/@wordpress/components';
import { Flex, FlexBlock } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { ExternalLink } from 'extracted/@wordpress/components';
import { ExternalLink } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __, sprintf } from '@wordpress/i18n';
import { createInterpolateElement } from '@wordpress/element';
import { Tip } from 'extracted/@wordpress/components';
import { Tip } from '@wordpress/components';
import GridiconNoticeOutline from 'gridicons/dist/notice-outline';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { useRef } from '@wordpress/element';
import { Flex, FlexItem, FlexBlock } from 'extracted/@wordpress/components';
import { Flex, FlexItem, FlexBlock } from '@wordpress/components';
import GridiconChevronLeft from 'gridicons/dist/chevron-left';
import GridiconChevronRight from 'gridicons/dist/chevron-right';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { Flex } from 'extracted/@wordpress/components';
import { Flex } from '@wordpress/components';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion js/src/components/pre-launch-check-item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PanelBody,
PanelRow,
CheckboxControl,
} from 'extracted/@wordpress/components';
} from '@wordpress/components';
import { recordEvent } from '@woocommerce/tracks';
import { useRef } from '@wordpress/element';

Expand Down
2 changes: 1 addition & 1 deletion js/src/components/tree-select-control/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { noop } from 'lodash';
import { Flex } from 'extracted/@wordpress/components';
import { Flex } from '@wordpress/components';
import { Icon, chevronUp, chevronDown } from '@wordpress/icons';
import classnames from 'classnames';

Expand Down
7 changes: 0 additions & 7 deletions js/src/css/shared/_gutenberg-components.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
// Scope the old styles of core components to GLA pages to avoid styling conflicts with other non-GLA pages.
.gla-admin-page {
// WP 6.1 Compatibility (@wordpress/components 21.0.6 imported by @woocommerce/components)
// The style of `DatePicker` component was significantly changed as per the new implementations.
// This import could be removed after:
// - It's fixed from @woocommerce/components
// - or @wordpress/components is changed to be imported via (WC)DEWP
@import "node_modules/@wordpress/components/src/date-time/date/datepicker"; /* stylelint-disable-line no-invalid-position-at-import-rule */

.components-button {
// Hack to show correct font color for disabled primary destructive button.
// The color style is copied from https://github.com/WordPress/gutenberg/blob/%40wordpress/components%4012.0.8/packages/components/src/button/style.scss#L67-L72
Expand Down
Loading
Loading