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

Packages: Replace usage of lodash with lodash-es #9374

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion components/code-editor/test/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import { shallow } from 'enzyme';
import { set, noop } from 'lodash';
import { set, noop } from 'lodash-es';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { isEmpty, map } from 'lodash';
import { isEmpty, map } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { difference } from 'lodash';
import { difference } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/components/header/pinned-plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { isEmpty } from 'lodash';
import { isEmpty } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { isEmpty } from 'lodash';
import { isEmpty } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/components/keyboard-shortcut-help-modal/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { castArray } from 'lodash';
import { castArray } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { noop } from 'lodash';
import { noop } from 'lodash-es';
import { shallow } from 'enzyme';

/**
Expand Down
2 changes: 1 addition & 1 deletion edit-post/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import { some } from 'lodash';
import { some } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/components/sidebar/featured-image/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { get, partial } from 'lodash';
import { get, partial } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/components/sidebar/page-attributes/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { get, partial } from 'lodash';
import { get, partial } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External Dependencies
*/
import { get } from 'lodash';
import { get } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { flow, noop } from 'lodash';
import { flow, noop } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/hooks/components/media-upload/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External Dependencies
*/
import { castArray, pick } from 'lodash';
import { castArray, pick } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/hooks/validate-multiple-use/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { find } from 'lodash';
import { find } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/store/effects.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { reduce, some } from 'lodash';
import { reduce, some } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/store/middlewares.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { flowRight } from 'lodash';
import { flowRight } from 'lodash-es';
import refx from 'refx';

/**
Expand Down
2 changes: 1 addition & 1 deletion edit-post/store/reducer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { get } from 'lodash';
import { get } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion edit-post/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import createSelector from 'rememo';
import { get, includes, some } from 'lodash';
import { get, includes, some } from 'lodash-es';

/**
* Returns the current editing mode.
Expand Down
45 changes: 19 additions & 26 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"equivalent-key-map": "0.2.1",
"eslint-plugin-wordpress": "git://github.com/WordPress-Coding-Standards/eslint-plugin-wordpress.git#1774343f6226052a46b081e01db3fca8793cc9f1",
"jquery": "3.3.1",
"lodash": "4.17.10",
"lodash-es": "4.17.10",
"prop-types": "15.5.10",
"react": "16.4.1",
"react-dom": "16.4.1",
Expand Down Expand Up @@ -96,6 +96,7 @@
"jest-puppeteer": "3.2.1",
"lerna": "3.0.0-rc.0",
"lint-staged": "7.2.0",
"lodash": "4.17.10",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need both?

Copy link
Member Author

Choose a reason for hiding this comment

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

Node 8 doesn't have ES modules enabled natively so we need to use lodash in all CLI tools.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like there's some breaking in e2e tests, I guess it's related?

"mkdirp": "0.5.1",
"node-sass": "4.9.2",
"path-type": "3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@wordpress/keycodes": "file:../keycodes",
"@wordpress/viewport": "file:../viewport",
"classnames": "^2.2.5",
"lodash": "^4.17.10",
"lodash-es": "^4.17.10",
"memize": "^1.0.5",
"moment": "^2.22.1",
"querystring": "^0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { noop, partial } from 'lodash';
import { noop, partial } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* External dependencies
*/
import classnames from 'classnames';
import { omit, pick } from 'lodash';
import { omit, pick } from 'lodash-es';

/**
* WordPress dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/categories/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Component, Fragment } from '@wordpress/element';
import { PanelBody, Placeholder, Spinner, ToggleControl } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { times, unescape } from 'lodash';
import { times, unescape } from 'lodash-es';
import {
InspectorControls,
BlockControls,
Expand Down
Loading