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: Remove deprecations slated for 3.5 removal #8687

Merged
merged 4 commits into from
Aug 8, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented Aug 7, 2018

This PR removes deprecations scheduled to be removed in the upcoming 3.5.0 release.

  • wp.components.ifCondition has been removed. Please use wp.compose.ifCondition instead.
  • wp.components.withGlobalEvents has been removed. Please use wp.compose.withGlobalEvents instead.
  • wp.components.withInstanceId has been removed. Please use wp.compose.withInstanceId instead.
  • wp.components.withSafeTimeout has been removed. Please use wp.compose.withSafeTimeout instead.
  • wp.components.withState has been removed. Please use wp.compose.withState instead.
  • wp.element.pure has been removed. Please use wp.compose.pure instead.
  • wp.element.compose has been removed. Please use wp.compose.compose instead.
  • wp.element.createHigherOrderComponent has been removed. Please use wp.compose.createHigherOrderComponent instead.
  • wp.utils.buildTermsTree has been removed.
  • wp.utils.decodeEntities has been removed. Please use wp.htmlEntities.decodeEntities instead.
  • All references to a block’s uid have been replaced with equivalent props and selectors for clientId.
  • The wp.editor.MediaPlaceholder component onSelectUrl prop has been renamed to onSelectURL.
  • The wp.editor.UrlInput component has been renamed to wp.editor.URLInput.
  • The Text Columns block has been removed. Please use the Columns block instead.
  • InnerBlocks grouped layout is removed. Use intermediary nested inner blocks instead. See Columns / Column block for reference implementation.
  • RichText explicit element format removed. Please use the compatible children format instead.

This includes a few updates to core code which was still using deprecated functions (see #7895, #7947).

Source: https://wordpress.org/gutenberg/handbook/reference/deprecated/#3-4-0

@aduth aduth added the Framework Issues related to broader framework topics, especially as it relates to javascript label Aug 7, 2018
@aduth aduth added this to the 3.5 milestone Aug 7, 2018
@aduth aduth requested review from oandregal, noisysocks, jorgefilipecosta and a team August 7, 2018 19:53
Copy link
Member

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

more-red-than-green

I think there's some code related to onSelectURL that code be either simplified (no check) or refactored (should error if onSelectURL check stays but fails).

Otherwise this looks good to me.

if ( this.props.onSelectURL ) {
this.props.onSelectURL( this.state.src );
}
if ( this.state.src && this.props.onSelectURL ) {
Copy link
Member

Choose a reason for hiding this comment

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

The comment above is a bit unclear to me, but seems to imply we shouldn't (need to) check for truthiness of onSelectUrl. It says it's required for this function to run, so do we still want to check for it?

Copy link
Member

@gziolo gziolo Aug 8, 2018

Choose a reason for hiding this comment

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

I double checked this one and how it is used, this prop is optional, it is good as is.

@@ -120,7 +100,7 @@ class MediaPlaceholder extends Component {
onFilesDrop={ this.onFilesUpload }
onHTMLDrop={ onHTMLDrop }
/>
{ ( onSelectUrl || onSelectURL ) && (
{ onSelectURL && (
Copy link
Member

Choose a reason for hiding this comment

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

Right, based on this the function above should error if called without onSelectURL being specified.

Copy link
Member

Choose a reason for hiding this comment

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

won't it silently skip this branch?

@@ -242,27 +241,4 @@ class URLInput extends Component {
}
}

// TODO: As part of deprecation of UrlInput, the temporary passthrough
Copy link
Member

Choose a reason for hiding this comment

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

Thanks to whomever wrote these deprecation comments, because they make reviewing this code removal very straightforward 👍

@gziolo gziolo force-pushed the remove/3-5-deprecations branch from 091f841 to f396173 Compare August 8, 2018 08:09
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

LGTM, tests well.

@gziolo gziolo merged commit e95026c into master Aug 8, 2018
@gziolo gziolo deleted the remove/3-5-deprecations branch August 8, 2018 08:19
@gziolo gziolo added the [Type] Breaking Change For PRs that introduce a change that will break existing functionality label Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Breaking Change For PRs that introduce a change that will break existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants