Skip to content

Commit

Permalink
Block API: Deprecate property source type
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jun 25, 2018
1 parent 6694c5e commit c3b8354
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions blocks/api/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { castArray, mapValues, omit } from 'lodash';
* WordPress dependencies
*/
import { autop } from '@wordpress/autop';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand Down Expand Up @@ -70,6 +71,12 @@ export function matcherFromSource( sourceConfig ) {
case 'attribute':
return attr( sourceConfig.selector, sourceConfig.attribute );
case 'property':
deprecated( '`property` source', {
version: '3.3',
alternative: 'equivalent `text`, `html`, or `attribute` source, or comment attribute',
plugin: 'Gutenberg',
} );

return prop( sourceConfig.selector, sourceConfig.property );
case 'html':
return html( sourceConfig.selector );
Expand Down
1 change: 1 addition & 0 deletions docs/reference/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Gutenberg's deprecation policy is intended to support backwards-compatibility fo
- `blocks.BlockEdit` filter removed. Please use `editor.BlockEdit` instead.
- `blocks.BlockListBlock` filter removed. Please use `editor.BlockListBlock` instead.
- `blocks.MediaUpload` filter removed. Please use `editor.MediaUpload` instead.
- `property` source removed. Please use equivalent `text`, `html`, or `attribute` source, or comment attribute instead.

## 3.2.0

Expand Down

0 comments on commit c3b8354

Please sign in to comment.