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: Replace is-equal-shallow with shallowequal #5616

Merged
merged 1 commit into from
Mar 14, 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
4 changes: 2 additions & 2 deletions blocks/api/serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { isEmpty, reduce, isObject, castArray, startsWith } from 'lodash';
import { html as beautifyHtml } from 'js-beautify';
import isEqualShallow from 'is-equal-shallow';
import isShallowEqual from 'shallowequal';

/**
* WordPress dependencies
Expand Down Expand Up @@ -68,7 +68,7 @@ export function getSaveElement( blockType, attributes, innerBlocks = [] ) {
attributes
);

if ( ! isEqualShallow( props, element.props ) ) {
if ( ! isShallowEqual( props, element.props ) ) {
element = cloneElement( element, props );
}
}
Expand Down
6 changes: 3 additions & 3 deletions data/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import isEqualShallow from 'is-equal-shallow';
import isShallowEqual from 'shallowequal';
import { createStore } from 'redux';
import { flowRight, without, mapValues } from 'lodash';

Expand Down Expand Up @@ -184,7 +184,7 @@ export const withSelect = ( mapStateToProps ) => ( WrappedComponent ) => {
}

componentWillReceiveProps( nextProps ) {
if ( ! isEqualShallow( nextProps, this.props ) ) {
if ( ! isShallowEqual( nextProps, this.props ) ) {
this.runSelection( nextProps );
}
}
Expand All @@ -211,7 +211,7 @@ export const withSelect = ( mapStateToProps ) => ( WrappedComponent ) => {
const { mergeProps } = this.state;
const nextMergeProps = mapStateToProps( select, props ) || {};

if ( ! isEqualShallow( nextMergeProps, mergeProps ) ) {
if ( ! isShallowEqual( nextMergeProps, mergeProps ) ) {
this.setState( {
mergeProps: nextMergeProps,
} );
Expand Down
9 changes: 8 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"escape-string-regexp": "1.0.5",
"eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#327b6bdec434177a6e841bd3210e87627ccfcecb",
"hpq": "1.2.0",
"is-equal-shallow": "0.1.3",
"jed": "1.1.1",
"jquery": "3.2.1",
"js-beautify": "1.6.14",
Expand All @@ -51,6 +50,7 @@
"redux-optimist": "1.0.0",
"refx": "3.0.0",
"rememo": "2.4.0",
"shallowequal": "1.0.2",
"showdown": "1.7.4",
"simple-html-tokenizer": "0.4.1",
"tinycolor2": "1.4.1",
Expand Down