Skip to content

Commit

Permalink
Packages: Remove package import statements in favor of store object u…
Browse files Browse the repository at this point in the history
…sage (#27368)
  • Loading branch information
gziolo authored Nov 30, 2020
1 parent 02bc517 commit 7b5d1a7
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 16 deletions.
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/block-directory/src/store/actions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* WordPress dependencies
*/
import { store as blocksStore } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';
import { controls } from '@wordpress/data';
import { apiFetch } from '@wordpress/data-controls';
Expand Down Expand Up @@ -85,7 +86,7 @@ export function* installBlockType( block ) {

yield loadAssets( assets );
const registeredBlocks = yield controls.select(
'core/blocks',
blocksStore.name,
'getBlockTypes'
);
if ( ! registeredBlocks.some( ( i ) => i.name === block.name ) ) {
Expand Down
9 changes: 7 additions & 2 deletions packages/block-directory/src/store/test/actions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* WordPress dependencies
*/
import { store as blocksStore } from '@wordpress/blocks';

/**
* Internal dependencies
*/
Expand Down Expand Up @@ -80,7 +85,7 @@ describe( 'actions', () => {
expect( generator.next().value ).toEqual( {
args: [],
selectorName: 'getBlockTypes',
storeKey: 'core/blocks',
storeKey: blocksStore.name,
type: '@@data/SELECT',
} );

Expand Down Expand Up @@ -142,7 +147,7 @@ describe( 'actions', () => {
expect( generator.next().value ).toEqual( {
args: [],
selectorName: 'getBlockTypes',
storeKey: 'core/blocks',
storeKey: blocksStore.name,
type: '@@data/SELECT',
} );

Expand Down
2 changes: 0 additions & 2 deletions packages/block-editor/src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/**
* WordPress dependencies
*/
import '@wordpress/blocks';
import '@wordpress/rich-text';
import '@wordpress/keyboard-shortcuts';
import '@wordpress/notices';

/**
Expand Down
1 change: 0 additions & 1 deletion packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import '@wordpress/core-data';
import '@wordpress/notices';
import '@wordpress/block-editor';
import '@wordpress/reusable-blocks';
import {
registerBlockType,
setDefaultBlockName,
Expand Down
1 change: 0 additions & 1 deletion packages/edit-post/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@wordpress/notices": "file:../notices",
"@wordpress/plugins": "file:../plugins",
"@wordpress/primitives": "file:../primitives",
"@wordpress/reusable-blocks": "file:../reusable-blocks",
"@wordpress/url": "file:../url",
"@wordpress/viewport": "file:../viewport",
"@wordpress/warning": "file:../warning",
Expand Down
2 changes: 0 additions & 2 deletions packages/edit-post/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import '@wordpress/core-data';
import '@wordpress/block-editor';
import '@wordpress/editor';
import '@wordpress/keyboard-shortcuts';
import '@wordpress/reusable-blocks';
import '@wordpress/notices';
import {
registerCoreBlocks,
Expand Down
1 change: 0 additions & 1 deletion packages/edit-post/src/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import '@wordpress/core-data';
import '@wordpress/notices';
import '@wordpress/format-library';
import '@wordpress/reusable-blocks';
import { render } from '@wordpress/element';

/**
Expand Down
1 change: 0 additions & 1 deletion packages/edit-widgets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
__experimentalGetCoreBlocks,
__experimentalRegisterExperimentalCoreBlocks,
} from '@wordpress/block-library';
import '@wordpress/reusable-blocks';

/**
* Internal dependencies
Expand Down
3 changes: 0 additions & 3 deletions packages/editor/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
* WordPress dependencies
*/
import '@wordpress/block-editor';
import '@wordpress/blocks';
import '@wordpress/core-data';
import '@wordpress/keyboard-shortcuts';
import '@wordpress/notices';
import '@wordpress/reusable-blocks';
import '@wordpress/rich-text';

/**
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* WordPress dependencies
*/
import '@wordpress/block-editor';
import '@wordpress/blocks';
import '@wordpress/core-data';
import '@wordpress/rich-text';

Expand Down

0 comments on commit 7b5d1a7

Please sign in to comment.