-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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.1 removal #7419
Changes from all commits
555f099
8bf8d21
818acd1
a0ca367
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import './deprecated'; | ||
import './store'; | ||
import './hooks'; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
* WordPress dependencies | ||
*/ | ||
import * as blob from '@wordpress/blob'; | ||
import * as dom from '@wordpress/dom'; | ||
import originalDeprecated from '@wordpress/deprecated'; | ||
|
||
const wrapFunction = ( source, sourceName, version ) => | ||
|
@@ -21,32 +20,6 @@ export const createBlobURL = wrapBlobFunction( 'createBlobURL' ); | |
export const getBlobByURL = wrapBlobFunction( 'getBlobByURL' ); | ||
export const revokeBlobURL = wrapBlobFunction( 'revokeBlobURL' ); | ||
|
||
// dom | ||
const wrapDomFunction = wrapFunction( dom, 'dom', '3.1' ); | ||
export const computeCaretRect = wrapDomFunction( 'computeCaretRect' ); | ||
export const documentHasSelection = wrapDomFunction( 'documentHasSelection' ); | ||
export const focus = { | ||
focusable: { | ||
find: wrapFunction( dom.focus.focusable, 'dom.focus.focusable', '3.1' )( 'find' ), | ||
}, | ||
tabbable: { | ||
find: wrapFunction( dom.focus.tabbable, 'dom.focus.tabbable', '3.1' )( 'find' ), | ||
isTabbableIndex: wrapFunction( dom.focus.tabbable, 'dom.focus.tabbable', '3.1' )( 'isTabbableIndex' ), | ||
}, | ||
}; | ||
export const getRectangleFromRange = wrapDomFunction( 'getRectangleFromRange' ); | ||
export const getScrollContainer = wrapDomFunction( 'getScrollContainer' ); | ||
export const insertAfter = wrapDomFunction( 'insertAfter' ); | ||
export const isHorizontalEdge = wrapDomFunction( 'isHorizontalEdge' ); | ||
export const isTextField = wrapDomFunction( 'isTextField' ); | ||
export const isVerticalEdge = wrapDomFunction( 'isVerticalEdge' ); | ||
export const placeCaretAtHorizontalEdge = wrapDomFunction( 'placeCaretAtHorizontalEdge' ); | ||
export const placeCaretAtVerticalEdge = wrapDomFunction( 'placeCaretAtVerticalEdge' ); | ||
export const remove = wrapDomFunction( 'remove' ); | ||
export const replace = wrapDomFunction( 'replace' ); | ||
export const replaceTag = wrapDomFunction( 'replaceTag' ); | ||
export const unwrap = wrapDomFunction( 'unwrap' ); | ||
|
||
// deprecated | ||
export function deprecated( ...params ) { | ||
originalDeprecated( 'wp.utils.deprecated', { | ||
|
@@ -57,14 +30,3 @@ export function deprecated( ...params ) { | |
|
||
return originalDeprecated( ...params ); | ||
} | ||
|
||
// viewport | ||
export function isExtraSmall() { | ||
originalDeprecated( 'wp.utils.isExtraSmall', { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately the custom ESLint rule is not smart enough to capture anything except the default function name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, I was too creative renaming its name :) |
||
version: '3.1', | ||
alternative: 'wp.viewport.isExtraSmall', | ||
plugin: 'Gutenberg', | ||
} ); | ||
|
||
return window && window.innerWidth < 782; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks 👍