Skip to content

Commit

Permalink
Framework: Drop deprecations slated for 3.0 removal (#7031)
Browse files Browse the repository at this point in the history
* Framework: Drop deprecations slated for 3.0 removal

* Framework: Update deprecations planned for 3.0
  • Loading branch information
aduth authored and gziolo committed May 31, 2018
1 parent cf019a1 commit 72f4ca8
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 103 deletions.
11 changes: 0 additions & 11 deletions core-blocks/index.js
Expand Up @@ -6,7 +6,6 @@ import {
setDefaultBlockName,
setUnknownTypeHandlerName,
} from '@wordpress/blocks';
import deprecated from '@wordpress/deprecated';

/**
* Internal dependencies
Expand Down Expand Up @@ -86,13 +85,3 @@ export const registerCoreBlocks = () => {
setDefaultBlockName( paragraph.name );
setUnknownTypeHandlerName( freeform.name );
};

// Backwards compatibility
wp.blocks.registerCoreBlocks = () => {
deprecated( 'wp.blocks.registerCoreBlocks', {
version: '3.0',
alternative: 'wp.coreBlocks.registerCoreBlocks',
plugin: 'Gutenberg',
} );
registerCoreBlocks();
};
48 changes: 0 additions & 48 deletions editor/components/rich-text/constants.js

This file was deleted.

42 changes: 0 additions & 42 deletions editor/components/rich-text/index.js
Expand Up @@ -24,7 +24,6 @@ import {
getRectangleFromRange,
getScrollContainer,
} from '@wordpress/dom';
import deprecated from '@wordpress/deprecated';
import { createBlobURL } from '@wordpress/blob';
import { keycodes } from '@wordpress/utils';
import { withInstanceId, withSafeTimeout, Slot } from '@wordpress/components';
Expand All @@ -41,7 +40,6 @@ import FormatToolbar from './format-toolbar';
import TinyMCE from './tinymce';
import { pickAriaProps } from './aria';
import patterns from './patterns';
import { EVENTS } from './constants';
import { withBlockEditContext } from '../block-edit/context';
import { domToFormat, valueToString } from './format';

Expand Down Expand Up @@ -161,23 +159,6 @@ export class RichText extends Component {
onSetup( editor ) {
this.editor = editor;

EVENTS.forEach( ( name ) => {
if ( ! this.props.hasOwnProperty( 'on' + name ) ) {
return;
}

deprecated( 'Raw TinyMCE event handlers for RichText', {
version: '3.0',
alternative: (
'Documented props, ancestor event handler, or onSetup ' +
'access to the internal editor instance event hub'
),
plugin: 'gutenberg',
} );

editor.on( name, this.proxyPropHandler( name ) );
} );

editor.on( 'init', this.onInit );
editor.on( 'NewBlock', this.onNewBlock );
editor.on( 'nodechange', this.onNodeChange );
Expand All @@ -204,29 +185,6 @@ export class RichText extends Component {
}
}

/**
* Allows prop event handlers to handle an event.
*
* Allow props an opportunity to handle the event, before default RichText
* behavior takes effect. Should the event be handled by a prop, it should
* `stopImmediatePropagation` on the event to stop continued event handling.
*
* @param {string} name The name of the event.
*
* @return {void} Void.
*/
proxyPropHandler( name ) {
return ( event ) => {
// Allow props an opportunity to handle the event, before default
// RichText behavior takes effect. Should the event be handled by a
// prop, it should `stopImmediatePropagation` on the event to stop
// continued event handling.
if ( 'function' === typeof this.props[ 'on' + name ] ) {
this.props[ 'on' + name ]( event );
}
};
}

onInit() {
this.registerCustomFormatters();

Expand Down
2 changes: 1 addition & 1 deletion editor/store/selectors.js
Expand Up @@ -25,7 +25,7 @@ import createSelector from 'rememo';
import { serialize, getBlockType, getBlockTypes, hasBlockSupport } from '@wordpress/blocks';
import { __ } from '@wordpress/i18n';
import { moment } from '@wordpress/date';
import { deprecated } from '@wordpress/utils';
import deprecated from '@wordpress/deprecated';

/***
* Module constants
Expand Down
1 change: 0 additions & 1 deletion lib/client-assets.php
Expand Up @@ -249,7 +249,6 @@ function gutenberg_register_scripts_and_styles() {
'wp-blocks',
'wp-components',
'wp-core-data',
'wp-deprecated',
'wp-element',
'wp-editor',
'wp-i18n',
Expand Down

0 comments on commit 72f4ca8

Please sign in to comment.