Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framework: Drop deprecations slated for 3.0 removal #7031

Merged
merged 2 commits into from
May 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions core-blocks/index.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 @@ -160,23 +158,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 @@ -202,29 +183,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
Original file line number Diff line number Diff line change
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';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included this fix to avoid double warning :)


/***
* Module constants
Expand Down
1 change: 0 additions & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ function gutenberg_register_scripts_and_styles() {
'wp-blocks',
'wp-components',
'wp-core-data',
Copy link
Member

@gziolo gziolo May 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that core-blocks no longer depends on deprecated.

'wp-deprecated',
'wp-element',
'wp-editor',
'wp-i18n',
Expand Down