Skip to content

Commit

Permalink
Block editor: refactor effect.js to controls (#27298)
Browse files Browse the repository at this point in the history
* Remove effects.js from block-editor

* Update package-lock.json

* Remove refx

* Fix speaking on multi selection
  • Loading branch information
adamziel authored Dec 4, 2020
1 parent 440530b commit 87171eb
Show file tree
Hide file tree
Showing 11 changed files with 399 additions and 459 deletions.
23 changes: 11 additions & 12 deletions docs/designers-developers/developers/data/data-core-block-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1134,10 +1134,6 @@ _Parameters_
- _firstBlockClientId_ `string`: Client ID of the first block to merge.
- _secondBlockClientId_ `string`: Client ID of the second block to merge.

_Returns_

- `Object`: Action object.

<a name="moveBlocksDown" href="#moveBlocksDown">#</a> **moveBlocksDown**

Undocumented declaration.
Expand Down Expand Up @@ -1179,10 +1175,6 @@ _Parameters_
- _start_ `string`: First block of the multi selection.
- _end_ `string`: Last block of the multiselection.

_Returns_

- `Object`: Action object.

<a name="receiveBlocks" href="#receiveBlocks">#</a> **receiveBlocks**

Returns an action object used in signalling that blocks have been received.
Expand Down Expand Up @@ -1273,10 +1265,6 @@ _Parameters_

- _blocks_ `Array`: Array of blocks.

_Returns_

- `Object`: Action object.

<a name="resetSelection" href="#resetSelection">#</a> **resetSelection**

Returns an action object used in signalling that selection state should be
Expand Down Expand Up @@ -1540,5 +1528,16 @@ _Returns_

- `Object`: Action object

<a name="validateBlocksToTemplate" href="#validateBlocksToTemplate">#</a> **validateBlocksToTemplate**

Block validity is a function of blocks state (at the point of a
reset) and the template setting. As a compromise to its placement
across distinct parts of state, it is implemented here as a side-
effect of the block reset action.

_Parameters_

- _blocks_ `Array`: Array of blocks.


<!-- END TOKEN(Autogenerated actions|../../../../packages/block-editor/src/store/actions.js) -->
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion packages/block-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@wordpress/components": "file:../components",
"@wordpress/compose": "file:../compose",
"@wordpress/data": "file:../data",
"@wordpress/data-controls": "file:../data-controls",
"@wordpress/deprecated": "file:../deprecated",
"@wordpress/dom": "file:../dom",
"@wordpress/element": "file:../element",
Expand Down Expand Up @@ -62,7 +63,6 @@
"react-spring": "^8.0.19",
"reakit": "1.1.0",
"redux-multi": "^0.1.12",
"refx": "^3.0.0",
"rememo": "^3.0.0",
"tinycolor2": "^1.4.1",
"traverse": "^0.6.6"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { createHigherOrderComponent } from '@wordpress/compose';
* Internal dependencies
*/
import { storeConfig } from '../../store';
import applyMiddlewares from '../../store/middlewares';

const withRegistryProvider = createHigherOrderComponent(
( WrappedComponent ) => {
Expand All @@ -28,12 +27,10 @@ const withRegistryProvider = createHigherOrderComponent(
const [ subRegistry, setSubRegistry ] = useState( null );
useEffect( () => {
const newRegistry = createRegistry( {}, registry );
const store = newRegistry.registerStore(
newRegistry.registerStore(
'core/block-editor',
storeConfig
);
// This should be removed after the refactoring of the effects to controls.
applyMiddlewares( store );
setSubRegistry( newRegistry );
}, [ registry ] );

Expand Down
Loading

0 comments on commit 87171eb

Please sign in to comment.