Skip to content

Commit

Permalink
Merge pull request #5616 from WordPress/replace/shallow-equal
Browse files Browse the repository at this point in the history
Framework: Replace is-equal-shallow with shallowequal
  • Loading branch information
mcsf authored Mar 14, 2018
2 parents 409ac98 + 943b5ff commit 20a13c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
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

0 comments on commit 20a13c4

Please sign in to comment.