From fe5fb5d48c87216d70fd7c1bbde58edaada3255d Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Fri, 8 Nov 2019 10:54:57 -0800 Subject: [PATCH 1/9] build(webpack): Remove `lodash-webpack-plugin` [WIP] # WIP --- package.json | 1 - webpack.config.js | 12 ------------ yarn.lock | 7 ------- 3 files changed, 20 deletions(-) diff --git a/package.json b/package.json index c98d99b96d57..3510f4bbbdf8 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,6 @@ "less": "^3.9.0", "less-loader": "^4.1.0", "lodash": "^4.17.11", - "lodash-webpack-plugin": "^0.11.5", "marked": "0.6.2", "mini-css-extract-plugin": "^v0.5.0", "mobx": "^5.13.0", diff --git a/webpack.config.js b/webpack.config.js index 9613291ba715..ffc1b97bd219 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -11,7 +11,6 @@ const IntegrationDocsFetchPlugin = require('./build-utils/integration-docs-fetch const ExtractTextPlugin = require('mini-css-extract-plugin'); const CompressionPlugin = require('compression-webpack-plugin'); const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); -const LodashModuleReplacementPlugin = require('lodash-webpack-plugin'); const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries'); const CopyPlugin = require('copy-webpack-plugin'); @@ -281,17 +280,6 @@ let appConfig = { }, plugins: [ new CleanWebpackPlugin(), - /** - * Used to make our lodash modules even smaller - */ - new LodashModuleReplacementPlugin({ - collections: true, - currying: true, // these are enabled to support lodash/fp/ features - flattening: true, // used by a dependency of react-mentions - shorthands: true, - paths: true, - exotics: true, - }), /** * jQuery must be provided in the global scope specifically and only for diff --git a/yarn.lock b/yarn.lock index 35ac32f697bf..08a2bb935dd8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9375,13 +9375,6 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lodash-webpack-plugin@^0.11.5: - version "0.11.5" - resolved "https://registry.yarnpkg.com/lodash-webpack-plugin/-/lodash-webpack-plugin-0.11.5.tgz#c4bd064b4f561c3f823fa5982bdeb12c475390b9" - integrity sha512-QWfEIYxpixOdbd6KBe5g6MDWcyTgP3trDXwKHFqTlXrWiLcs/67fGQ0IWeRyhWlTITQIgMpJAYd2oeIztuV5VA== - dependencies: - lodash "^4.17.4" - lodash._getnative@^3.0.0: version "3.9.1" resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" From ae60e9f59e5e7889f647a87a4798d22baba59d0a Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Fri, 8 Nov 2019 13:48:29 -0800 Subject: [PATCH 2/9] wip change import --- src/sentry/static/sentry/app/actionCreators/formSearch.jsx | 4 +++- .../static/sentry/app/actionCreators/globalSelection.jsx | 4 +++- src/sentry/static/sentry/app/actionCreators/projects.jsx | 4 +++- .../sentry/app/components/activity/note/mentionables.jsx | 2 +- .../sentry/app/components/asyncComponentSearchInput.jsx | 2 +- .../sentry/app/components/charts/components/tooltip.jsx | 2 +- .../static/sentry/app/components/charts/releaseSeries.jsx | 2 +- .../static/sentry/app/components/charts/worldMapChart.jsx | 2 +- src/sentry/static/sentry/app/components/dropdownButton.jsx | 2 +- .../static/sentry/app/components/eventOrGroupHeader.jsx | 2 +- src/sentry/static/sentry/app/components/events/contexts.jsx | 2 +- .../static/sentry/app/components/events/contexts/device.jsx | 2 +- .../static/sentry/app/components/events/eventCause.jsx | 3 ++- .../static/sentry/app/components/events/groupingInfo.jsx | 2 +- .../sentry/app/components/events/interfaces/spans/header.tsx | 2 +- .../app/components/events/interfaces/spans/spanDetail.tsx | 3 ++- .../app/components/events/interfaces/spans/spanTree.tsx | 2 +- .../sentry/app/components/events/interfaces/threads.jsx | 2 +- .../static/sentry/app/components/events/interfaces/utils.jsx | 3 ++- .../sentry/app/components/forms/selectAsyncControl.jsx | 2 +- .../static/sentry/app/components/group/externalIssueForm.jsx | 2 +- .../app/components/group/sentryAppExternalIssueForm.tsx | 2 +- src/sentry/static/sentry/app/components/group/sidebar.jsx | 5 ++++- .../sentry/app/components/idBadge/organizationBadge.jsx | 2 +- .../static/sentry/app/components/idBadge/teamBadge.jsx | 2 +- .../static/sentry/app/components/idBadge/userBadge.jsx | 2 +- .../static/sentry/app/components/issueSyncListElement.tsx | 2 +- .../components/organizations/globalSelectionHeader/index.jsx | 5 ++++- .../components/organizations/globalSelectionHeader/utils.jsx | 5 ++++- .../components/organizations/multipleEnvironmentSelector.jsx | 2 +- src/sentry/static/sentry/app/components/passwordStrength.jsx | 2 +- src/sentry/static/sentry/app/components/platformPicker.jsx | 2 +- src/sentry/static/sentry/app/components/projectSelector.jsx | 2 +- src/sentry/static/sentry/app/components/search/index.jsx | 2 +- .../sentry/app/components/search/sources/apiSource.jsx | 3 ++- .../sentry/app/components/search/sources/helpSource.jsx | 2 +- .../static/sentry/app/components/search/sources/index.jsx | 2 +- .../sentry/app/components/search/sources/routeSource.jsx | 2 +- src/sentry/static/sentry/app/components/sidebar/index.jsx | 2 +- .../sentry/app/components/stream/processingIssueList.jsx | 2 +- src/sentry/static/sentry/app/components/timeSince.tsx | 3 ++- src/sentry/static/sentry/app/stores/globalSelectionStore.jsx | 3 ++- src/sentry/static/sentry/app/stores/groupingStore.jsx | 2 +- src/sentry/static/sentry/app/stores/savedSearchesStore.jsx | 2 +- src/sentry/static/sentry/app/utils/consolidatedScopes.tsx | 4 +++- src/sentry/static/sentry/app/utils/formatters.tsx | 2 +- src/sentry/static/sentry/app/utils/isEqualWithDates.jsx | 4 +++- src/sentry/static/sentry/app/utils/projects.jsx | 4 +++- src/sentry/static/sentry/app/utils/queryString.tsx | 2 +- src/sentry/static/sentry/app/utils/recreateRoute.tsx | 2 +- .../static/sentry/app/views/dashboards/discoverQuery.jsx | 4 +++- .../static/sentry/app/views/dashboards/exploreWidget.jsx | 2 +- .../utils/getEventsUrlFromDiscoverQueryWithConditions.jsx | 2 +- .../dashboards/utils/getEventsUrlPathFromDiscoverQuery.jsx | 2 +- .../static/sentry/app/views/dashboards/widgetChart.jsx | 2 +- src/sentry/static/sentry/app/views/discover/result/utils.tsx | 2 +- .../sentry/app/views/discover/sidebar/editSavedQuery.tsx | 2 +- src/sentry/static/sentry/app/views/events/events.jsx | 2 +- src/sentry/static/sentry/app/views/events/eventsChart.jsx | 2 +- src/sentry/static/sentry/app/views/events/searchBar.jsx | 3 ++- src/sentry/static/sentry/app/views/eventsV2/events.tsx | 3 ++- .../sentry/app/views/eventsV2/table/draggableColumns.tsx | 2 +- src/sentry/static/sentry/app/views/eventsV2/tags.tsx | 2 +- .../sentry/app/views/incidents/details/activity/activity.tsx | 2 +- src/sentry/static/sentry/app/views/issueList/actions.jsx | 2 +- src/sentry/static/sentry/app/views/issueList/overview.jsx | 5 ++++- src/sentry/static/sentry/app/views/issueList/tagFilter.jsx | 2 +- .../app/views/organizationGroupDetails/groupDetails.jsx | 2 +- .../groupEventDetails/groupEventDetails.tsx | 2 +- .../app/views/organizationGroupDetails/groupEvents.jsx | 2 +- .../app/views/organizationGroupDetails/groupTagValues.jsx | 4 +++- .../sentry/app/views/organizationGroupDetails/groupTags.jsx | 2 +- .../app/views/organizationGroupDetails/groupUserFeedback.jsx | 2 +- .../sentry/app/views/organizationGroupDetails/header.jsx | 2 +- .../app/views/organizationIntegrations/migrationWarnings.jsx | 2 +- .../static/sentry/app/views/releases/detail/groupList.jsx | 2 +- src/sentry/static/sentry/app/views/releases/detail/index.jsx | 2 +- .../sentry/app/views/releases/detail/releaseArtifacts.jsx | 2 +- .../sentry/app/views/releases/detail/releaseCommits.jsx | 2 +- src/sentry/static/sentry/app/views/releases/list/utils.jsx | 2 +- .../sentry/app/views/settings/components/teamSelect.jsx | 2 +- .../settings/incidentRules/triggers/chart/draggableChart.tsx | 3 ++- .../organizationDeveloperSettings/permissionSelection.tsx | 4 +++- .../sentry/app/views/settings/organizationMembers/index.jsx | 2 +- .../app/views/settings/organizationTeams/teamMembers.jsx | 2 +- .../app/views/settings/project/projectOwnership/modal.jsx | 3 ++- .../views/settings/project/projectOwnership/selectOwners.jsx | 2 +- .../static/sentry/app/views/userFeedback/container.jsx | 2 +- src/sentry/static/sentry/app/views/userFeedback/utils.jsx | 2 +- 89 files changed, 129 insertions(+), 89 deletions(-) diff --git a/src/sentry/static/sentry/app/actionCreators/formSearch.jsx b/src/sentry/static/sentry/app/actionCreators/formSearch.jsx index 0feb7cf28d86..13d6d21c8480 100644 --- a/src/sentry/static/sentry/app/actionCreators/formSearch.jsx +++ b/src/sentry/static/sentry/app/actionCreators/formSearch.jsx @@ -1,4 +1,6 @@ -import {flatten, flatMap} from 'lodash'; +import flatten from 'lodash/flatten'; + +import flatMap from 'lodash/flatMap'; import FormSearchActions from 'app/actions/formSearchActions'; diff --git a/src/sentry/static/sentry/app/actionCreators/globalSelection.jsx b/src/sentry/static/sentry/app/actionCreators/globalSelection.jsx index 9bc08ed6f427..2873843acc3c 100644 --- a/src/sentry/static/sentry/app/actionCreators/globalSelection.jsx +++ b/src/sentry/static/sentry/app/actionCreators/globalSelection.jsx @@ -1,4 +1,6 @@ -import {isEqual, isInteger, omit} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import isInteger from 'lodash/isInteger'; +import omit from 'lodash/omit'; import * as Sentry from '@sentry/browser'; import {defined} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/actionCreators/projects.jsx b/src/sentry/static/sentry/app/actionCreators/projects.jsx index 3ecbbf0d4da7..733c3854f19e 100644 --- a/src/sentry/static/sentry/app/actionCreators/projects.jsx +++ b/src/sentry/static/sentry/app/actionCreators/projects.jsx @@ -1,4 +1,6 @@ -import {chunk, debounce} from 'lodash'; +import chunk from 'lodash/chunk'; + +import debounce from 'lodash/debounce'; import { addLoadingMessage, diff --git a/src/sentry/static/sentry/app/components/activity/note/mentionables.jsx b/src/sentry/static/sentry/app/components/activity/note/mentionables.jsx index 6db8287414d5..3c1cc6d167c1 100644 --- a/src/sentry/static/sentry/app/components/activity/note/mentionables.jsx +++ b/src/sentry/static/sentry/app/components/activity/note/mentionables.jsx @@ -1,4 +1,4 @@ -import {uniqBy} from 'lodash'; +import uniqBy from 'lodash/uniqBy'; import PropTypes from 'prop-types'; import React from 'react'; import Reflux from 'reflux'; diff --git a/src/sentry/static/sentry/app/components/asyncComponentSearchInput.jsx b/src/sentry/static/sentry/app/components/asyncComponentSearchInput.jsx index 716294ef2a9d..8cfd77c43e21 100644 --- a/src/sentry/static/sentry/app/components/asyncComponentSearchInput.jsx +++ b/src/sentry/static/sentry/app/components/asyncComponentSearchInput.jsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/charts/components/tooltip.jsx b/src/sentry/static/sentry/app/components/charts/components/tooltip.jsx index ab2550431d27..41350bceb466 100644 --- a/src/sentry/static/sentry/app/components/charts/components/tooltip.jsx +++ b/src/sentry/static/sentry/app/components/charts/components/tooltip.jsx @@ -1,6 +1,6 @@ import 'echarts/lib/component/tooltip'; -import {get} from 'lodash'; +import get from 'lodash/get'; import {getFormattedDate} from 'app/utils/dates'; import {truncationFormatter} from '../utils'; diff --git a/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx b/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx index ce96fc8c9d2b..248a3d533913 100644 --- a/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx +++ b/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx @@ -2,7 +2,7 @@ import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; import moment from 'moment'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {getUserTimezone} from 'app/utils/dates'; diff --git a/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx b/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx index 664cf8560ffa..ef5d3229e7ad 100644 --- a/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx @@ -1,4 +1,4 @@ -import {max} from 'lodash'; +import max from 'lodash/max'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/dropdownButton.jsx b/src/sentry/static/sentry/app/components/dropdownButton.jsx index b5202f719a26..b3f6aa9a4b66 100644 --- a/src/sentry/static/sentry/app/components/dropdownButton.jsx +++ b/src/sentry/static/sentry/app/components/dropdownButton.jsx @@ -3,7 +3,7 @@ import React from 'react'; import styled from 'react-emotion'; import Button from 'app/components/button'; import InlineSvg from 'app/components/inlineSvg'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; class DropdownButton extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/eventOrGroupHeader.jsx b/src/sentry/static/sentry/app/components/eventOrGroupHeader.jsx index cf5c5f6b14ca..48e1324dab7f 100644 --- a/src/sentry/static/sentry/app/components/eventOrGroupHeader.jsx +++ b/src/sentry/static/sentry/app/components/eventOrGroupHeader.jsx @@ -3,7 +3,7 @@ import React from 'react'; import {withRouter} from 'react-router'; import styled, {css} from 'react-emotion'; import classNames from 'classnames'; -import {capitalize} from 'lodash'; +import capitalize from 'lodash/capitalize'; import SentryTypes from 'app/sentryTypes'; import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; diff --git a/src/sentry/static/sentry/app/components/events/contexts.jsx b/src/sentry/static/sentry/app/components/events/contexts.jsx index 738eea610d28..6ff8cb4a72b0 100644 --- a/src/sentry/static/sentry/app/components/events/contexts.jsx +++ b/src/sentry/static/sentry/app/components/events/contexts.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {get} from 'lodash'; +import get from 'lodash/get'; import {objectIsEmpty, toTitleCase, defined} from 'app/utils'; import EventDataSection from 'app/components/events/eventDataSection'; import plugins from 'app/plugins'; diff --git a/src/sentry/static/sentry/app/components/events/contexts/device.jsx b/src/sentry/static/sentry/app/components/events/contexts/device.jsx index 7677acadda63..36fb0916ce36 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/device.jsx +++ b/src/sentry/static/sentry/app/components/events/contexts/device.jsx @@ -1,4 +1,4 @@ -import {isString} from 'lodash'; +import isString from 'lodash/isString'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/events/eventCause.jsx b/src/sentry/static/sentry/app/components/events/eventCause.jsx index 7b947a94f948..9ec19b9e3bb1 100644 --- a/src/sentry/static/sentry/app/components/events/eventCause.jsx +++ b/src/sentry/static/sentry/app/components/events/eventCause.jsx @@ -1,6 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {uniqBy, flatMap} from 'lodash'; +import uniqBy from 'lodash/uniqBy'; +import flatMap from 'lodash/flatMap'; import styled from 'react-emotion'; import CommitRow from 'app/components/commitRow'; diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo.jsx b/src/sentry/static/sentry/app/components/events/groupingInfo.jsx index 0a361c4253c3..3c6c42db0189 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo.jsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; -import {isObject} from 'lodash'; +import isObject from 'lodash/isObject'; import AsyncComponent from 'app/components/asyncComponent'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx index a2eac716f745..eec22602486d 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx @@ -2,7 +2,7 @@ import React from 'react'; import styled from 'react-emotion'; import space from 'app/styles/space'; -import {get} from 'lodash'; +import get from 'lodash/get'; import { rectOfContent, diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx index c8119821314a..8be66249ba4a 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx @@ -1,6 +1,7 @@ import React from 'react'; import styled from 'react-emotion'; -import {get, map} from 'lodash'; +import get from 'lodash/get'; +import map from 'lodash/map'; import DateTime from 'app/components/dateTime'; import Pills from 'app/components/pills'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx index cf1d56931336..6c7ed052bd8f 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from 'react-emotion'; -import {get} from 'lodash'; +import get from 'lodash/get'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx b/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx index 4d9447edaa4a..22c3e4fa77c4 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads.jsx @@ -1,4 +1,4 @@ -import {isNil} from 'lodash'; +import isNil from 'lodash/isNil'; import PropTypes from 'prop-types'; import React from 'react'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx b/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx index 928fd70055b6..984498a314ad 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx @@ -1,4 +1,5 @@ -import {isEmpty, isString} from 'lodash'; +import isEmpty from 'lodash/isEmpty'; +import isString from 'lodash/isString'; import * as Sentry from '@sentry/browser'; import queryString from 'query-string'; diff --git a/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx b/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx index 9c569488525b..2b4c6ef17827 100644 --- a/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/group/externalIssueForm.jsx b/src/sentry/static/sentry/app/components/group/externalIssueForm.jsx index 5dd6f12cf661..5ee36ed43c1d 100644 --- a/src/sentry/static/sentry/app/components/group/externalIssueForm.jsx +++ b/src/sentry/static/sentry/app/components/group/externalIssueForm.jsx @@ -2,7 +2,7 @@ import $ from 'jquery'; import React from 'react'; import PropTypes from 'prop-types'; import queryString from 'query-string'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {addSuccessMessage} from 'app/actionCreators/indicator'; import AsyncComponent from 'app/components/asyncComponent'; diff --git a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx index 95892123ed67..acd45323fa34 100644 --- a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx +++ b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; diff --git a/src/sentry/static/sentry/app/components/group/sidebar.jsx b/src/sentry/static/sentry/app/components/group/sidebar.jsx index 4a13477fb9f5..b54e49d32fc9 100644 --- a/src/sentry/static/sentry/app/components/group/sidebar.jsx +++ b/src/sentry/static/sentry/app/components/group/sidebar.jsx @@ -1,6 +1,9 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {isEqual, pickBy, keyBy, isObject} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import pickBy from 'lodash/pickBy'; +import keyBy from 'lodash/keyBy'; +import isObject from 'lodash/isObject'; import ErrorBoundary from 'app/components/errorBoundary'; import SentryTypes from 'app/sentryTypes'; diff --git a/src/sentry/static/sentry/app/components/idBadge/organizationBadge.jsx b/src/sentry/static/sentry/app/components/idBadge/organizationBadge.jsx index e146a4210612..44f4cd7bf1bd 100644 --- a/src/sentry/static/sentry/app/components/idBadge/organizationBadge.jsx +++ b/src/sentry/static/sentry/app/components/idBadge/organizationBadge.jsx @@ -1,4 +1,4 @@ -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/idBadge/teamBadge.jsx b/src/sentry/static/sentry/app/components/idBadge/teamBadge.jsx index 095fb1549044..1d56098a352f 100644 --- a/src/sentry/static/sentry/app/components/idBadge/teamBadge.jsx +++ b/src/sentry/static/sentry/app/components/idBadge/teamBadge.jsx @@ -1,4 +1,4 @@ -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import createReactClass from 'create-react-class'; import React from 'react'; import Reflux from 'reflux'; diff --git a/src/sentry/static/sentry/app/components/idBadge/userBadge.jsx b/src/sentry/static/sentry/app/components/idBadge/userBadge.jsx index c38175c4f79e..3fb6924c4c09 100644 --- a/src/sentry/static/sentry/app/components/idBadge/userBadge.jsx +++ b/src/sentry/static/sentry/app/components/idBadge/userBadge.jsx @@ -6,7 +6,7 @@ import Link from 'app/components/links/link'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; import SentryTypes from 'app/sentryTypes'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; const UserBadge = ({ displayName, diff --git a/src/sentry/static/sentry/app/components/issueSyncListElement.tsx b/src/sentry/static/sentry/app/components/issueSyncListElement.tsx index 101e40f84aec..2c98d4236458 100644 --- a/src/sentry/static/sentry/app/components/issueSyncListElement.tsx +++ b/src/sentry/static/sentry/app/components/issueSyncListElement.tsx @@ -3,7 +3,7 @@ import React from 'react'; import styled, {css} from 'react-emotion'; import InlineSvg from 'app/components/inlineSvg'; import space from 'app/styles/space'; -import {capitalize} from 'lodash'; +import capitalize from 'lodash/capitalize'; import Hovercard from 'app/components/hovercard'; import {callIfFunction} from 'app/utils/callIfFunction'; diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx index e661b091996c..dd23df631d62 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.jsx @@ -1,4 +1,7 @@ -import {flatten, isEqual, pick, partition} from 'lodash'; +import flatten from 'lodash/flatten'; +import isEqual from 'lodash/isEqual'; +import pick from 'lodash/pick'; +import partition from 'lodash/partition'; import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.jsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.jsx index b7dbd8926dfb..944a1f2c7275 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.jsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.jsx @@ -1,4 +1,7 @@ -import {pick, pickBy, identity} from 'lodash'; +import pick from 'lodash/pick'; + +import pickBy from 'lodash/pickBy'; +import identity from 'lodash/identity'; import {defined} from 'app/utils'; import {getUtcToLocalDateObject} from 'app/utils/dates'; diff --git a/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.jsx b/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.jsx index 04b73e64d3a3..96edb2b4e91f 100644 --- a/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.jsx +++ b/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import styled, {css} from 'react-emotion'; -import {uniq} from 'lodash'; +import uniq from 'lodash/uniq'; import {analytics} from 'app/utils/analytics'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; diff --git a/src/sentry/static/sentry/app/components/passwordStrength.jsx b/src/sentry/static/sentry/app/components/passwordStrength.jsx index 765f818cdd13..672b6769bdd5 100644 --- a/src/sentry/static/sentry/app/components/passwordStrength.jsx +++ b/src/sentry/static/sentry/app/components/passwordStrength.jsx @@ -1,4 +1,4 @@ -import {throttle} from 'lodash'; +import throttle from 'lodash/throttle'; import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/src/sentry/static/sentry/app/components/platformPicker.jsx b/src/sentry/static/sentry/app/components/platformPicker.jsx index 9a60a114188c..1ff780d65748 100644 --- a/src/sentry/static/sentry/app/components/platformPicker.jsx +++ b/src/sentry/static/sentry/app/components/platformPicker.jsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; import keydown from 'react-keydown'; diff --git a/src/sentry/static/sentry/app/components/projectSelector.jsx b/src/sentry/static/sentry/app/components/projectSelector.jsx index 35e53f40fe1d..d082a7d3b1ae 100644 --- a/src/sentry/static/sentry/app/components/projectSelector.jsx +++ b/src/sentry/static/sentry/app/components/projectSelector.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; import {Link} from 'react-router'; -import {flatten} from 'lodash'; +import flatten from 'lodash/flatten'; import {analytics} from 'app/utils/analytics'; import {sortArray} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/components/search/index.jsx b/src/sentry/static/sentry/app/components/search/index.jsx index b48f272c5157..dbda09368d78 100644 --- a/src/sentry/static/sentry/app/components/search/index.jsx +++ b/src/sentry/static/sentry/app/components/search/index.jsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx b/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx index 3c18dc324a98..9c4cd171dd1f 100644 --- a/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx @@ -1,4 +1,5 @@ -import {flatten, debounce} from 'lodash'; +import flatten from 'lodash/flatten'; +import debounce from 'lodash/debounce'; import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/search/sources/helpSource.jsx b/src/sentry/static/sentry/app/components/search/sources/helpSource.jsx index abf0b4ed1298..41092ba78028 100644 --- a/src/sentry/static/sentry/app/components/search/sources/helpSource.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/helpSource.jsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/search/sources/index.jsx b/src/sentry/static/sentry/app/components/search/sources/index.jsx index 7d98008f9aef..07f2d8549537 100644 --- a/src/sentry/static/sentry/app/components/search/sources/index.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/index.jsx @@ -1,4 +1,4 @@ -import {flatten} from 'lodash'; +import flatten from 'lodash/flatten'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/search/sources/routeSource.jsx b/src/sentry/static/sentry/app/components/search/sources/routeSource.jsx index e9c837387232..5f66b33b1689 100644 --- a/src/sentry/static/sentry/app/components/search/sources/routeSource.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/routeSource.jsx @@ -1,4 +1,4 @@ -import {flattenDepth} from 'lodash'; +import flattenDepth from 'lodash/flattenDepth'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/sidebar/index.jsx b/src/sentry/static/sentry/app/components/sidebar/index.jsx index 84dba9d5828f..3256f4445176 100644 --- a/src/sentry/static/sentry/app/components/sidebar/index.jsx +++ b/src/sentry/static/sentry/app/components/sidebar/index.jsx @@ -1,4 +1,4 @@ -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import {withRouter, browserHistory} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx b/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx index 54e4a3853118..77927e515fb5 100644 --- a/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx +++ b/src/sentry/static/sentry/app/components/stream/processingIssueList.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import {Client} from 'app/api'; diff --git a/src/sentry/static/sentry/app/components/timeSince.tsx b/src/sentry/static/sentry/app/components/timeSince.tsx index ccaee0dfb336..e8dacb4b42ff 100644 --- a/src/sentry/static/sentry/app/components/timeSince.tsx +++ b/src/sentry/static/sentry/app/components/timeSince.tsx @@ -1,4 +1,5 @@ -import {isNumber, isString} from 'lodash'; +import isNumber from 'lodash/isNumber'; +import isString from 'lodash/isString'; import PropTypes from 'prop-types'; import React from 'react'; import moment from 'moment-timezone'; diff --git a/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx b/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx index cdadcef86b5d..04c77c9740a3 100644 --- a/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx +++ b/src/sentry/static/sentry/app/stores/globalSelectionStore.jsx @@ -1,4 +1,5 @@ -import {isEqual, pick} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import pick from 'lodash/pick'; import Reflux from 'reflux'; import { diff --git a/src/sentry/static/sentry/app/stores/groupingStore.jsx b/src/sentry/static/sentry/app/stores/groupingStore.jsx index ff583799ffac..1af1e8d3c0d7 100644 --- a/src/sentry/static/sentry/app/stores/groupingStore.jsx +++ b/src/sentry/static/sentry/app/stores/groupingStore.jsx @@ -1,5 +1,5 @@ import Reflux from 'reflux'; -import {pick} from 'lodash'; +import pick from 'lodash/pick'; import IndicatorStore from 'app/stores/indicatorStore'; import {Client} from 'app/api'; diff --git a/src/sentry/static/sentry/app/stores/savedSearchesStore.jsx b/src/sentry/static/sentry/app/stores/savedSearchesStore.jsx index c642e57d5af9..0bacd2697a82 100644 --- a/src/sentry/static/sentry/app/stores/savedSearchesStore.jsx +++ b/src/sentry/static/sentry/app/stores/savedSearchesStore.jsx @@ -1,4 +1,4 @@ -import {findIndex} from 'lodash'; +import findIndex from 'lodash/findIndex'; import Reflux from 'reflux'; import SavedSearchesActions from 'app/actions/savedSearchesActions'; diff --git a/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx b/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx index a4fbda01108a..ccb9b1e7c917 100644 --- a/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx +++ b/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx @@ -1,4 +1,6 @@ -import {invertBy, groupBy, pick} from 'lodash'; +import invertBy from 'lodash/invertBy'; +import groupBy from 'lodash/groupBy'; +import pick from 'lodash/pick'; import {Permissions} from 'app/types'; const PERMISSION_LEVELS = { diff --git a/src/sentry/static/sentry/app/utils/formatters.tsx b/src/sentry/static/sentry/app/utils/formatters.tsx index bc4b0e45182d..4ffd3f7f038f 100644 --- a/src/sentry/static/sentry/app/utils/formatters.tsx +++ b/src/sentry/static/sentry/app/utils/formatters.tsx @@ -1,4 +1,4 @@ -import {get} from 'lodash'; +import get from 'lodash/get'; import {t} from 'app/locale'; import {CommitAuthor, User} from 'app/types'; diff --git a/src/sentry/static/sentry/app/utils/isEqualWithDates.jsx b/src/sentry/static/sentry/app/utils/isEqualWithDates.jsx index 869f0f7790e1..7c78f5250516 100644 --- a/src/sentry/static/sentry/app/utils/isEqualWithDates.jsx +++ b/src/sentry/static/sentry/app/utils/isEqualWithDates.jsx @@ -1,4 +1,6 @@ -import {isDate, isEqualWith} from 'lodash'; +import isDate from 'lodash/isDate'; + +import isEqualWith from 'lodash/isEqualWith'; // `lodash.isEqual` does not compare date objects const dateComparator = (value, other) => { diff --git a/src/sentry/static/sentry/app/utils/projects.jsx b/src/sentry/static/sentry/app/utils/projects.jsx index 9416488380f6..117c25b6f67f 100644 --- a/src/sentry/static/sentry/app/utils/projects.jsx +++ b/src/sentry/static/sentry/app/utils/projects.jsx @@ -1,4 +1,6 @@ -import {memoize, partition, uniqBy} from 'lodash'; +import memoize from 'lodash/memoize'; +import partition from 'lodash/partition'; +import uniqBy from 'lodash/uniqBy'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/utils/queryString.tsx b/src/sentry/static/sentry/app/utils/queryString.tsx index 31a9a88600af..2b1c265c45d7 100644 --- a/src/sentry/static/sentry/app/utils/queryString.tsx +++ b/src/sentry/static/sentry/app/utils/queryString.tsx @@ -1,6 +1,6 @@ import queryString from 'query-string'; import parseurl from 'parseurl'; -import {isString} from 'lodash'; +import isString from 'lodash/isString'; // remove leading and trailing whitespace and remove double spaces export function formatQueryString(qs: string): string { diff --git a/src/sentry/static/sentry/app/utils/recreateRoute.tsx b/src/sentry/static/sentry/app/utils/recreateRoute.tsx index 863d494b1681..58c11efd1733 100644 --- a/src/sentry/static/sentry/app/utils/recreateRoute.tsx +++ b/src/sentry/static/sentry/app/utils/recreateRoute.tsx @@ -1,6 +1,6 @@ import {Location} from 'history'; import {PlainRoute} from 'react-router/lib/Route'; -import {findLastIndex} from 'lodash'; +import findLastIndex from 'lodash/findLastIndex'; import replaceRouterParams from 'app/utils/replaceRouterParams'; diff --git a/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx b/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx index b88866f6b8a7..efde77e5bee7 100644 --- a/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx @@ -1,4 +1,6 @@ -import {isEqual, memoize, omit} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import memoize from 'lodash/memoize'; +import omit from 'lodash/omit'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx b/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx index d63473e3b1aa..664f6aa9723f 100644 --- a/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from 'react-emotion'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import {getDiscoverUrlPathFromDiscoverQuery} from 'app/views/dashboards/utils/getDiscoverUrlPathFromDiscoverQuery'; import {getEventsUrlPathFromDiscoverQuery} from 'app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery'; diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.jsx b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.jsx index 96b9ca04218b..eef9a0010915 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.jsx @@ -7,7 +7,7 @@ * e.g. if the query has multiple fields (browser, device), values could be ["Chrome", "iPhone"] * @return {String} Returns a url to the "events" page with any discover conditions tranformed to search query syntax */ -import {zipWith} from 'lodash'; +import zipWith from 'lodash/zipWith'; import {OPERATOR} from 'app/views/discover/data'; import {escapeQuotes} from 'app/components/events/interfaces/utils'; diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.jsx b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.jsx index e09b209a3fbe..021d1c2e8f18 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.jsx @@ -1,4 +1,4 @@ -import {pickBy} from 'lodash'; +import pickBy from 'lodash/pickBy'; import qs from 'query-string'; import {getUtcDateString} from 'app/utils/dates'; diff --git a/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx b/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx index 1e63a7d21047..7aa22945cfc8 100644 --- a/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx @@ -1,5 +1,5 @@ import {css} from 'react-emotion'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/discover/result/utils.tsx b/src/sentry/static/sentry/app/views/discover/result/utils.tsx index 7b22a675dfc4..4c05b6b625e8 100644 --- a/src/sentry/static/sentry/app/views/discover/result/utils.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/utils.tsx @@ -1,4 +1,4 @@ -import {orderBy} from 'lodash'; +import orderBy from 'lodash/orderBy'; import Papa from 'papaparse'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx index 514d45d8bc73..94f28ba291f1 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import Button from 'app/components/button'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/events/events.jsx b/src/sentry/static/sentry/app/views/events/events.jsx index 2e3d68945957..66d7ad33bc4d 100644 --- a/src/sentry/static/sentry/app/views/events/events.jsx +++ b/src/sentry/static/sentry/app/views/events/events.jsx @@ -1,5 +1,5 @@ import {browserHistory} from 'react-router'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; import * as Sentry from '@sentry/browser'; diff --git a/src/sentry/static/sentry/app/views/events/eventsChart.jsx b/src/sentry/static/sentry/app/views/events/eventsChart.jsx index c72b421460d2..3a576cd279be 100644 --- a/src/sentry/static/sentry/app/views/events/eventsChart.jsx +++ b/src/sentry/static/sentry/app/views/events/eventsChart.jsx @@ -1,4 +1,4 @@ -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/views/events/searchBar.jsx b/src/sentry/static/sentry/app/views/events/searchBar.jsx index 631188ee90e2..796d4a8f35a2 100644 --- a/src/sentry/static/sentry/app/views/events/searchBar.jsx +++ b/src/sentry/static/sentry/app/views/events/searchBar.jsx @@ -1,5 +1,6 @@ import {css} from 'react-emotion'; -import {flatten, memoize} from 'lodash'; +import flatten from 'lodash/flatten'; +import memoize from 'lodash/memoize'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/events.tsx b/src/sentry/static/sentry/app/views/eventsV2/events.tsx index 132bbff1f406..c36e397cbc32 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/events.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/events.tsx @@ -2,7 +2,8 @@ import React from 'react'; import styled from 'react-emotion'; import * as ReactRouter from 'react-router'; import {Location} from 'history'; -import {omit, uniqBy} from 'lodash'; +import omit from 'lodash/omit'; +import uniqBy from 'lodash/uniqBy'; import {trackAnalyticsEvent} from 'app/utils/analytics'; import {Organization} from 'app/types'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/draggableColumns.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/draggableColumns.tsx index 696386dd0645..69f48ca31716 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/draggableColumns.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/draggableColumns.tsx @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import styled from 'react-emotion'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import space from 'app/styles/space'; import { diff --git a/src/sentry/static/sentry/app/views/eventsV2/tags.tsx b/src/sentry/static/sentry/app/views/eventsV2/tags.tsx index 120b7bc9adb0..611d93cbd17d 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/tags.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/tags.tsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import {Location} from 'history'; import {t} from 'app/locale'; import * as Sentry from '@sentry/browser'; diff --git a/src/sentry/static/sentry/app/views/incidents/details/activity/activity.tsx b/src/sentry/static/sentry/app/views/incidents/details/activity/activity.tsx index fc803e69f933..9a90c3d72eae 100644 --- a/src/sentry/static/sentry/app/views/incidents/details/activity/activity.tsx +++ b/src/sentry/static/sentry/app/views/incidents/details/activity/activity.tsx @@ -1,4 +1,4 @@ -import {groupBy} from 'lodash'; +import groupBy from 'lodash/groupBy'; import React from 'react'; import moment from 'moment'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/views/issueList/actions.jsx b/src/sentry/static/sentry/app/views/issueList/actions.jsx index 167596bdf07c..82d2732b0c4d 100644 --- a/src/sentry/static/sentry/app/views/issueList/actions.jsx +++ b/src/sentry/static/sentry/app/views/issueList/actions.jsx @@ -1,5 +1,5 @@ import {Flex, Box} from 'grid-emotion'; -import {capitalize} from 'lodash'; +import capitalize from 'lodash/capitalize'; import PropTypes from 'prop-types'; import React from 'react'; import Reflux from 'reflux'; diff --git a/src/sentry/static/sentry/app/views/issueList/overview.jsx b/src/sentry/static/sentry/app/views/issueList/overview.jsx index 454433ce8359..fb77b0fa0d08 100644 --- a/src/sentry/static/sentry/app/views/issueList/overview.jsx +++ b/src/sentry/static/sentry/app/views/issueList/overview.jsx @@ -1,5 +1,8 @@ import {browserHistory} from 'react-router'; -import {isEqual, omit, pickBy, uniq} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import omit from 'lodash/omit'; +import pickBy from 'lodash/pickBy'; +import uniq from 'lodash/uniq'; import Cookies from 'js-cookie'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx b/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx index 79ace15b17a6..df062cb94331 100644 --- a/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx +++ b/src/sentry/static/sentry/app/views/issueList/tagFilter.jsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.jsx index ef219b5761ff..6aee3f3c2f26 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.jsx @@ -1,5 +1,5 @@ import {browserHistory} from 'react-router'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import DocumentTitle from 'react-document-title'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx index 10a943d6ad9e..249f2dab26ff 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx @@ -1,5 +1,5 @@ import {browserHistory} from 'react-router'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx index bb96d7ad66b3..2248f78273f6 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import {browserHistory} from 'react-router'; import React from 'react'; -import {pick} from 'lodash'; +import pick from 'lodash/pick'; import SentryTypes from 'app/sentryTypes'; import {Panel, PanelBody} from 'app/components/panels'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.jsx index 4ca9ab4edb59..80deb38a6280 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.jsx @@ -1,4 +1,6 @@ -import {sortBy, property, isEqual} from 'lodash'; +import sortBy from 'lodash/sortBy'; +import property from 'lodash/property'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx index c324d75b91ed..f188bd991c30 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Box, Flex} from 'grid-emotion'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import SentryTypes from 'app/sentryTypes'; import Count from 'app/components/count'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx index f2f159011870..e05d7e4fded7 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import SentryTypes from 'app/sentryTypes'; import EventUserFeedback from 'app/components/events/userFeedback'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx index 38108210f73f..aee60c736c4e 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx @@ -1,5 +1,5 @@ import {Link} from 'react-router'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.jsx b/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.jsx index 72f9038e278d..059e26657fe0 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.jsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {groupBy} from 'lodash'; +import groupBy from 'lodash/groupBy'; import {tct} from 'app/locale'; import AddIntegration from 'app/views/organizationIntegrations/addIntegration'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/groupList.jsx b/src/sentry/static/sentry/app/views/releases/detail/groupList.jsx index d146982b39e5..7b877a0fdd48 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/groupList.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/groupList.jsx @@ -1,4 +1,4 @@ -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; import Reflux from 'reflux'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/index.jsx b/src/sentry/static/sentry/app/views/releases/detail/index.jsx index 685c68bde66d..0e00e6c79c66 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/index.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/index.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {pick} from 'lodash'; +import pick from 'lodash/pick'; import SentryTypes from 'app/sentryTypes'; import LoadingError from 'app/components/loadingError'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx b/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx index 474ecefe3c9d..e5f3efe3e292 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseArtifacts.jsx @@ -1,5 +1,5 @@ import {Flex} from 'grid-emotion'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx b/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx index dd04174167c9..7d63a196cd1e 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseCommits.jsx @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import React from 'react'; import {Panel, PanelHeader, PanelBody} from 'app/components/panels'; diff --git a/src/sentry/static/sentry/app/views/releases/list/utils.jsx b/src/sentry/static/sentry/app/views/releases/list/utils.jsx index fecd1829a9b6..e4bcb7979c05 100644 --- a/src/sentry/static/sentry/app/views/releases/list/utils.jsx +++ b/src/sentry/static/sentry/app/views/releases/list/utils.jsx @@ -1,4 +1,4 @@ -import {pick} from 'lodash'; +import pick from 'lodash/pick'; import {URL_PARAM} from 'app/constants/globalSelectionHeader'; /** diff --git a/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx b/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx index b3bbfbca19d2..bf925484cb32 100644 --- a/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {t} from 'app/locale'; import Button from 'app/components/button'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/draggableChart.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/draggableChart.tsx index d8610039482b..9e1e93b00b8f 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/draggableChart.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/draggableChart.tsx @@ -1,5 +1,6 @@ import {ECharts, EChartOption} from 'echarts'; -import {debounce, maxBy} from 'lodash'; +import debounce from 'lodash/debounce'; +import maxBy from 'lodash/maxBy'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx index fe11fa64fe45..474bdf5a084b 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx @@ -1,7 +1,9 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {find, flatMap, get} from 'lodash'; +import find from 'lodash/find'; +import flatMap from 'lodash/flatMap'; +import get from 'lodash/get'; import {t} from 'app/locale'; import {SENTRY_APP_PERMISSIONS} from 'app/constants'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/index.jsx index 9bd7a951802c..9a8c9f60f401 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/index.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx index ea8e3b7e373c..1ad486fa28be 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.jsx @@ -1,5 +1,5 @@ import {browserHistory} from 'react-router'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx index 7738c23de0d6..a7d91ecb496b 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.jsx @@ -1,6 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {get, uniq} from 'lodash'; +import get from 'lodash/get'; +import uniq from 'lodash/uniq'; import {t} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx index 439e97b0e51d..14333a2d4ad7 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.jsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import {Flex} from 'grid-emotion'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/userFeedback/container.jsx b/src/sentry/static/sentry/app/views/userFeedback/container.jsx index 6d80ae67a280..63d9f6aceb9c 100644 --- a/src/sentry/static/sentry/app/views/userFeedback/container.jsx +++ b/src/sentry/static/sentry/app/views/userFeedback/container.jsx @@ -1,7 +1,7 @@ import React from 'react'; import {Link} from 'react-router'; import PropTypes from 'prop-types'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import {t} from 'app/locale'; import Pagination from 'app/components/pagination'; import {Panel, PanelBody} from 'app/components/panels'; diff --git a/src/sentry/static/sentry/app/views/userFeedback/utils.jsx b/src/sentry/static/sentry/app/views/userFeedback/utils.jsx index 22e023cff0a7..c6cb32dbc695 100644 --- a/src/sentry/static/sentry/app/views/userFeedback/utils.jsx +++ b/src/sentry/static/sentry/app/views/userFeedback/utils.jsx @@ -1,4 +1,4 @@ -import {pick} from 'lodash'; +import pick from 'lodash/pick'; import qs from 'query-string'; import {URL_PARAM} from 'app/constants/globalSelectionHeader'; From 772d08871bac285e6c421096d397eaee5e6970cd Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Fri, 8 Nov 2019 15:00:52 -0800 Subject: [PATCH 3/9] change lodash imports to be modular --- src/sentry/static/sentry/app/api.tsx | 4 +++- .../activity/note/inputWithStorage.jsx | 4 ++-- .../sentry/app/components/asyncComponent.tsx | 2 +- .../components/bases/pluginComponentBase.jsx | 4 ++-- .../static/sentry/app/components/button.tsx | 2 +- .../sentry/app/components/contextData.jsx | 12 +++++++----- .../static/sentry/app/components/dateTime.tsx | 1 - .../app/components/dropdownAutoCompleteMenu.jsx | 4 ++-- .../components/events/contexts/contextBlock.jsx | 4 ++-- .../app/components/events/contexts/user.jsx | 4 ++-- .../sentry/app/components/events/errorItem.jsx | 8 +++++--- .../sentry/app/components/events/errors.jsx | 4 ++-- .../sentry/app/components/events/eventTags.tsx | 4 ++-- .../interfaces/breadcrumbs/crumbTable.jsx | 7 ++++--- .../events/interfaces/exceptionMechanism.jsx | 12 +++++++----- .../events/interfaces/keyValueList.jsx | 4 ++-- .../events/interfaces/spans/spanBar.tsx | 2 +- .../events/interfaces/spans/traceView.tsx | 4 +++- .../events/interfaces/spans/utils.tsx | 2 +- .../components/events/meta/annotatedText.jsx | 1 - .../app/components/events/meta/metaData.jsx | 4 ++-- .../app/components/events/meta/metaProxy.jsx | 13 +++++-------- .../static/sentry/app/components/forms/form.tsx | 4 ++-- .../static/sentry/app/components/inlineSvg.tsx | 2 +- .../sentry/app/components/links/listLink.jsx | 4 ++-- .../modals/sentryAppPublishRequestModal.tsx | 11 +++++++---- .../sentry/app/components/pluginConfig.jsx | 6 ++---- .../app/components/selectMembers/index.tsx | 2 +- .../app/components/smartSearchBar/index.jsx | 8 ++++---- .../sentry/app/components/stackedBarChart.jsx | 4 ++-- .../sentry/app/data/forms/projectDebugFiles.jsx | 14 ++++++++------ .../sentry/app/data/forms/sentryApplication.jsx | 1 - src/sentry/static/sentry/app/locale.tsx | 4 +++- src/sentry/static/sentry/app/options.jsx | 4 ++-- .../sentry/app/plugins/components/settings.jsx | 4 ++-- .../static/sentry/app/stores/eventStore.jsx | 4 ++-- .../static/sentry/app/stores/groupStore.jsx | 17 +++++++++-------- .../static/sentry/app/stores/hookStore.tsx | 6 +++--- .../static/sentry/app/stores/projectsStore.jsx | 4 ++-- .../static/sentry/app/stores/tagStore.jsx | 4 ++-- src/sentry/static/sentry/app/utils.tsx | 13 ++++++++----- .../app/utils/__mocks__/withLatestContext.tsx | 4 ++-- .../app/utils/__mocks__/withOrganization.tsx | 4 ++-- .../app/utils/getRouteStringFromRoutes.tsx | 2 +- src/sentry/static/sentry/app/utils/withApi.tsx | 4 ++-- .../sentry/app/utils/withOrganization.tsx | 4 ++-- .../static/sentry/app/utils/withProject.tsx | 4 ++-- .../sentry/app/utils/withTeamsForUser.tsx | 5 ++--- .../sentry/app/views/admin/adminSettings.jsx | 4 ++-- src/sentry/static/sentry/app/views/app.jsx | 3 ++- .../sentry/app/views/discover/queryBuilder.tsx | 3 ++- .../sentry/app/views/discover/result/index.tsx | 2 +- .../static/sentry/app/views/discover/utils.tsx | 3 ++- .../app/views/events/utils/eventsRequest.tsx | 3 ++- .../sentry/app/views/eventsV2/eventDetails.tsx | 2 +- .../sentry/app/views/eventsV2/eventView.tsx | 5 ++++- .../app/views/eventsV2/modalLineGraph.tsx | 2 +- .../app/views/eventsV2/modalPagination.tsx | 2 +- .../sentry/app/views/eventsV2/relatedEvents.tsx | 2 +- .../sentry/app/views/eventsV2/sortLink.tsx | 2 +- .../eventsV2/table/tableModalEditColumn.tsx | 2 +- .../static/sentry/app/views/eventsV2/utils.tsx | 3 ++- .../sentry/app/views/incidents/list/index.tsx | 2 +- .../sentry/app/views/issueList/sidebar.jsx | 10 ++++++---- .../organizationGroupDetails/groupActivity.jsx | 1 - .../groupMerged/mergedToolbar.jsx | 4 ++-- .../views/organizationIntegrations/index.tsx | 4 +++- .../integrationRepos.tsx | 2 +- .../projects/redirectDeprecatedProjectRoute.jsx | 4 ++-- .../app/views/projectsDashboard/index.jsx | 5 +++-- .../app/views/sentryAppExternalInstallation.jsx | 6 +++--- .../views/settings/components/forms/model.tsx | 4 ++-- .../settings/components/forms/richListField.jsx | 4 ++-- .../settings/incidentRules/ruleForm/index.tsx | 2 +- .../incidentRules/triggers/chart/index.tsx | 2 +- .../settings/incidentRules/triggers/form.tsx | 2 +- .../sentryApplicationDetails.tsx | 13 +++++++------ .../sentryApplicationRow.tsx | 3 ++- 78 files changed, 191 insertions(+), 164 deletions(-) diff --git a/src/sentry/static/sentry/app/api.tsx b/src/sentry/static/sentry/app/api.tsx index 47627ceccf0f..890c5592524b 100644 --- a/src/sentry/static/sentry/app/api.tsx +++ b/src/sentry/static/sentry/app/api.tsx @@ -1,4 +1,6 @@ -import {isUndefined, isNil, get} from 'lodash'; +import isUndefined from 'lodash/isUndefined'; +import isNil from 'lodash/isNil'; +import get from 'lodash/get'; import $ from 'jquery'; import * as Sentry from '@sentry/browser'; diff --git a/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.jsx b/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.jsx index d8c888f8c543..e48cd3477c67 100644 --- a/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.jsx +++ b/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.jsx @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; import * as Sentry from '@sentry/browser'; @@ -75,7 +75,7 @@ class NoteInputWithStorage extends React.Component { return onLoad(storageObj[itemKey]); }; - save = _.debounce(value => { + save = debounce(value => { const {itemKey, onSave} = this.props; const currentObj = this.fetchFromStorage() || {}; diff --git a/src/sentry/static/sentry/app/components/asyncComponent.tsx b/src/sentry/static/sentry/app/components/asyncComponent.tsx index 59f0ad3f770f..61109d5c5f64 100644 --- a/src/sentry/static/sentry/app/components/asyncComponent.tsx +++ b/src/sentry/static/sentry/app/components/asyncComponent.tsx @@ -1,4 +1,4 @@ -import {isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; import {Location} from 'history'; diff --git a/src/sentry/static/sentry/app/components/bases/pluginComponentBase.jsx b/src/sentry/static/sentry/app/components/bases/pluginComponentBase.jsx index f8d328cba5e4..4f7c48ca9cd5 100644 --- a/src/sentry/static/sentry/app/components/bases/pluginComponentBase.jsx +++ b/src/sentry/static/sentry/app/components/bases/pluginComponentBase.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import _ from 'lodash'; +import isFunction from 'lodash/isFunction'; import {Client} from 'app/api'; import {FormState, GenericField} from 'app/components/forms'; @@ -7,7 +7,7 @@ import IndicatorStore from 'app/stores/indicatorStore'; import {t} from 'app/locale'; const callbackWithArgs = function(callback, ...args) { - if (_.isFunction(callback)) { + if (isFunction(callback)) { callback = callback.bind(this, ...args); } else { callback = null; diff --git a/src/sentry/static/sentry/app/components/button.tsx b/src/sentry/static/sentry/app/components/button.tsx index d9ea1f2335c1..7f12434273b5 100644 --- a/src/sentry/static/sentry/app/components/button.tsx +++ b/src/sentry/static/sentry/app/components/button.tsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import styled, {css} from 'react-emotion'; import isPropValid from '@emotion/is-prop-valid'; -import {pickBy} from 'lodash'; +import pickBy from 'lodash/pickBy'; import ExternalLink from 'app/components/links/externalLink'; import InlineSvg from 'app/components/inlineSvg'; diff --git a/src/sentry/static/sentry/app/components/contextData.jsx b/src/sentry/static/sentry/app/components/contextData.jsx index a17a72c9b843..d5e45f929cfe 100644 --- a/src/sentry/static/sentry/app/components/contextData.jsx +++ b/src/sentry/static/sentry/app/components/contextData.jsx @@ -4,7 +4,9 @@ import React from 'react'; import classNames from 'classnames'; -import _ from 'lodash'; +import isString from 'lodash/isString'; +import isNumber from 'lodash/isNumber'; +import isArray from 'lodash/isArray'; import {isUrl} from 'app/utils'; @@ -116,7 +118,7 @@ class ContextData extends React.Component { return {'None'}; } else if (value === true || value === false) { return {value ? 'True' : 'False'}; - } else if (_.isString(value)) { + } else if (isString(value)) { const valueInfo = analyzeStringForRepr(value); const out = [ @@ -141,9 +143,9 @@ class ContextData extends React.Component { } return out; - } else if (_.isNumber(value)) { + } else if (isNumber(value)) { return {value}; - } else if (_.isArray(value)) { + } else if (isArray(value)) { for (i = 0; i < value.length; i++) { children.push( @@ -204,7 +206,7 @@ class ContextData extends React.Component { }; renderKeyPosValue = value => { - if (_.isString(value)) { + if (isString(value)) { return {value}; } return this.renderValue(value); diff --git a/src/sentry/static/sentry/app/components/dateTime.tsx b/src/sentry/static/sentry/app/components/dateTime.tsx index 7607dc2c1a0c..85ee88a6fcf8 100644 --- a/src/sentry/static/sentry/app/components/dateTime.tsx +++ b/src/sentry/static/sentry/app/components/dateTime.tsx @@ -1,7 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; import moment from 'moment-timezone'; -import _ from 'lodash'; import ConfigStore from 'app/stores/configStore'; diff --git a/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx b/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx index 043c2991fa7e..cd1cf463cad4 100644 --- a/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx +++ b/src/sentry/static/sentry/app/components/dropdownAutoCompleteMenu.jsx @@ -1,7 +1,7 @@ import {AutoSizer, List} from 'react-virtualized'; import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import flatMap from 'lodash/flatMap'; import styled from 'react-emotion'; import {t} from 'app/locale'; @@ -202,7 +202,7 @@ class DropdownAutoCompleteMenu extends React.Component { if (items[0] && items[0].items) { //if the first item has children, we assume it is a group - return _.flatMap(this.filterGroupedItems(items, inputValue), item => { + return flatMap(this.filterGroupedItems(items, inputValue), item => { const groupItems = item.items.map(groupedItem => ({ ...groupedItem, index: itemCount++, diff --git a/src/sentry/static/sentry/app/components/events/contexts/contextBlock.jsx b/src/sentry/static/sentry/app/components/events/contexts/contextBlock.jsx index 328b1749b9ce..eed42750dc42 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/contextBlock.jsx +++ b/src/sentry/static/sentry/app/components/events/contexts/contextBlock.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import sortBy from 'lodash/sortBy'; import {defined} from 'app/utils'; import ErrorBoundary from 'app/components/errorBoundary'; @@ -39,7 +39,7 @@ class ContextBlock extends React.Component { } if (extraData.length > 0) { - data = data.concat(_.sortBy(extraData, (key, value) => key)); + data = data.concat(sortBy(extraData, (key, value) => key)); } return ( diff --git a/src/sentry/static/sentry/app/components/events/contexts/user.jsx b/src/sentry/static/sentry/app/components/events/contexts/user.jsx index a144f991c614..3b4f438ac030 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/user.jsx +++ b/src/sentry/static/sentry/app/components/events/contexts/user.jsx @@ -1,7 +1,7 @@ /*eslint react/jsx-key:0*/ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import each from 'lodash/each'; import Avatar from 'app/components/avatar'; import ErrorBoundary from 'app/components/errorBoundary'; @@ -40,7 +40,7 @@ class UserContextType extends React.Component { user.name && builtins.push(['Name',
{user.name}
]); // We also attach user supplied data as 'user.data' - _.each(user.data, function(value, key) { + each(user.data, function(value, key) { children.push([key, value]); }); diff --git a/src/sentry/static/sentry/app/components/events/errorItem.jsx b/src/sentry/static/sentry/app/components/events/errorItem.jsx index a7c77078cf50..97293aa32541 100644 --- a/src/sentry/static/sentry/app/components/events/errorItem.jsx +++ b/src/sentry/static/sentry/app/components/events/errorItem.jsx @@ -1,4 +1,6 @@ -import _ from 'lodash'; +import mapKeys from 'lodash/mapKeys'; +import startCase from 'lodash/startCase'; +import isEmpty from 'lodash/isEmpty'; import React from 'react'; import KeyValueList from 'app/components/events/interfaces/keyValueList'; import {t} from 'app/locale'; @@ -51,7 +53,7 @@ class EventErrorItem extends React.Component { data.image_path = path.length ? path.join(separator) + separator : ''; } - return _.mapKeys(data, (value, key) => t(keyMapping[key] || _.startCase(key))); + return mapKeys(data, (value, key) => t(keyMapping[key] || startCase(key))); } renderPath() { @@ -77,7 +79,7 @@ class EventErrorItem extends React.Component {
  • {this.renderPath()} {error.message} - {!_.isEmpty(data) && ( + {!isEmpty(data) && ( {' '} diff --git a/src/sentry/static/sentry/app/components/events/errors.jsx b/src/sentry/static/sentry/app/components/events/errors.jsx index af8ab8a8d003..68f8b2f32a2f 100644 --- a/src/sentry/static/sentry/app/components/events/errors.jsx +++ b/src/sentry/static/sentry/app/components/events/errors.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import _ from 'lodash'; +import uniqWith from 'lodash/uniqWith'; import EventDataSection from 'app/components/events/eventDataSection'; import EventErrorItem from 'app/components/events/errorItem'; @@ -32,7 +32,7 @@ class EventErrors extends React.Component { }; uniqueErrors = errors => { - return _.uniqWith(errors, _.isEqual); + return uniqWith(errors, _.isEqual); }; render() { diff --git a/src/sentry/static/sentry/app/components/events/eventTags.tsx b/src/sentry/static/sentry/app/components/events/eventTags.tsx index 5020487afa2d..9bec4be25cfc 100644 --- a/src/sentry/static/sentry/app/components/events/eventTags.tsx +++ b/src/sentry/static/sentry/app/components/events/eventTags.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {Link} from 'react-router'; -import _ from 'lodash'; +import isEmpty from 'lodash/isEmpty'; import queryString from 'query-string'; import {Location} from 'history'; @@ -75,7 +75,7 @@ class EventTags extends React.Component { const {event, orgId, hideGuide} = this.props; const {tags} = event; - if (_.isEmpty(tags)) { + if (isEmpty(tags)) { return null; } diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/crumbTable.jsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/crumbTable.jsx index 35979c6146b9..a37b11bcf088 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/crumbTable.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/crumbTable.jsx @@ -1,6 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import map from 'lodash/map'; +import isObject from 'lodash/isObject'; import Category from 'app/components/events/interfaces/breadcrumbs/category'; @@ -15,12 +16,12 @@ class CrumbTable extends React.Component { if (!this.props.kvData) { return null; } - return _.map(this.props.kvData, (val, key) => { + return map(this.props.kvData, (val, key) => { return ( {key} -
    {_.isObject(val) ? JSON.stringify(val) : val}
    +
    {isObject(val) ? JSON.stringify(val) : val}
    ); diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx b/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx index 553b4c4edeac..464a52a480df 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx @@ -1,4 +1,6 @@ -import _ from 'lodash'; +import isNil from 'lodash/isNil'; +import forOwn from 'lodash/forOwn'; +import isObject from 'lodash/isObject'; import PropTypes from 'prop-types'; import React from 'react'; import Pills from 'app/components/pills'; @@ -68,7 +70,7 @@ class ExceptionMechanism extends React.Component { , ]; - if (!_.isNil(handled)) { + if (!isNil(handled)) { pills.push(); } @@ -85,12 +87,12 @@ class ExceptionMechanism extends React.Component { if (signal) { const code = signal.code_name || `${t('code')} ${signal.code}`; const name = signal.name || signal.number; - const value = _.isNil(signal.code) ? name : `${name} (${code})`; + const value = isNil(signal.code) ? name : `${name} (${code})`; pills.push(); } - _.forOwn(data, (value, key) => { - if (!_.isObject(value)) { + forOwn(data, (value, key) => { + if (!isObject(value)) { pills.push(); } }); diff --git a/src/sentry/static/sentry/app/components/events/interfaces/keyValueList.jsx b/src/sentry/static/sentry/app/components/events/interfaces/keyValueList.jsx index aa4cd8c08c26..4647af5ba364 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/keyValueList.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/keyValueList.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import sortBy from 'lodash/sortBy'; import ContextData from 'app/components/contextData'; @@ -32,7 +32,7 @@ class KeyValueList extends React.Component { data = data.filter(kv => kv !== null); } - data = this.props.isSorted ? _.sortBy(data, [([key]) => key]) : data; + data = this.props.isSorted ? sortBy(data, [([key]) => key]) : data; const raw = this.props.raw; const props = this.props.onClick ? {onClick: this.props.onClick} : {}; return ( diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx index c9159a41c39f..69e32e8ee1ca 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from 'react-emotion'; -import {get} from 'lodash'; +import get from 'lodash/get'; import color from 'color'; import 'intersection-observer'; // this is a polyfill diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx index 0cfbb0a423f5..9512f6449efe 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx @@ -1,5 +1,7 @@ import React from 'react'; -import {get, set, isNumber} from 'lodash'; +import get from 'lodash/get'; +import set from 'lodash/set'; +import isNumber from 'lodash/isNumber'; import {t} from 'app/locale'; import EmptyStateWarning from 'app/components/emptyStateWarning'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx index 4d25b339d94a..b57891b9ba09 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx @@ -1,4 +1,4 @@ -import {isString} from 'lodash'; +import isString from 'lodash/isString'; import {divergentColorScale, spanColors} from 'app/utils/theme'; type Rect = { diff --git a/src/sentry/static/sentry/app/components/events/meta/annotatedText.jsx b/src/sentry/static/sentry/app/components/events/meta/annotatedText.jsx index f1c9832f7f2b..b6e6eea31ded 100644 --- a/src/sentry/static/sentry/app/components/events/meta/annotatedText.jsx +++ b/src/sentry/static/sentry/app/components/events/meta/annotatedText.jsx @@ -1,4 +1,3 @@ -import _ from 'lodash'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/components/events/meta/metaData.jsx b/src/sentry/static/sentry/app/components/events/meta/metaData.jsx index 1bf713531211..1396b95db2e8 100644 --- a/src/sentry/static/sentry/app/components/events/meta/metaData.jsx +++ b/src/sentry/static/sentry/app/components/events/meta/metaData.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import isNil from 'lodash/isNil'; import {getMeta} from 'app/components/events/meta/metaProxy'; import ErrorBoundary from 'app/components/errorBoundary'; @@ -30,7 +30,7 @@ export default class MetaData extends React.Component { return ( - {required && _.isNil(value) && !meta ? null : children(value, meta)} + {required && isNil(value) && !meta ? null : children(value, meta)} ); } diff --git a/src/sentry/static/sentry/app/components/events/meta/metaProxy.jsx b/src/sentry/static/sentry/app/components/events/meta/metaProxy.jsx index 82c387622a0f..be2144995a7b 100644 --- a/src/sentry/static/sentry/app/components/events/meta/metaProxy.jsx +++ b/src/sentry/static/sentry/app/components/events/meta/metaProxy.jsx @@ -1,13 +1,14 @@ -import _ from 'lodash'; +import isEmpty from 'lodash/isEmpty'; +import isNull from 'lodash/isNull'; const GET_META = Symbol('GET_META'); const IS_PROXY = Symbol('IS_PROXY'); function isAnnotated(meta) { - if (_.isEmpty(meta)) { + if (isEmpty(meta)) { return false; } - return !_.isEmpty(meta.rem) || !_.isEmpty(meta.err); + return !isEmpty(meta.rem) || !isEmpty(meta.err); } export class MetaProxy { @@ -38,11 +39,7 @@ export class MetaProxy { } const value = Reflect.get(obj, prop, receiver); - if ( - !Reflect.has(obj, prop, receiver) || - typeof value !== 'object' || - _.isNull(value) - ) { + if (!Reflect.has(obj, prop, receiver) || typeof value !== 'object' || isNull(value)) { return value; } diff --git a/src/sentry/static/sentry/app/components/forms/form.tsx b/src/sentry/static/sentry/app/components/forms/form.tsx index ba5e285687e6..0ced23b58a40 100644 --- a/src/sentry/static/sentry/app/components/forms/form.tsx +++ b/src/sentry/static/sentry/app/components/forms/form.tsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import isEqual from 'lodash/isEqual'; import styled from 'react-emotion'; import FormState from 'app/components/forms/state'; @@ -163,7 +163,7 @@ class Form< const {initialData, data} = this.state; const {errorMessage, hideErrors, requireChanges} = this.props; const hasChanges = requireChanges - ? Object.keys(data).length && !_.isEqual(data, initialData) + ? Object.keys(data).length && !isEqual(data, initialData) : true; const isError = this.state.state === FormState.ERROR; const nonFieldErrors = this.state.errors && this.state.errors.non_field_errors; diff --git a/src/sentry/static/sentry/app/components/inlineSvg.tsx b/src/sentry/static/sentry/app/components/inlineSvg.tsx index 6f6276a3b752..fbfbb57b3bb3 100644 --- a/src/sentry/static/sentry/app/components/inlineSvg.tsx +++ b/src/sentry/static/sentry/app/components/inlineSvg.tsx @@ -1,4 +1,4 @@ -import {pickBy} from 'lodash'; +import pickBy from 'lodash/pickBy'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/components/links/listLink.jsx b/src/sentry/static/sentry/app/components/links/listLink.jsx index 45a980d56369..2607820e9f66 100644 --- a/src/sentry/static/sentry/app/components/links/listLink.jsx +++ b/src/sentry/static/sentry/app/components/links/listLink.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import omit from 'lodash/omit'; import {Link} from 'react-router'; import classNames from 'classnames'; @@ -51,7 +51,7 @@ class ListLink extends React.Component { }; render() { - const carriedProps = _.omit(this.props, 'activeClassName', 'isActive', 'index'); + const carriedProps = omit(this.props, 'activeClassName', 'isActive', 'index'); return (
  • diff --git a/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx b/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx index 608f4f90a151..bea4054c35a4 100644 --- a/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx @@ -3,7 +3,7 @@ import styled from 'react-emotion'; import PropTypes from 'prop-types'; import React from 'react'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import _ from 'lodash'; +import intersection from 'lodash/intersection'; import {SentryApp, Scope} from 'app/types'; import {t} from 'app/locale'; @@ -23,9 +23,12 @@ const getPermissionSelectionsFromScopes = (scopes: Scope[]) => { let highestChoice: PermissionChoice | undefined; for (const perm in permObj.choices) { const choice = permObj.choices[perm]; - const intersection = _.intersection(choice.scopes, scopes); - if (intersection.length > 0 && intersection.length === choice.scopes.length) { - if (!highestChoice || intersection.length > highestChoice.scopes.length) { + const scopesIntersection = intersection(choice.scopes, scopes); + if ( + scopesIntersection.length > 0 && + scopesIntersection.length === choice.scopes.length + ) { + if (!highestChoice || scopesIntersection.length > highestChoice.scopes.length) { highestChoice = choice; } } diff --git a/src/sentry/static/sentry/app/components/pluginConfig.jsx b/src/sentry/static/sentry/app/components/pluginConfig.jsx index de27c98e9c9a..efc8c6fe900d 100644 --- a/src/sentry/static/sentry/app/components/pluginConfig.jsx +++ b/src/sentry/static/sentry/app/components/pluginConfig.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import isEqual from 'lodash/isEqual'; import styled from 'react-emotion'; import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; @@ -45,9 +45,7 @@ class PluginConfig extends React.Component { } shouldComponentUpdate(nextProps, nextState) { - return ( - !_.isEqual(nextState, this.state) || !_.isEqual(nextProps.data, this.props.data) - ); + return !isEqual(nextState, this.state) || !isEqual(nextProps.data, this.props.data); } loadPlugin(data) { diff --git a/src/sentry/static/sentry/app/components/selectMembers/index.tsx b/src/sentry/static/sentry/app/components/selectMembers/index.tsx index 8b94dd1f8ed8..ab2bd01d1173 100644 --- a/src/sentry/static/sentry/app/components/selectMembers/index.tsx +++ b/src/sentry/static/sentry/app/components/selectMembers/index.tsx @@ -1,4 +1,4 @@ -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx b/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx index ac2604efaa23..c8a372198cf7 100644 --- a/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx +++ b/src/sentry/static/sentry/app/components/smartSearchBar/index.jsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import Reflux from 'reflux'; import * as Sentry from '@sentry/browser'; -import _ from 'lodash'; +import debounce from 'lodash/debounce'; import createReactClass from 'create-react-class'; import styled, {css} from 'react-emotion'; @@ -465,7 +465,7 @@ class SmartSearchBar extends React.Component { * Returns array of tag values that substring match `query`; invokes `callback` * with data when ready */ - getTagValues = _.debounce( + getTagValues = debounce( async (tag, query) => { // Strip double quotes if there are any query = query.replace(/"/g, '').trim(); @@ -513,7 +513,7 @@ class SmartSearchBar extends React.Component { /** * Get recent searches */ - getRecentSearches = _.debounce( + getRecentSearches = debounce( async () => { const {savedSearchType, hasRecentSearches, onGetRecentSearches} = this.props; // `savedSearchType` can be 0 @@ -553,7 +553,7 @@ class SmartSearchBar extends React.Component { return []; }; - getReleases = _.debounce( + getReleases = debounce( async (tag, query) => { const releasePromise = this.fetchReleases(query); diff --git a/src/sentry/static/sentry/app/components/stackedBarChart.jsx b/src/sentry/static/sentry/app/components/stackedBarChart.jsx index 65f6c79a8e4e..fd9cb2f4f6f1 100644 --- a/src/sentry/static/sentry/app/components/stackedBarChart.jsx +++ b/src/sentry/static/sentry/app/components/stackedBarChart.jsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import moment from 'moment-timezone'; -import _ from 'lodash'; +import isEqual from 'lodash/isEqual'; import styled, {cx} from 'react-emotion'; import Tooltip from 'app/components/tooltip'; @@ -101,7 +101,7 @@ class StackedBarChart extends React.Component { } shouldComponentUpdate(nextProps, nextState) { - return !_.isEqual(this.props, nextProps); + return !isEqual(this.props, nextProps); } getInterval = series => { diff --git a/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx b/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx index 8cb4083659db..f586bcb29566 100644 --- a/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx +++ b/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx @@ -1,4 +1,6 @@ -import _ from 'lodash'; +import isObject from 'lodash/isObject'; +import forEach from 'lodash/forEach'; +import set from 'lodash/set'; import React from 'react'; import {t} from 'app/locale'; @@ -13,9 +15,9 @@ export const route = '/settings/:orgId/projects/:projectId/debug-symbols/'; function flattenKeys(obj) { const result = {}; - _.forEach(obj, (value, key) => { - if (_.isObject(value)) { - _.forEach(value, (innerValue, innerKey) => { + forEach(obj, (value, key) => { + if (isObject(value)) { + forEach(value, (innerValue, innerKey) => { result[`${key}.${innerKey}`] = innerValue; }); } else { @@ -27,8 +29,8 @@ function flattenKeys(obj) { function unflattenKeys(obj) { const result = {}; - _.forEach(obj, (value, key) => { - _.set(result, key.split('.'), value); + forEach(obj, (value, key) => { + set(result, key.split('.'), value); }); return result; } diff --git a/src/sentry/static/sentry/app/data/forms/sentryApplication.jsx b/src/sentry/static/sentry/app/data/forms/sentryApplication.jsx index 116c17c18591..9ed1caffd338 100644 --- a/src/sentry/static/sentry/app/data/forms/sentryApplication.jsx +++ b/src/sentry/static/sentry/app/data/forms/sentryApplication.jsx @@ -1,5 +1,4 @@ import React from 'react'; -import _ from 'lodash'; import {extractMultilineFields} from 'app/utils'; import {tct} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/locale.tsx b/src/sentry/static/sentry/app/locale.tsx index 091f98ef4bbe..4b152a9a799b 100644 --- a/src/sentry/static/sentry/app/locale.tsx +++ b/src/sentry/static/sentry/app/locale.tsx @@ -1,7 +1,9 @@ import React from 'react'; import Jed from 'jed'; import {sprintf} from 'sprintf-js'; -import {isString, isArray, isObject} from 'lodash'; +import isString from 'lodash/isString'; +import isArray from 'lodash/isArray'; +import isObject from 'lodash/isObject'; import {css} from 'react-emotion'; import {getTranslations} from 'app/translations'; diff --git a/src/sentry/static/sentry/app/options.jsx b/src/sentry/static/sentry/app/options.jsx index f6c6253b0cce..6ee8b96b910f 100644 --- a/src/sentry/static/sentry/app/options.jsx +++ b/src/sentry/static/sentry/app/options.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import _ from 'lodash'; +import keyBy from 'lodash/keyBy'; import ConfigStore from 'app/stores/configStore'; import {t, tct} from 'app/locale'; import { @@ -159,7 +159,7 @@ const definitions = [ }, ]; -const definitionsMap = _.keyBy(definitions, def => def.key); +const definitionsMap = keyBy(definitions, def => def.key); const disabledReasons = { diskPriority: diff --git a/src/sentry/static/sentry/app/plugins/components/settings.jsx b/src/sentry/static/sentry/app/plugins/components/settings.jsx index ae3f301a9d96..afbe91da18c2 100644 --- a/src/sentry/static/sentry/app/plugins/components/settings.jsx +++ b/src/sentry/static/sentry/app/plugins/components/settings.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import _ from 'lodash'; +import isEqual from 'lodash/isEqual'; import styled from 'react-emotion'; import {Form, FormState} from 'app/components/forms'; @@ -112,7 +112,7 @@ class PluginSettings extends PluginComponentBase { return ; } const isSaving = this.state.state === FormState.SAVING; - const hasChanges = !_.isEqual(this.state.initialData, this.state.formData); + const hasChanges = !isEqual(this.state.initialData, this.state.formData); const data = this.state.rawData; if (data.config_error) { diff --git a/src/sentry/static/sentry/app/stores/eventStore.jsx b/src/sentry/static/sentry/app/stores/eventStore.jsx index dfd2ddf00af6..28d2574b0f3a 100644 --- a/src/sentry/static/sentry/app/stores/eventStore.jsx +++ b/src/sentry/static/sentry/app/stores/eventStore.jsx @@ -1,6 +1,6 @@ import $ from 'jquery'; import Reflux from 'reflux'; -import _ from 'lodash'; +import isArray from 'lodash/isArray'; const EventStore = Reflux.createStore({ init() { @@ -24,7 +24,7 @@ const EventStore = Reflux.createStore({ }, add(items) { - if (!_.isArray(items)) { + if (!isArray(items)) { items = [items]; } diff --git a/src/sentry/static/sentry/app/stores/groupStore.jsx b/src/sentry/static/sentry/app/stores/groupStore.jsx index b4261e98d184..6c15b8538771 100644 --- a/src/sentry/static/sentry/app/stores/groupStore.jsx +++ b/src/sentry/static/sentry/app/stores/groupStore.jsx @@ -1,4 +1,5 @@ -import _ from 'lodash'; +import isArray from 'lodash/isArray'; +import isUndefined from 'lodash/isUndefined'; import Reflux from 'reflux'; import GroupActions from 'app/actions/groupActions'; @@ -39,7 +40,7 @@ const GroupStore = Reflux.createStore({ }, add(items) { - if (!_.isArray(items)) { + if (!isArray(items)) { items = [items]; } @@ -80,21 +81,21 @@ const GroupStore = Reflux.createStore({ }, addStatus(id, status) { - if (_.isUndefined(this.statuses[id])) { + if (isUndefined(this.statuses[id])) { this.statuses[id] = {}; } this.statuses[id][status] = true; }, clearStatus(id, status) { - if (_.isUndefined(this.statuses[id])) { + if (isUndefined(this.statuses[id])) { return; } this.statuses[id][status] = false; }, hasStatus(id, status) { - if (_.isUndefined(this.statuses[id])) { + if (isUndefined(this.statuses[id])) { return false; } return this.statuses[id][status] || false; @@ -208,7 +209,7 @@ const GroupStore = Reflux.createStore({ // regroup pending changes by their itemID const pendingById = {}; this.pendingChanges.forEach(change => { - if (_.isUndefined(pendingById[change.id])) { + if (isUndefined(pendingById[change.id])) { pendingById[change.id] = []; } pendingById[change.id].push(change); @@ -216,7 +217,7 @@ const GroupStore = Reflux.createStore({ return this.items.map(item => { let rItem = item; - if (!_.isUndefined(pendingById[item.id])) { + if (!isUndefined(pendingById[item.id])) { // copy the object so dirty state doesnt mutate original rItem = {...rItem}; pendingById[item.id].forEach(change => { @@ -350,7 +351,7 @@ const GroupStore = Reflux.createStore({ * If itemIds is undefined, returns all ids in the store */ _itemIdsOrAll(itemIds) { - if (_.isUndefined(itemIds)) { + if (isUndefined(itemIds)) { itemIds = this.items.map(item => item.id); } return itemIds; diff --git a/src/sentry/static/sentry/app/stores/hookStore.tsx b/src/sentry/static/sentry/app/stores/hookStore.tsx index 238c7bf1f1bc..0ac4f953eff6 100644 --- a/src/sentry/static/sentry/app/stores/hookStore.tsx +++ b/src/sentry/static/sentry/app/stores/hookStore.tsx @@ -1,5 +1,5 @@ import Reflux from 'reflux'; -import _ from 'lodash'; +import isUndefined from 'lodash/isUndefined'; import * as Sentry from '@sentry/browser'; import {Hooks, HookName} from 'app/types/hooks'; @@ -79,7 +79,7 @@ const hookStoreConfig: Reflux.StoreDefinition & HookStoreInterface = { }); } - if (_.isUndefined(this.hooks[hookName])) { + if (isUndefined(this.hooks[hookName])) { this.hooks[hookName] = []; } @@ -88,7 +88,7 @@ const hookStoreConfig: Reflux.StoreDefinition & HookStoreInterface = { }, remove(hookName, callback) { - if (_.isUndefined(this.hooks[hookName])) { + if (isUndefined(this.hooks[hookName])) { return; } this.hooks[hookName] = this.hooks[hookName]!.filter(cb => { diff --git a/src/sentry/static/sentry/app/stores/projectsStore.jsx b/src/sentry/static/sentry/app/stores/projectsStore.jsx index dc00614bcaf2..e67c879f0ae5 100644 --- a/src/sentry/static/sentry/app/stores/projectsStore.jsx +++ b/src/sentry/static/sentry/app/stores/projectsStore.jsx @@ -1,5 +1,5 @@ import Reflux from 'reflux'; -import _ from 'lodash'; +import each from 'lodash/each'; import ProjectActions from 'app/actions/projectActions'; import TeamActions from 'app/actions/teamActions'; @@ -76,7 +76,7 @@ const ProjectsStore = Reflux.createStore({ onStatsLoadSuccess(data) { const touchedIds = []; - _.each(data || [], (stats, projectId) => { + each(data || [], (stats, projectId) => { if (projectId in this.itemsById) { this.itemsById[projectId].stats = stats; touchedIds.push(projectId); diff --git a/src/sentry/static/sentry/app/stores/tagStore.jsx b/src/sentry/static/sentry/app/stores/tagStore.jsx index e247057bb5cf..3c6988d905b4 100644 --- a/src/sentry/static/sentry/app/stores/tagStore.jsx +++ b/src/sentry/static/sentry/app/stores/tagStore.jsx @@ -1,5 +1,5 @@ import Reflux from 'reflux'; -import _ from 'lodash'; +import reduce from 'lodash/reduce'; import TagActions from 'app/actions/tagActions'; import MemberListStore from 'app/stores/memberListStore'; @@ -119,7 +119,7 @@ const TagStore = Reflux.createStore({ onLoadTagsSuccess(data) { Object.assign( this.tags, - _.reduce( + reduce( data, (obj, tag) => { tag = Object.assign( diff --git a/src/sentry/static/sentry/app/utils.tsx b/src/sentry/static/sentry/app/utils.tsx index c47ef48cd6b5..0386d79c6f11 100644 --- a/src/sentry/static/sentry/app/utils.tsx +++ b/src/sentry/static/sentry/app/utils.tsx @@ -1,5 +1,8 @@ -import _ from 'lodash'; import {Query} from 'history'; +import isArray from 'lodash/isArray'; +import isObject from 'lodash/isObject'; +import isString from 'lodash/isString'; +import isUndefined from 'lodash/isUndefined'; import {NewQuery} from 'app/stores/discoverSavedQueriesStore'; import {Project} from 'app/types/index'; @@ -26,11 +29,11 @@ function arrayIsEqual(arr?: any[], other?: any[], deep?: boolean): boolean { export function valueIsEqual(value?: any, other?: any, deep?: boolean): boolean { if (value === other) { return true; - } else if (_.isArray(value) || _.isArray(other)) { + } else if (isArray(value) || isArray(other)) { if (arrayIsEqual(value, other, deep)) { return true; } - } else if (_.isObject(value) || _.isObject(other)) { + } else if (isObject(value) || isObject(other)) { if (objectMatchesSubset(value, other, deep)) { return true; } @@ -111,7 +114,7 @@ export function explodeSlug(slug: string): string { } export function defined(item: any): boolean { - return !_.isUndefined(item) && item !== null; + return !isUndefined(item) && item !== null; } export function nl2br(str: string): string { @@ -125,7 +128,7 @@ export function nl2br(str: string): string { export function isUrl(str: any): boolean { return ( !!str && - _.isString(str) && + isString(str) && (str.indexOf('http://') === 0 || str.indexOf('https://') === 0) ); } diff --git a/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx b/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx index ed017c6cddcf..98bff2a50717 100644 --- a/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx +++ b/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx @@ -11,10 +11,10 @@ const DEFAULTS = { }; const withLatestContextMock = WrappedComponent => - class WithLatestContextMockWrapper extends React.Component { + (class WithLatestContextMockWrapper extends React.Component { render() { return ; } - }; + }); export default withLatestContextMock; diff --git a/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx b/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx index 0d5ce2c1548a..66626cb5805c 100644 --- a/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx +++ b/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx @@ -5,7 +5,7 @@ import SentryTypes from 'app/sentryTypes'; declare const TestStubs; const withOrganizationMock = WrappedComponent => - class WithOrganizationMockWrapper extends React.Component { + (class WithOrganizationMockWrapper extends React.Component { static contextTypes = { organization: SentryTypes.Organization, }; @@ -17,6 +17,6 @@ const withOrganizationMock = WrappedComponent => /> ); } - }; + }); export default withOrganizationMock; diff --git a/src/sentry/static/sentry/app/utils/getRouteStringFromRoutes.tsx b/src/sentry/static/sentry/app/utils/getRouteStringFromRoutes.tsx index 12335857bdfe..854dde541e05 100644 --- a/src/sentry/static/sentry/app/utils/getRouteStringFromRoutes.tsx +++ b/src/sentry/static/sentry/app/utils/getRouteStringFromRoutes.tsx @@ -1,5 +1,5 @@ import {PlainRoute} from 'react-router/lib/Route'; -import {findLastIndex} from 'lodash'; +import findLastIndex from 'lodash/findLastIndex'; type RouteWithPath = Omit & Required>; diff --git a/src/sentry/static/sentry/app/utils/withApi.tsx b/src/sentry/static/sentry/app/utils/withApi.tsx index 01f602d9551d..e0d2473a961b 100644 --- a/src/sentry/static/sentry/app/utils/withApi.tsx +++ b/src/sentry/static/sentry/app/utils/withApi.tsx @@ -29,7 +29,7 @@ const withApi =

    ( WrappedComponent: React.ComponentType

    , {persistInFlight}: OptionProps = {} ) => - class extends React.Component> { + (class extends React.Component> { static displayName = `withApi(${getDisplayName(WrappedComponent)})`; constructor(props: WrappedProps

    ) { @@ -48,6 +48,6 @@ const withApi =

    ( render() { return ; } - }; + }); export default withApi; diff --git a/src/sentry/static/sentry/app/utils/withOrganization.tsx b/src/sentry/static/sentry/app/utils/withOrganization.tsx index 9f7d3127bb1c..66ec3ae12318 100644 --- a/src/sentry/static/sentry/app/utils/withOrganization.tsx +++ b/src/sentry/static/sentry/app/utils/withOrganization.tsx @@ -11,7 +11,7 @@ type InjectedOrganizationProps = { const withOrganization =

    ( WrappedComponent: React.ComponentType

    ) => - class extends React.Component< + (class extends React.Component< Omit & Partial > { static displayName = `withOrganization(${getDisplayName(WrappedComponent)})`; @@ -27,6 +27,6 @@ const withOrganization =

    ( /> ); } - }; + }); export default withOrganization; diff --git a/src/sentry/static/sentry/app/utils/withProject.tsx b/src/sentry/static/sentry/app/utils/withProject.tsx index 1f946507be0c..cd36aab946e1 100644 --- a/src/sentry/static/sentry/app/utils/withProject.tsx +++ b/src/sentry/static/sentry/app/utils/withProject.tsx @@ -14,7 +14,7 @@ type InjectedProjectProps = { const withProject =

    ( WrappedComponent: React.ComponentType

    ) => - class extends React.Component< + (class extends React.Component< Omit & Partial > { static displayName = `withProject(${getDisplayName(WrappedComponent)})`; @@ -30,6 +30,6 @@ const withProject =

    ( /> ); } - }; + }); export default withProject; diff --git a/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx b/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx index 67e329d8f41f..7bcdd0d830a8 100644 --- a/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx +++ b/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import _ from 'lodash'; import {Client} from 'app/api'; import {Organization, Project, Team, TeamWithProjects} from 'app/types'; @@ -23,7 +22,7 @@ type InjectedTeamsProps = { const withTeamsForUser =

    ( WrappedComponent: React.ComponentType

    ) => - class extends React.Component< + (class extends React.Component< Omit & Partial & DependentProps, InjectedTeamsProps > { @@ -101,6 +100,6 @@ const withTeamsForUser =

    ( render() { return ; } - }; + }); export default withTeamsForUser; diff --git a/src/sentry/static/sentry/app/views/admin/adminSettings.jsx b/src/sentry/static/sentry/app/views/admin/adminSettings.jsx index f9492fb4d1b6..28d24d702183 100644 --- a/src/sentry/static/sentry/app/views/admin/adminSettings.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminSettings.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import _ from 'lodash'; +import isUndefined from 'lodash/isUndefined'; import AsyncView from 'app/views/asyncView'; import {t} from 'app/locale'; @@ -36,7 +36,7 @@ export default class AdminSettings extends AsyncView { for (const key of optionsAvailable) { // TODO(dcramer): we should not be mutating options const option = data[key] || {field: {}}; - if (_.isUndefined(option.value) || option.value === '') { + if (isUndefined(option.value) || option.value === '') { const defn = getOption(key); initialData[key] = defn.defaultValue ? defn.defaultValue() : ''; } else { diff --git a/src/sentry/static/sentry/app/views/app.jsx b/src/sentry/static/sentry/app/views/app.jsx index f4f61a050b54..8def0f99dcbd 100644 --- a/src/sentry/static/sentry/app/views/app.jsx +++ b/src/sentry/static/sentry/app/views/app.jsx @@ -1,7 +1,8 @@ import $ from 'jquery'; import {ThemeProvider} from 'emotion-theming'; import {browserHistory} from 'react-router'; -import {get, isEqual} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import get from 'lodash/get'; import {injectGlobal} from 'emotion'; import Cookies from 'js-cookie'; import PropTypes from 'prop-types'; diff --git a/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx b/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx index 952f283ad410..5859f7aed3b3 100644 --- a/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx +++ b/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {uniq, partition} from 'lodash'; +import uniq from 'lodash/uniq'; +import partition from 'lodash/partition'; import moment from 'moment-timezone'; import {Client} from 'app/api'; diff --git a/src/sentry/static/sentry/app/views/discover/result/index.tsx b/src/sentry/static/sentry/app/views/discover/result/index.tsx index cb4bde755ef8..2a5417e77e68 100644 --- a/src/sentry/static/sentry/app/views/discover/result/index.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {throttle} from 'lodash'; +import throttle from 'lodash/throttle'; import {t} from 'app/locale'; import getDynamicText from 'app/utils/getDynamicText'; diff --git a/src/sentry/static/sentry/app/views/discover/utils.tsx b/src/sentry/static/sentry/app/views/discover/utils.tsx index 99f789a44837..83f65ecc0391 100644 --- a/src/sentry/static/sentry/app/views/discover/utils.tsx +++ b/src/sentry/static/sentry/app/views/discover/utils.tsx @@ -1,5 +1,6 @@ import {Client} from 'app/api'; -import {isEqual, pick} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import pick from 'lodash/pick'; import moment from 'moment'; import qs from 'query-string'; diff --git a/src/sentry/static/sentry/app/views/events/utils/eventsRequest.tsx b/src/sentry/static/sentry/app/views/events/utils/eventsRequest.tsx index 96027dd863ab..81e471dbf41a 100644 --- a/src/sentry/static/sentry/app/views/events/utils/eventsRequest.tsx +++ b/src/sentry/static/sentry/app/views/events/utils/eventsRequest.tsx @@ -1,4 +1,5 @@ -import {isEqual, omitBy} from 'lodash'; +import isEqual from 'lodash/isEqual'; +import omitBy from 'lodash/omitBy'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventDetails.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventDetails.tsx index df5348e0b4bb..decb35d6d2ac 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventDetails.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventDetails.tsx @@ -1,7 +1,7 @@ import {Params} from 'react-router/lib/Router'; import {browserHistory} from 'react-router'; import styled, {css} from 'react-emotion'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx index 1976d955323d..1b21d8689935 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventView.tsx @@ -1,5 +1,8 @@ import {Location, Query} from 'history'; -import {isString, cloneDeep, pick, isEqual} from 'lodash'; +import isString from 'lodash/isString'; +import cloneDeep from 'lodash/cloneDeep'; +import pick from 'lodash/pick'; +import isEqual from 'lodash/isEqual'; import moment from 'moment'; import {DEFAULT_PER_PAGE} from 'app/constants'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/modalLineGraph.tsx b/src/sentry/static/sentry/app/views/eventsV2/modalLineGraph.tsx index 27351baad6dd..22f9125484c7 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/modalLineGraph.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/modalLineGraph.tsx @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import {browserHistory} from 'react-router'; import {Location} from 'history'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import {Client} from 'app/api'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/modalPagination.tsx b/src/sentry/static/sentry/app/views/eventsV2/modalPagination.tsx index 9400cbd95a5d..23f936b9fc41 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/modalPagination.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/modalPagination.tsx @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; import isPropValid from '@emotion/is-prop-valid'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import {Location} from 'history'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/relatedEvents.tsx b/src/sentry/static/sentry/app/views/eventsV2/relatedEvents.tsx index ea6b870cd8f8..243925c503b9 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/relatedEvents.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/relatedEvents.tsx @@ -1,7 +1,7 @@ import React from 'react'; import styled from 'react-emotion'; import PropTypes from 'prop-types'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import {Location} from 'history'; import {Organization, Event, Project} from 'app/types'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/sortLink.tsx b/src/sentry/static/sentry/app/views/eventsV2/sortLink.tsx index 1ae1374c7663..be234fe8cb29 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/sortLink.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/sortLink.tsx @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from 'react-emotion'; import {Location} from 'history'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import InlineSvg from 'app/components/inlineSvg'; import Link from 'app/components/links/link'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx index 25d272604a07..1eab2a8fbaa8 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/tableModalEditColumn.tsx @@ -1,6 +1,6 @@ import React, {ReactText} from 'react'; import styled from 'react-emotion'; -import {uniq} from 'lodash'; +import uniq from 'lodash/uniq'; import {trackAnalyticsEvent} from 'app/utils/analytics'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx index 82c98e7fcb1f..ff866d2a7124 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx @@ -1,4 +1,5 @@ -import {partial, pick} from 'lodash'; +import partial from 'lodash/partial'; +import pick from 'lodash/pick'; import {Location, Query} from 'history'; import {browserHistory} from 'react-router'; diff --git a/src/sentry/static/sentry/app/views/incidents/list/index.tsx b/src/sentry/static/sentry/app/views/incidents/list/index.tsx index af46b52c3050..a0fe56973376 100644 --- a/src/sentry/static/sentry/app/views/incidents/list/index.tsx +++ b/src/sentry/static/sentry/app/views/incidents/list/index.tsx @@ -1,6 +1,6 @@ import {Location} from 'history'; import {Params} from 'react-router/lib/Router'; -import {omit} from 'lodash'; +import omit from 'lodash/omit'; import DocumentTitle from 'react-document-title'; import React from 'react'; import moment from 'moment'; diff --git a/src/sentry/static/sentry/app/views/issueList/sidebar.jsx b/src/sentry/static/sentry/app/views/issueList/sidebar.jsx index f630ca2bef9a..903dd0331bd3 100644 --- a/src/sentry/static/sentry/app/views/issueList/sidebar.jsx +++ b/src/sentry/static/sentry/app/views/issueList/sidebar.jsx @@ -1,7 +1,9 @@ import PropTypes from 'prop-types'; import React from 'react'; import createReactClass from 'create-react-class'; -import _ from 'lodash'; +import isEqual from 'lodash/isEqual'; +import debounce from 'lodash/debounce'; +import map from 'lodash/map'; import LoadingIndicator from 'app/components/loadingIndicator'; import {queryToObj, objToQuery} from 'app/utils/stream'; import {t} from 'app/locale'; @@ -43,7 +45,7 @@ const IssueListSidebar = createReactClass({ // clobber state of sidebar with new query. const query = objToQuery(this.state.queryObj); - if (!_.isEqual(nextProps.query, query)) { + if (!isEqual(nextProps.query, query)) { const queryObj = queryToObj(nextProps.query); this.setState({ queryObj, @@ -72,7 +74,7 @@ const IssueListSidebar = createReactClass({ this.setState({textFilter: evt.target.value}); }, - debouncedTextChange: _.debounce(function(text) { + debouncedTextChange: debounce(function(text) { this.setState( { queryObj: {...this.state.queryObj, __text: text}, @@ -137,7 +139,7 @@ const IssueListSidebar = createReactClass({


    - {_.map(tags, tag => { + {map(tags, tag => { return ( { const projectID = this.getProjectId(this.state.project); - return _.isString(projectID) && projectID.length > 0; + return isString(projectID) && projectID.length > 0; }; getOrganizationId = () => { diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx b/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx index 9abeaa066007..5f1412412a21 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx @@ -3,7 +3,8 @@ import LazyLoad from 'react-lazyload'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; -import _ from 'lodash'; +import uniq from 'lodash/uniq'; +import flatten from 'lodash/flatten'; import {sortProjects} from 'app/utils'; import {t} from 'app/locale'; @@ -60,7 +61,7 @@ class Dashboard extends React.Component { const filteredTeams = teams.filter(team => team.projects.length); filteredTeams.sort((team1, team2) => team1.slug.localeCompare(team2.slug)); - const projects = _.uniq(_.flatten(teams.map(teamObj => teamObj.projects)), 'id'); + const projects = uniq(flatten(teams.map(teamObj => teamObj.projects)), 'id'); const favorites = projects.filter(project => project.isBookmarked); const access = new Set(organization.access); diff --git a/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.jsx b/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.jsx index 23e96052818f..3d5b4ae8955c 100644 --- a/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.jsx +++ b/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.jsx @@ -1,6 +1,6 @@ import React from 'react'; import styled from 'react-emotion'; -import _ from 'lodash'; +import get from 'lodash/get'; import {t, tct} from 'app/locale'; import Alert from 'app/components/alert'; @@ -55,7 +55,7 @@ export default class SentryAppExternalInstallation extends AsyncView { //if the app is unpublished for a different org return ( selectedOrgSlug && - _.get(sentryApp, 'owner.slug') !== selectedOrgSlug && + get(sentryApp, 'owner.slug') !== selectedOrgSlug && sentryApp.status === 'unpublished' ); } @@ -170,7 +170,7 @@ export default class SentryAppExternalInstallation extends AsyncView { if (this.isSentryAppUnavailableForOrg) { // use the slug of the owner if we have it, otherwise use 'another organization' - const ownerSlug = _.get(sentryApp, 'owner.slug', 'another organization'); + const ownerSlug = get(sentryApp, 'owner.slug', 'another organization'); return ( {tct( diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx index 04bc2fcc262d..d5783cb19073 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx @@ -1,5 +1,5 @@ import {observable, computed, action, ObservableMap} from 'mobx'; -import _ from 'lodash'; +import isEqual from 'lodash/isEqual'; import {Client, APIRequestMethod} from 'app/api'; import {addErrorMessage, saveOnBlurUndoMessage} from 'app/actionCreators/indicator'; @@ -111,7 +111,7 @@ class FormModel { */ @computed get formChanged() { - return !_.isEqual(this.initialData, this.fields.toJSON()); + return !isEqual(this.initialData, this.fields.toJSON()); } @computed diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx index dd78db5bd0bf..fa0673d963c0 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import pickBy from 'lodash/pickBy'; import PropTypes from 'prop-types'; import React from 'react'; import styled from 'react-emotion'; @@ -49,7 +49,7 @@ const RichListProps = { }; function getDefinedProps(propTypes, props) { - return _.pickBy(props, (_prop, key) => key in propTypes); + return pickBy(props, (_prop, key) => key in propTypes); } class RichList extends React.PureComponent { diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx index 1a163e36e4e7..d2743aa2f6ec 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx @@ -1,4 +1,4 @@ -import {findIndex} from 'lodash'; +import findIndex from 'lodash/findIndex'; import React from 'react'; import {Project} from 'app/types'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx index 46a13dee83b1..090e27838927 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx @@ -1,4 +1,4 @@ -import {maxBy} from 'lodash'; +import maxBy from 'lodash/maxBy'; import React from 'react'; import moment from 'moment-timezone'; import styled from 'react-emotion'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx index 94b18ac38ba9..bc64bede8894 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx @@ -1,6 +1,6 @@ import FormModel from 'app/views/settings/components/forms/model'; -import {debounce} from 'lodash'; +import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx index 9ae883aff325..74f80238c2b6 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx @@ -1,7 +1,8 @@ import React from 'react'; import {browserHistory} from 'react-router'; import {Observer} from 'mobx-react'; -import _ from 'lodash'; +import omit from 'lodash/omit'; +import get from 'lodash/get'; import scrollToElement from 'scroll-to-element'; import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; @@ -48,7 +49,7 @@ const getResourceFromScope = (scope: Scope): Resource | undefined => { const allChoices = Object.values(permObj.choices); const allScopes = allChoices.reduce( - (_allScopes: string[], choice) => _allScopes.concat(_.get(choice, 'scopes', [])), + (_allScopes: string[], choice) => _allScopes.concat(get(choice, 'scopes', [])), [] ); @@ -91,7 +92,7 @@ class SentryAppFormModel extends FormModel { if (!responseJSON) { return responseJSON; } - const formErrors = _.omit(responseJSON, ['scopes']); + const formErrors = omit(responseJSON, ['scopes']); if (responseJSON.scopes) { responseJSON.scopes.forEach((message: string) => { //find the scope from the error message of a specific format @@ -172,11 +173,11 @@ export default class SentryApplicationDetails extends AsyncView { }; handleSubmitError = err => { - let errorMessage = 'Unknown Error'; + let errorMessage = t('Unknown Error'); if (err.status >= 400 && err.status < 500) { - errorMessage = _.get(err, 'responseJSON.detail', errorMessage); + errorMessage = get(err, 'responseJSON.detail', errorMessage); } - addErrorMessage(t(errorMessage)); + addErrorMessage(errorMessage); if (this.form.formErrors) { const firstErrorFieldId = Object.keys(this.form.formErrors)[0]; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow.tsx index 43bb39ca649d..1307e2a1f98f 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow.tsx @@ -1,7 +1,8 @@ import React from 'react'; import {Box, Flex} from 'grid-emotion'; import {Link} from 'react-router'; -import {capitalize, omit} from 'lodash'; +import capitalize from 'lodash/capitalize'; +import omit from 'lodash/omit'; import styled from 'react-emotion'; import PropTypes from 'prop-types'; From 2a74310e268f43636db77c6269093a9aaaa70d2e Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Fri, 8 Nov 2019 18:32:48 -0800 Subject: [PATCH 4/9] remove babel-plugin-lodash --- babel.config.js | 1 - package.json | 1 - 2 files changed, 2 deletions(-) diff --git a/babel.config.js b/babel.config.js index 69ec2b655e6f..ff40b034bc98 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,7 +3,6 @@ module.exports = { presets: ['@babel/react', '@babel/env', '@babel/preset-typescript'], plugins: [ 'emotion', - 'lodash', 'react-hot-loader/babel', '@babel/plugin-syntax-dynamic-import', '@babel/plugin-proposal-object-rest-spread', diff --git a/package.json b/package.json index 3510f4bbbdf8..5fc69028bffb 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "babel-loader": "^8.0.0", "babel-plugin-add-react-displayname": "^0.0.5", "babel-plugin-emotion": "9.2.11", - "babel-plugin-lodash": "^3.3.4", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "bootstrap": "3.4.0", "classnames": "2.2.0", From e8d12df0bdceb88a3b1505f542c2cdde1acea7c5 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Mon, 11 Nov 2019 15:04:20 -0800 Subject: [PATCH 5/9] fix missing import --- src/sentry/static/sentry/app/components/events/errors.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sentry/static/sentry/app/components/events/errors.jsx b/src/sentry/static/sentry/app/components/events/errors.jsx index 68f8b2f32a2f..7a342eded25f 100644 --- a/src/sentry/static/sentry/app/components/events/errors.jsx +++ b/src/sentry/static/sentry/app/components/events/errors.jsx @@ -1,5 +1,6 @@ import React from 'react'; import uniqWith from 'lodash/uniqWith'; +import isEqual from 'lodash/isEqual'; import EventDataSection from 'app/components/events/eventDataSection'; import EventErrorItem from 'app/components/events/errorItem'; @@ -32,7 +33,7 @@ class EventErrors extends React.Component { }; uniqueErrors = errors => { - return uniqWith(errors, _.isEqual); + return uniqWith(errors, isEqual); }; render() { From a5c84d1fc66fcc9c42ceb97e1965be8916a9000f Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Mon, 11 Nov 2019 15:04:26 -0800 Subject: [PATCH 6/9] fix prettier --- .../static/sentry/app/utils/__mocks__/withLatestContext.tsx | 4 ++-- .../static/sentry/app/utils/__mocks__/withOrganization.tsx | 4 ++-- src/sentry/static/sentry/app/utils/withApi.tsx | 4 ++-- src/sentry/static/sentry/app/utils/withOrganization.tsx | 4 ++-- src/sentry/static/sentry/app/utils/withProject.tsx | 4 ++-- src/sentry/static/sentry/app/utils/withTeamsForUser.tsx | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx b/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx index 98bff2a50717..ed017c6cddcf 100644 --- a/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx +++ b/src/sentry/static/sentry/app/utils/__mocks__/withLatestContext.tsx @@ -11,10 +11,10 @@ const DEFAULTS = { }; const withLatestContextMock = WrappedComponent => - (class WithLatestContextMockWrapper extends React.Component { + class WithLatestContextMockWrapper extends React.Component { render() { return ; } - }); + }; export default withLatestContextMock; diff --git a/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx b/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx index 66626cb5805c..0d5ce2c1548a 100644 --- a/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx +++ b/src/sentry/static/sentry/app/utils/__mocks__/withOrganization.tsx @@ -5,7 +5,7 @@ import SentryTypes from 'app/sentryTypes'; declare const TestStubs; const withOrganizationMock = WrappedComponent => - (class WithOrganizationMockWrapper extends React.Component { + class WithOrganizationMockWrapper extends React.Component { static contextTypes = { organization: SentryTypes.Organization, }; @@ -17,6 +17,6 @@ const withOrganizationMock = WrappedComponent => /> ); } - }); + }; export default withOrganizationMock; diff --git a/src/sentry/static/sentry/app/utils/withApi.tsx b/src/sentry/static/sentry/app/utils/withApi.tsx index e0d2473a961b..01f602d9551d 100644 --- a/src/sentry/static/sentry/app/utils/withApi.tsx +++ b/src/sentry/static/sentry/app/utils/withApi.tsx @@ -29,7 +29,7 @@ const withApi =

    ( WrappedComponent: React.ComponentType

    , {persistInFlight}: OptionProps = {} ) => - (class extends React.Component> { + class extends React.Component> { static displayName = `withApi(${getDisplayName(WrappedComponent)})`; constructor(props: WrappedProps

    ) { @@ -48,6 +48,6 @@ const withApi =

    ( render() { return ; } - }); + }; export default withApi; diff --git a/src/sentry/static/sentry/app/utils/withOrganization.tsx b/src/sentry/static/sentry/app/utils/withOrganization.tsx index 66ec3ae12318..9f7d3127bb1c 100644 --- a/src/sentry/static/sentry/app/utils/withOrganization.tsx +++ b/src/sentry/static/sentry/app/utils/withOrganization.tsx @@ -11,7 +11,7 @@ type InjectedOrganizationProps = { const withOrganization =

    ( WrappedComponent: React.ComponentType

    ) => - (class extends React.Component< + class extends React.Component< Omit & Partial > { static displayName = `withOrganization(${getDisplayName(WrappedComponent)})`; @@ -27,6 +27,6 @@ const withOrganization =

    ( /> ); } - }); + }; export default withOrganization; diff --git a/src/sentry/static/sentry/app/utils/withProject.tsx b/src/sentry/static/sentry/app/utils/withProject.tsx index cd36aab946e1..1f946507be0c 100644 --- a/src/sentry/static/sentry/app/utils/withProject.tsx +++ b/src/sentry/static/sentry/app/utils/withProject.tsx @@ -14,7 +14,7 @@ type InjectedProjectProps = { const withProject =

    ( WrappedComponent: React.ComponentType

    ) => - (class extends React.Component< + class extends React.Component< Omit & Partial > { static displayName = `withProject(${getDisplayName(WrappedComponent)})`; @@ -30,6 +30,6 @@ const withProject =

    ( /> ); } - }); + }; export default withProject; diff --git a/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx b/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx index 7bcdd0d830a8..6bde622a0cb2 100644 --- a/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx +++ b/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx @@ -22,7 +22,7 @@ type InjectedTeamsProps = { const withTeamsForUser =

    ( WrappedComponent: React.ComponentType

    ) => - (class extends React.Component< + class extends React.Component< Omit & Partial & DependentProps, InjectedTeamsProps > { @@ -100,6 +100,6 @@ const withTeamsForUser =

    ( render() { return ; } - }); + }; export default withTeamsForUser; From d171663578edc5205d5fbec403987b02f75816a2 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Mon, 11 Nov 2019 15:56:57 -0800 Subject: [PATCH 7/9] update tests --- tests/js/spec/views/inviteMember/inviteMember.spec.jsx | 4 ++-- tests/js/spec/views/issueList/overview.spec.jsx | 6 +++--- tests/js/spec/views/sentryAppExternalInstallation.spec.jsx | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/js/spec/views/inviteMember/inviteMember.spec.jsx b/tests/js/spec/views/inviteMember/inviteMember.spec.jsx index 25f6bfdd26d3..160b541ff964 100644 --- a/tests/js/spec/views/inviteMember/inviteMember.spec.jsx +++ b/tests/js/spec/views/inviteMember/inviteMember.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; import {shallow, mountWithTheme} from 'sentry-test/enzyme'; -import _ from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import {InviteMember} from 'app/views/settings/organizationMembers/inviteMember'; import ConfigStore from 'app/stores/configStore'; @@ -76,7 +76,7 @@ describe('InviteMember', function() { }, }); - const context = _.cloneDeep(baseContext); + const context = cloneDeep(baseContext); const team = organization.teams.slice(0, 1); organization.teams = team; diff --git a/tests/js/spec/views/issueList/overview.spec.jsx b/tests/js/spec/views/issueList/overview.spec.jsx index 53a36db2d475..c6b48fbb3546 100644 --- a/tests/js/spec/views/issueList/overview.spec.jsx +++ b/tests/js/spec/views/issueList/overview.spec.jsx @@ -1,5 +1,5 @@ import {browserHistory} from 'react-router'; -import {clonedeep} from 'lodash'; +import cloneDeep from 'lodash/cloneDeep'; import React from 'react'; import {initializeOrg} from 'sentry-test/initializeOrg'; @@ -1220,10 +1220,10 @@ describe('IssueList,', function() { it('fetches data on location change', function() { const queryAttrs = ['query', 'sort', 'statsPeriod', 'cursor', 'groupStatsPeriod']; - let location = clonedeep(props.location); + let location = cloneDeep(props.location); queryAttrs.forEach(async (attr, i) => { // reclone each iteration so that only one property changes. - location = clonedeep(location); + location = cloneDeep(location); location.query[attr] = 'newValue'; wrapper.setProps({location}); await tick(); diff --git a/tests/js/spec/views/sentryAppExternalInstallation.spec.jsx b/tests/js/spec/views/sentryAppExternalInstallation.spec.jsx index a7fba7b424ca..b3b46b1ee383 100644 --- a/tests/js/spec/views/sentryAppExternalInstallation.spec.jsx +++ b/tests/js/spec/views/sentryAppExternalInstallation.spec.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import _ from 'lodash'; +import pick from 'lodash/pick'; import {mountWithTheme} from 'sentry-test/enzyme'; @@ -30,8 +30,8 @@ describe('SentryAppExternalInstallation', () => { name: 'Organization 2', }); - org1Lite = _.pick(org1, ['slug', 'name', 'id']); - org2Lite = _.pick(org2, ['slug', 'name', 'id']); + org1Lite = pick(org1, ['slug', 'name', 'id']); + org2Lite = pick(org2, ['slug', 'name', 'id']); sentryApp = TestStubs.SentryApp({ status: 'published', From 2e2ebd044dfe8a965351d1d10f41c2caf254d7f7 Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Tue, 12 Nov 2019 15:42:00 -0800 Subject: [PATCH 8/9] use eslint config that enforces lodash imports --- package.json | 2 +- yarn.lock | 28 ++++++---------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 5fc69028bffb..ad9aeee11453 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "enzyme-adapter-react-16": "1.14.0", "enzyme-to-json": "3.4.0", "eslint": "5.11.1", - "eslint-config-sentry-app": "1.26.0", + "eslint-config-sentry-app": "1.27.0", "jest": "24.1.0", "jest-canvas-mock": "^2.1.0", "jest-junit": "^3.4.1", diff --git a/yarn.lock b/yarn.lock index 08a2bb935dd8..d36cefd68179 100644 --- a/yarn.lock +++ b/yarn.lock @@ -325,7 +325,7 @@ dependencies: "@babel/types" "^7.7.0" -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.0.0-beta.49": +"@babel/helper-module-imports@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== @@ -1645,7 +1645,7 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0-beta.49", "@babel/types@^7.1.6", "@babel/types@^7.2.0": +"@babel/types@^7.1.6", "@babel/types@^7.2.0": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" integrity sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg== @@ -3542,17 +3542,6 @@ babel-plugin-jest-hoist@^24.1.0: resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz#dfecc491fb15e2668abbd690a697a8fd1411a7f8" integrity sha512-gljYrZz8w1b6fJzKcsfKsipSru2DU2DmQ39aB6nV3xQ0DDv3zpIzKGortA5gknrhNnPN8DweaEgrnZdmbGmhnw== -babel-plugin-lodash@^3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/babel-plugin-lodash/-/babel-plugin-lodash-3.3.4.tgz#4f6844358a1340baed182adbeffa8df9967bc196" - integrity sha512-yDZLjK7TCkWl1gpBeBGmuaDIFhZKmkoL+Cu2MUUjv5VxUZx/z7tBGBCBcQs5RI1Bkz5LLmNdjx7paOyQtMovyg== - dependencies: - "@babel/helper-module-imports" "^7.0.0-beta.49" - "@babel/types" "^7.0.0-beta.49" - glob "^7.1.1" - lodash "^4.17.10" - require-package-name "^2.0.1" - babel-plugin-macros@2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-2.4.2.tgz#21b1a2e82e2130403c5ff785cba6548e9b644b28" @@ -6130,10 +6119,10 @@ eslint-config-prettier@6.3.0: dependencies: get-stdin "^6.0.0" -eslint-config-sentry-app@1.26.0: - version "1.26.0" - resolved "https://registry.yarnpkg.com/eslint-config-sentry-app/-/eslint-config-sentry-app-1.26.0.tgz#dd85fab1c41db9436c0d34c67f1821b1f626ee36" - integrity sha512-BG/km++U9M3OFzmOOG1RCY0B3pazaCosD89XeIwDWtfW+YxXQmmFNmsBrM/GewNXMrnjiQRCx5oh2L028rKa7A== +eslint-config-sentry-app@1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/eslint-config-sentry-app/-/eslint-config-sentry-app-1.27.0.tgz#405cbffa105e8e914df39e6f3e7dc732222f1d5d" + integrity sha512-eB1cWOL+3R+XlS8MtB7dGI9rxcAZS8KpgYBFI3QtN1yBifo6IP3/GIs81kFui5/jOWyLb3QcO5LgZhcoRf8N4A== dependencies: eslint-config-prettier "6.3.0" eslint-config-sentry "^1.26.0" @@ -12997,11 +12986,6 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -require-package-name@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/require-package-name/-/require-package-name-2.0.1.tgz#c11e97276b65b8e2923f75dabf5fb2ef0c3841b9" - integrity sha1-wR6XJ2tluOKSP3Xav1+y7ww4Qbk= - require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" From 88d467a4541e818e63cc0e54bea1f8d6a3514e3c Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Tue, 12 Nov 2019 16:14:38 -0800 Subject: [PATCH 9/9] fix storybook --- .storybook/.babelrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.storybook/.babelrc b/.storybook/.babelrc index 71e26cf31307..5d646f5641aa 100644 --- a/.storybook/.babelrc +++ b/.storybook/.babelrc @@ -3,7 +3,6 @@ "presets": ["@babel/react", "@babel/env"], "plugins": [ "emotion", - "lodash", "react-hot-loader/babel", "@babel/plugin-syntax-dynamic-import", "@babel/plugin-proposal-object-rest-spread",