Skip to content

Commit

Permalink
Remove 4.1 deprecated features (WordPress#10732)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and antpb committed Oct 26, 2018
1 parent 921dbf4 commit eca3395
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 38 deletions.
4 changes: 0 additions & 4 deletions docs/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1545,10 +1545,6 @@ Returns an action object resetting the template validity.

* isValid: template validity flag.

### checkTemplateValidity

Returns an action object to check the template validity.

### synchronizeTemplate

Returns an action object synchronize the template with the list of blocks
Expand Down
6 changes: 5 additions & 1 deletion packages/editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 4.1.0 (Unreleased)
## 5.0.0 (Unreleased)

### Breaking Changes

- The `checkTemplateValidity` action has been removed. Validity is verified automatically upon block reset.

### Deprecations

Expand Down
20 changes: 0 additions & 20 deletions packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
getDefaultBlockName,
createBlock,
} from '@wordpress/blocks';
import deprecated from '@wordpress/deprecated';

/**
* Returns an action object used in signalling that editor has initialized with
Expand Down Expand Up @@ -368,25 +367,6 @@ export function setTemplateValidity( isValid ) {
};
}

/**
* Returns an action object to check the template validity.
*
* @return {Object} Action object.
*/
export function checkTemplateValidity() {
// TODO: Hello future deprecation remover. Please ensure also to remove all
// references to CHECK_TEMPLATE_VALIDITY, notably its effect handler.
deprecated( 'checkTemplateValidity action (`core/editor`)', {
version: '4.1',
plugin: 'Gutenberg',
hint: 'Validity is verified automatically upon block reset.',
} );

return {
type: 'CHECK_TEMPLATE_VALIDITY',
};
}

/**
* Returns an action object synchronize the template with the list of blocks
*
Expand Down
13 changes: 0 additions & 13 deletions packages/editor/src/store/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,6 @@ export default {

return resetBlocks( updatedBlockList );
},
CHECK_TEMPLATE_VALIDITY( action, { getState } ) {
const state = getState();
const blocks = getBlocks( state );
const template = getTemplate( state );
const templateLock = getTemplateLock( state );
const isValid = (
! template ||
templateLock !== 'all' ||
doBlocksMatchTemplate( blocks, template )
);

return setTemplateValidity( isValid );
},
FETCH_REUSABLE_BLOCKS: ( action, store ) => {
fetchReusableBlocks( action, store );
},
Expand Down

0 comments on commit eca3395

Please sign in to comment.