From e540f7c00b6dc3330f60c457f5b7cddf6b264874 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 25 Jun 2020 16:17:11 -0400 Subject: [PATCH] ref: Use @sentry/react (#19366) * ref: uninstall @sentry/browser and add @sentry/react * feat: use @sentry/react Profiler instead of built in Profiler --- package.json | 2 +- .../app/actionCreators/globalSelection.tsx | 2 +- .../sentry/app/actionCreators/group.jsx | 2 +- .../sentry/app/actionCreators/members.tsx | 2 +- .../app/actionCreators/organization.tsx | 2 +- .../sentry/app/actionCreators/release.tsx | 2 +- .../app/actionCreators/repositories.tsx | 2 +- src/sentry/static/sentry/app/api.tsx | 2 +- src/sentry/static/sentry/app/bootstrap.tsx | 6 +-- .../activity/note/inputWithStorage.jsx | 2 +- .../app/components/assistant/guideAnchor.tsx | 2 +- .../sentry/app/components/asyncComponent.tsx | 17 +----- .../app/components/avatar/actorAvatar.tsx | 2 +- .../sentry/app/components/dropdownMenu.tsx | 2 +- .../sentry/app/components/errorBoundary.tsx | 2 +- .../app/components/errors/detailedError.tsx | 2 +- .../events/interfaces/spans/spanTree.tsx | 8 +-- .../components/events/interfaces/utils.jsx | 2 +- .../static/sentry/app/components/lazyLoad.jsx | 2 +- .../sentry/app/components/links/link.tsx | 2 +- .../app/components/loadingIndicator.tsx | 8 +-- .../timeRangeSelector/dateRange/index.jsx | 2 +- .../components/search/sources/apiSource.jsx | 2 +- .../app/components/smartSearchBar/index.tsx | 2 +- .../app/components/u2f/u2finterface.jsx | 2 +- .../static/sentry/app/stores/hookStore.tsx | 2 +- src/sentry/static/sentry/app/translations.tsx | 2 +- .../sentry/app/utils/apiSentryClient.tsx | 2 +- src/sentry/static/sentry/app/utils/apm.tsx | 2 +- .../static/sentry/app/utils/eventWaiter.tsx | 2 +- .../app/utils/handleXhrErrorResponse.tsx | 2 +- .../static/sentry/app/utils/logging.tsx | 2 +- .../static/sentry/app/utils/withProfiler.tsx | 54 ------------------- .../static/sentry/app/views/events/events.jsx | 2 +- .../sentry/app/views/eventsV2/results.tsx | 2 +- .../static/sentry/app/views/eventsV2/tags.tsx | 2 +- .../sentry/app/views/issueList/overview.jsx | 9 +--- .../onboarding/createSampleEventButton.tsx | 2 +- .../sentry/app/views/organizationContext.jsx | 10 +--- .../organizationGroupDetails/groupDetails.tsx | 12 ++--- .../groupEventDetails/groupEventDetails.tsx | 2 +- .../app/views/performance/charts/footer.tsx | 2 +- .../performance/transactionSummary/index.tsx | 2 +- .../sentry/app/views/permissionDenied.jsx | 2 +- .../views/projectInstall/createProject.jsx | 2 +- .../projectInstall/issueAlertOptions.tsx | 2 +- .../app/views/projectsDashboard/index.jsx | 11 +--- .../app/views/releases/detail/index.jsx | 2 +- .../sentry/app/views/releases/list/index.jsx | 2 +- .../static/sentry/app/views/routeError.jsx | 2 +- .../static/sentry/app/views/routeNotFound.tsx | 2 +- .../settings/components/forms/jsonForm.tsx | 2 +- .../components/settingsNavigation.tsx | 2 +- .../triggers/actionsPanel/index.tsx | 2 +- .../inviteMember/index.jsx | 2 +- .../organizationMemberDetail.tsx | 2 +- .../settings/project/projectUserFeedback.tsx | 2 +- .../sentry/app/views/userFeedback/index.tsx | 3 +- .../views/userFeedback/userFeedbackEmpty.tsx | 2 +- tests/js/setup.js | 11 ++-- tests/js/spec/api.spec.jsx | 2 +- .../utils/handleXhrErrorResponse.spec.jsx | 2 +- tests/js/spec/views/routeError.spec.jsx | 2 +- .../js/spec/views/userFeedback/index.spec.jsx | 1 - yarn.lock | 13 ++++- 65 files changed, 92 insertions(+), 175 deletions(-) delete mode 100644 src/sentry/static/sentry/app/utils/withProfiler.tsx diff --git a/package.json b/package.json index 06898d498ca0a7..8fddccb7e8c9c2 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,8 @@ "@emotion/core": "^10.0.27", "@emotion/styled": "^10.0.27", "@sentry/apm": "5.18.0", - "@sentry/browser": "5.18.0", "@sentry/integrations": "5.18.0", + "@sentry/react": "5.18.0", "@sentry/release-parser": "^0.6.0", "@sentry/rrweb": "^0.1.1", "@sentry/utils": "5.18.0", diff --git a/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx b/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx index de9943fb0b9222..8ac8f6eb1aea9e 100644 --- a/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx +++ b/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx @@ -1,9 +1,9 @@ import * as ReactRouter from 'react-router'; -import * as Sentry from '@sentry/browser'; import isInteger from 'lodash/isInteger'; import omit from 'lodash/omit'; import pick from 'lodash/pick'; import qs from 'query-string'; +import * as Sentry from '@sentry/react'; import { DATE_TIME, diff --git a/src/sentry/static/sentry/app/actionCreators/group.jsx b/src/sentry/static/sentry/app/actionCreators/group.jsx index fe82f834829c3f..43a06ebfb64393 100644 --- a/src/sentry/static/sentry/app/actionCreators/group.jsx +++ b/src/sentry/static/sentry/app/actionCreators/group.jsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {buildUserId, buildTeamId} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/actionCreators/members.tsx b/src/sentry/static/sentry/app/actionCreators/members.tsx index 77ab363e1d70c4..2b4b9eb07ae120 100644 --- a/src/sentry/static/sentry/app/actionCreators/members.tsx +++ b/src/sentry/static/sentry/app/actionCreators/members.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {Member} from 'app/types'; diff --git a/src/sentry/static/sentry/app/actionCreators/organization.tsx b/src/sentry/static/sentry/app/actionCreators/organization.tsx index 45350db00cafdd..f2946d48609d1a 100644 --- a/src/sentry/static/sentry/app/actionCreators/organization.tsx +++ b/src/sentry/static/sentry/app/actionCreators/organization.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {addErrorMessage} from 'app/actionCreators/indicator'; diff --git a/src/sentry/static/sentry/app/actionCreators/release.tsx b/src/sentry/static/sentry/app/actionCreators/release.tsx index 0c80335d82b290..42a9f0fe0121a1 100644 --- a/src/sentry/static/sentry/app/actionCreators/release.tsx +++ b/src/sentry/static/sentry/app/actionCreators/release.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import ReleaseActions from 'app/actions/releaseActions'; import {Client} from 'app/api'; diff --git a/src/sentry/static/sentry/app/actionCreators/repositories.tsx b/src/sentry/static/sentry/app/actionCreators/repositories.tsx index 6b62be1eda5558..7b5c6208c8e31e 100644 --- a/src/sentry/static/sentry/app/actionCreators/repositories.tsx +++ b/src/sentry/static/sentry/app/actionCreators/repositories.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import RepositoryActions from 'app/actions/repositoryActions'; import {Client} from 'app/api'; diff --git a/src/sentry/static/sentry/app/api.tsx b/src/sentry/static/sentry/app/api.tsx index a67a6c860dff46..4ad8d5ca34be1e 100644 --- a/src/sentry/static/sentry/app/api.tsx +++ b/src/sentry/static/sentry/app/api.tsx @@ -1,7 +1,7 @@ import isUndefined from 'lodash/isUndefined'; import isNil from 'lodash/isNil'; import $ from 'jquery'; -import {Severity} from '@sentry/browser'; +import {Severity} from '@sentry/react'; import { PROJECT_MOVED, diff --git a/src/sentry/static/sentry/app/bootstrap.tsx b/src/sentry/static/sentry/app/bootstrap.tsx index 184ad257726a78..3631a6a492f5b2 100644 --- a/src/sentry/static/sentry/app/bootstrap.tsx +++ b/src/sentry/static/sentry/app/bootstrap.tsx @@ -12,13 +12,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; import Reflux from 'reflux'; import * as Router from 'react-router'; -import * as Sentry from '@sentry/browser'; -import {ExtraErrorData} from '@sentry/integrations'; -import {Integrations} from '@sentry/apm'; import SentryRRWeb from '@sentry/rrweb'; import createReactClass from 'create-react-class'; import jQuery from 'jquery'; import moment from 'moment'; +import {Integrations} from '@sentry/apm'; +import {ExtraErrorData} from '@sentry/integrations'; +import * as Sentry from '@sentry/react'; import {metric} from 'app/utils/analytics'; import {init as initApiSentryClient} from 'app/utils/apiSentryClient'; 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 e48cd3477c67aa..08d82a2728366e 100644 --- a/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.jsx +++ b/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.jsx @@ -1,7 +1,7 @@ import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import NoteInput from 'app/components/activity/note/input'; import localStorage from 'app/utils/localStorage'; diff --git a/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx b/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx index bc1b859adf7f56..b6169584a49ec4 100644 --- a/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx +++ b/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import Reflux from 'reflux'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import { closeGuide, diff --git a/src/sentry/static/sentry/app/components/asyncComponent.tsx b/src/sentry/static/sentry/app/components/asyncComponent.tsx index 2353c5a64255ac..e5837f33520ab6 100644 --- a/src/sentry/static/sentry/app/components/asyncComponent.tsx +++ b/src/sentry/static/sentry/app/components/asyncComponent.tsx @@ -1,9 +1,9 @@ import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; import {RouteComponentProps} from 'react-router/lib/Router'; import {WithRouterProps} from 'react-router/lib/withRouter'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {t} from 'app/locale'; @@ -15,15 +15,7 @@ import RouteError from 'app/views/routeError'; import {metric} from 'app/utils/analytics'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; -type AsyncComponentProps = { - /** - * Optional sentry APM profiling. - * - * NOTE: we don't decorate `AsyncComponent` but rather the subclass so we can - * get its component name - */ - finishProfile?: () => void; -} & Partial>; +type AsyncComponentProps = Partial>; type AsyncComponentState = { loading: boolean; @@ -167,11 +159,6 @@ export default class AsyncComponent< }, }); this._measurement.hasMeasured = true; - - // sentry apm profiling - if (typeof this.props.finishProfile === 'function') { - this.props.finishProfile(); - } } // Re-fetch data when router params change. diff --git a/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx b/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx index 7e963308ffe1a5..3d4d50fe5cb250 100644 --- a/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import SentryTypes from 'app/sentryTypes'; import UserAvatar from 'app/components/avatar/userAvatar'; diff --git a/src/sentry/static/sentry/app/components/dropdownMenu.tsx b/src/sentry/static/sentry/app/components/dropdownMenu.tsx index 66521e3bbda50b..c756d4439cd416 100644 --- a/src/sentry/static/sentry/app/components/dropdownMenu.tsx +++ b/src/sentry/static/sentry/app/components/dropdownMenu.tsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {MENU_CLOSE_DELAY} from 'app/constants'; diff --git a/src/sentry/static/sentry/app/components/errorBoundary.tsx b/src/sentry/static/sentry/app/components/errorBoundary.tsx index b549a6e6de29b0..d1df0031f255f5 100644 --- a/src/sentry/static/sentry/app/components/errorBoundary.tsx +++ b/src/sentry/static/sentry/app/components/errorBoundary.tsx @@ -2,7 +2,7 @@ import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {t} from 'app/locale'; import Alert from 'app/components/alert'; diff --git a/src/sentry/static/sentry/app/components/errors/detailedError.tsx b/src/sentry/static/sentry/app/components/errors/detailedError.tsx index f9a796ac3df17d..8d5d11d68c1d2b 100644 --- a/src/sentry/static/sentry/app/components/errors/detailedError.tsx +++ b/src/sentry/static/sentry/app/components/errors/detailedError.tsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {t} from 'app/locale'; import InlineSvg from 'app/components/inlineSvg'; 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 c9dcdb28b6b118..63768753fbb3a4 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 @@ -159,7 +159,7 @@ class SpanTree extends React.Component { // hide gap spans (i.e. "missing instrumentation" spans) for browser js transactions, // since they're not useful to indicate - const shouldIncludeGap = !isJavaScriptSDK(event.sdk?.name); + const shouldIncludeGap = !isBrowserJavaScriptSDK(event.sdk?.name); const isValidGap = typeof previousSiblingEndTimestamp === 'number' && @@ -356,12 +356,14 @@ const TraceViewContainer = styled('div')` border-bottom-right-radius: 3px; `; -function isJavaScriptSDK(sdkName?: string): boolean { +function isBrowserJavaScriptSDK(sdkName?: string): boolean { if (!sdkName) { return false; } // based on https://github.com/getsentry/sentry-javascript/blob/master/packages/browser/src/version.ts - return sdkName.toLowerCase() === 'sentry.javascript.browser'; + return ['sentry.javascript.browser', 'sentry.javascript.react'].includes( + sdkName.toLowerCase() + ); } export default SpanTree; 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 4a02c1875a4d00..21ed7487027b01 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx @@ -1,7 +1,7 @@ import isEmpty from 'lodash/isEmpty'; import isString from 'lodash/isString'; -import * as Sentry from '@sentry/browser'; import queryString from 'query-string'; +import * as Sentry from '@sentry/react'; import {FILTER_MASK} from 'app/constants'; import {defined} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/components/lazyLoad.jsx b/src/sentry/static/sentry/app/components/lazyLoad.jsx index 97bad505fead8b..12ecd045d6c7b1 100644 --- a/src/sentry/static/sentry/app/components/lazyLoad.jsx +++ b/src/sentry/static/sentry/app/components/lazyLoad.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {isWebpackChunkLoadingError} from 'app/utils'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/links/link.tsx b/src/sentry/static/sentry/app/components/links/link.tsx index 942eaa736b61c7..675245435b46c1 100644 --- a/src/sentry/static/sentry/app/components/links/link.tsx +++ b/src/sentry/static/sentry/app/components/links/link.tsx @@ -2,9 +2,9 @@ import React from 'react'; import PropTypes from 'prop-types'; import {Link as RouterLink} from 'react-router'; import {Location, LocationDescriptor} from 'history'; -import * as Sentry from '@sentry/browser'; import styled from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import * as Sentry from '@sentry/react'; type AnchorProps = React.HTMLProps; diff --git a/src/sentry/static/sentry/app/components/loadingIndicator.tsx b/src/sentry/static/sentry/app/components/loadingIndicator.tsx index 67334b822d90a2..c02f7ac98dc75e 100644 --- a/src/sentry/static/sentry/app/components/loadingIndicator.tsx +++ b/src/sentry/static/sentry/app/components/loadingIndicator.tsx @@ -1,8 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; - -import withProfiler from 'app/utils/withProfiler'; +import {withProfiler} from '@sentry/react'; type Props = { overlay?: boolean; @@ -17,7 +16,6 @@ type Props = { className?: string; style?: React.CSSProperties; children?: React.ReactNode; - finishProfile: () => void; }; function LoadingIndicator(props: Props) { @@ -82,4 +80,6 @@ LoadingIndicator.propTypes = { hideSpinner: PropTypes.bool, }; -export default withProfiler(LoadingIndicator); +export default withProfiler(LoadingIndicator, { + hasUpdateSpan: false, +}); diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx index 83a1cdddd05499..4368c290df26f1 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx @@ -4,9 +4,9 @@ import 'react-date-range/dist/theme/default.css'; import {DateRangePicker} from 'react-date-range'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; import moment from 'moment'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {analytics} from 'app/utils/analytics'; 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 dc2db3c1a6fef1..a970303704800e 100644 --- a/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx @@ -3,7 +3,7 @@ import debounce from 'lodash/debounce'; import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {createFuzzySearch} from 'app/utils/createFuzzySearch'; diff --git a/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx b/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx index b4a5de4e38ec39..500f9d9ae01de2 100644 --- a/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx +++ b/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx @@ -3,10 +3,10 @@ import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; import Reflux from 'reflux'; -import * as Sentry from '@sentry/browser'; import createReactClass from 'create-react-class'; import debounce from 'lodash/debounce'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {trackAnalyticsEvent} from 'app/utils/analytics'; diff --git a/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx b/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx index fd5d703bf3d5fc..48eb5c62095ed2 100644 --- a/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx +++ b/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx @@ -1,7 +1,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import u2f from 'u2f-api'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import ConfigStore from 'app/stores/configStore'; import {t, tct} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/stores/hookStore.tsx b/src/sentry/static/sentry/app/stores/hookStore.tsx index 74a87371fd63da..30f23f386cae70 100644 --- a/src/sentry/static/sentry/app/stores/hookStore.tsx +++ b/src/sentry/static/sentry/app/stores/hookStore.tsx @@ -1,6 +1,6 @@ import Reflux from 'reflux'; import isUndefined from 'lodash/isUndefined'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Hooks, HookName} from 'app/types/hooks'; diff --git a/src/sentry/static/sentry/app/translations.tsx b/src/sentry/static/sentry/app/translations.tsx index b3290107966064..26898fddd852ad 100644 --- a/src/sentry/static/sentry/app/translations.tsx +++ b/src/sentry/static/sentry/app/translations.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; // zh-cn => zh_CN function convertToDjangoLocaleFormat(language: string) { diff --git a/src/sentry/static/sentry/app/utils/apiSentryClient.tsx b/src/sentry/static/sentry/app/utils/apiSentryClient.tsx index bb0f8773efc4fc..d24fa0782cd858 100644 --- a/src/sentry/static/sentry/app/utils/apiSentryClient.tsx +++ b/src/sentry/static/sentry/app/utils/apiSentryClient.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; let hub; diff --git a/src/sentry/static/sentry/app/utils/apm.tsx b/src/sentry/static/sentry/app/utils/apm.tsx index d8d6cdf1ad0f1d..845668b2773b0c 100644 --- a/src/sentry/static/sentry/app/utils/apm.tsx +++ b/src/sentry/static/sentry/app/utils/apm.tsx @@ -1,6 +1,6 @@ -import * as Sentry from '@sentry/browser'; import * as Router from 'react-router'; import {createMemoryHistory} from 'history'; +import * as Sentry from '@sentry/react'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; diff --git a/src/sentry/static/sentry/app/utils/eventWaiter.tsx b/src/sentry/static/sentry/app/utils/eventWaiter.tsx index 5ba401888eb632..c69ff1a105d407 100644 --- a/src/sentry/static/sentry/app/utils/eventWaiter.tsx +++ b/src/sentry/static/sentry/app/utils/eventWaiter.tsx @@ -1,5 +1,5 @@ -import * as Sentry from '@sentry/browser'; import React from 'react'; +import * as Sentry from '@sentry/react'; import {analytics} from 'app/utils/analytics'; import {Client} from 'app/api'; diff --git a/src/sentry/static/sentry/app/utils/handleXhrErrorResponse.tsx b/src/sentry/static/sentry/app/utils/handleXhrErrorResponse.tsx index 9cc9c47fdc1bcc..601a857d25ab26 100644 --- a/src/sentry/static/sentry/app/utils/handleXhrErrorResponse.tsx +++ b/src/sentry/static/sentry/app/utils/handleXhrErrorResponse.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; export default function handleXhrErrorResponse(message: string) { return (resp: JQueryXHR) => { diff --git a/src/sentry/static/sentry/app/utils/logging.tsx b/src/sentry/static/sentry/app/utils/logging.tsx index 0a97fb88817be1..40982993b079ec 100644 --- a/src/sentry/static/sentry/app/utils/logging.tsx +++ b/src/sentry/static/sentry/app/utils/logging.tsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; export function logException(ex: Error, context: any): void { Sentry.withScope(scope => { diff --git a/src/sentry/static/sentry/app/utils/withProfiler.tsx b/src/sentry/static/sentry/app/utils/withProfiler.tsx deleted file mode 100644 index 13b60e77f5611e..00000000000000 --- a/src/sentry/static/sentry/app/utils/withProfiler.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; -import {Integrations} from '@sentry/apm'; - -import getDisplayName from 'app/utils/getDisplayName'; - -type InjectedProps = { - finishProfile: () => void; -}; - -export default function withProfiler

( - WrappedComponent: React.ComponentType

-) { - const componentDisplayName = getDisplayName(WrappedComponent); - - return class extends React.Component> { - static displayName = `profiler(${componentDisplayName})`; - - componentWillUnmount() { - this.finishProfile(); - } - - activity: number | null = Integrations.Tracing.pushActivity( - componentDisplayName, - { - data: {}, - op: 'react', - description: `<${componentDisplayName}>`, - }, - { - // After this timeout we'll pop this activity regardless - // Set to 30s because that's the length of our longest requests - autoPopAfter: 30000, - } - ); - - // For whatever reason it's not guaranteed that `finishProfile` will be - // called, that's why we need the previously described timeout to make - // sure our transaction will be finished. - finishProfile = () => { - if (!this.activity) { - return; - } - - Integrations.Tracing.popActivity(this.activity); - this.activity = null; - }; - - render() { - return ( - - ); - } - }; -} diff --git a/src/sentry/static/sentry/app/views/events/events.jsx b/src/sentry/static/sentry/app/views/events/events.jsx index 2e76605316e93c..f7459fc2b23fe0 100644 --- a/src/sentry/static/sentry/app/views/events/events.jsx +++ b/src/sentry/static/sentry/app/views/events/events.jsx @@ -2,8 +2,8 @@ import {browserHistory} from 'react-router'; import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {Panel} from 'app/components/panels'; import {addErrorMessage} from 'app/actionCreators/indicator'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/results.tsx b/src/sentry/static/sentry/app/views/eventsV2/results.tsx index 98fdda3ce6886d..c28a9620d5d3b2 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/results.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/results.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/browser'; import * as ReactRouter from 'react-router'; import {Location} from 'history'; import omit from 'lodash/omit'; import isEqual from 'lodash/isEqual'; +import * as Sentry from '@sentry/react'; import {Organization, GlobalSelection} from 'app/types'; import {t, tct} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/tags.tsx b/src/sentry/static/sentry/app/views/eventsV2/tags.tsx index 11217dda8f5bcd..7ddf0fd3cdd47e 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/tags.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/tags.tsx @@ -2,7 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import styled from '@emotion/styled'; import {Location, LocationDescriptor} from 'history'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {t} from 'app/locale'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/issueList/overview.jsx b/src/sentry/static/sentry/app/views/issueList/overview.jsx index 1695eef5e73d7e..302120c648a598 100644 --- a/src/sentry/static/sentry/app/views/issueList/overview.jsx +++ b/src/sentry/static/sentry/app/views/issueList/overview.jsx @@ -8,6 +8,7 @@ import createReactClass from 'create-react-class'; import isEqual from 'lodash/isEqual'; import pickBy from 'lodash/pickBy'; import qs from 'query-string'; +import {withProfiler} from '@sentry/react'; import {Client} from 'app/api'; import {DEFAULT_QUERY, DEFAULT_STATS_PERIOD} from 'app/constants'; @@ -34,7 +35,6 @@ import StreamGroup from 'app/components/stream/group'; import StreamManager from 'app/utils/streamManager'; import parseApiError from 'app/utils/parseApiError'; import parseLinkHeader from 'app/utils/parseLinkHeader'; -import withProfiler from 'app/utils/withProfiler'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization from 'app/utils/withOrganization'; import withSavedSearches from 'app/utils/withSavedSearches'; @@ -62,9 +62,6 @@ const IssueListOverview = createReactClass({ savedSearches: PropTypes.arrayOf(SentryTypes.SavedSearch), savedSearchLoading: PropTypes.bool.isRequired, tags: PropTypes.object, - - // TODO(apm): manual profiling - finishProfile: PropTypes.func, }, mixins: [Reflux.listenTo(GroupStore, 'onGroupChange')], @@ -112,10 +109,6 @@ const IssueListOverview = createReactClass({ componentDidUpdate(prevProps, prevState) { // Fire off profiling/metrics first if (prevState.issuesLoading && !this.state.issuesLoading) { - if (typeof this.props.finishProfile === 'function') { - this.props.finishProfile(); - } - // First Meaningful Paint for /organizations/:orgId/issues/ if (prevState.queryCount === null) { metric.measure({ diff --git a/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx b/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx index 30caa22972eedb..cb2e2b803e2e35 100644 --- a/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx @@ -1,7 +1,7 @@ import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {Organization, Project} from 'app/types'; diff --git a/src/sentry/static/sentry/app/views/organizationContext.jsx b/src/sentry/static/sentry/app/views/organizationContext.jsx index 6576fd5f314d92..78dc9555862a13 100644 --- a/src/sentry/static/sentry/app/views/organizationContext.jsx +++ b/src/sentry/static/sentry/app/views/organizationContext.jsx @@ -2,9 +2,9 @@ import DocumentTitle from 'react-document-title'; import PropTypes from 'prop-types'; import React from 'react'; import Reflux from 'reflux'; -import * as Sentry from '@sentry/browser'; import createReactClass from 'create-react-class'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {ORGANIZATION_FETCH_ERROR_TYPES} from 'app/constants'; import {fetchOrganizationDetails} from 'app/actionCreators/organization'; @@ -24,7 +24,6 @@ import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; import withOrganizations from 'app/utils/withOrganizations'; -import withProfiler from 'app/utils/withProfiler'; const OrganizationContext = createReactClass({ displayName: 'OrganizationContext', @@ -36,7 +35,6 @@ const OrganizationContext = createReactClass({ useLastOrganization: PropTypes.bool, organizationsLoading: PropTypes.bool, organizations: PropTypes.arrayOf(SentryTypes.Organization), - finishProfile: PropTypes.func, detailed: PropTypes.bool, }, @@ -104,10 +102,6 @@ const OrganizationContext = createReactClass({ ) { this.remountComponent(); } - - if (this.state.organization && this.props.finishProfile) { - this.props.finishProfile(); - } }, remountComponent() { @@ -299,7 +293,7 @@ const OrganizationContext = createReactClass({ }, }); -export default withApi(withOrganizations(withProfiler(OrganizationContext))); +export default withApi(withOrganizations(Sentry.withProfiler(OrganizationContext))); export {OrganizationContext}; const ErrorWrapper = styled('div')` diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx index 80759a075f8830..c958d3206f737e 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx @@ -2,7 +2,7 @@ import DocumentTitle from 'react-document-title'; import PropTypes from 'prop-types'; import React from 'react'; import * as ReactRouter from 'react-router'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {Group, Organization, Project} from 'app/types'; @@ -17,7 +17,6 @@ import Projects from 'app/utils/projects'; import SentryTypes from 'app/sentryTypes'; import recreateRoute from 'app/utils/recreateRoute'; import withApi from 'app/utils/withApi'; -import withProfiler from 'app/utils/withProfiler'; import {ERROR_TYPES} from './constants'; import GroupHeader from './header'; @@ -30,7 +29,6 @@ type Props = { environments: string[]; children: React.ReactNode; isGlobalSelectionReady: boolean; - finishProfile: () => void; } & ReactRouter.RouteComponentProps<{orgId: string; groupId: string}, {}>; type State = { @@ -60,11 +58,7 @@ class GroupDetails extends React.Component { this.fetchData(); } - componentDidUpdate(prevProps: Props, prevState: State) { - if (prevState.loading && !this.state.loading) { - callIfFunction(this.props.finishProfile); - } - + componentDidUpdate(prevProps: Props) { if (prevProps.isGlobalSelectionReady !== this.props.isGlobalSelectionReady) { this.fetchData(); } @@ -295,4 +289,4 @@ class GroupDetails extends React.Component { } } -export default withApi(withProfiler(GroupDetails)); +export default withApi(Sentry.withProfiler(GroupDetails)); 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 d1892d3c5d9e00..e55e12b21b779e 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx @@ -1,9 +1,9 @@ -import * as Sentry from '@sentry/browser'; import {browserHistory} from 'react-router'; import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {metric} from 'app/utils/analytics'; diff --git a/src/sentry/static/sentry/app/views/performance/charts/footer.tsx b/src/sentry/static/sentry/app/views/performance/charts/footer.tsx index 41844005131076..a06b2ef447f40e 100644 --- a/src/sentry/static/sentry/app/views/performance/charts/footer.tsx +++ b/src/sentry/static/sentry/app/views/performance/charts/footer.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import * as Sentry from '@sentry/browser'; import {browserHistory} from 'react-router'; import {Location} from 'history'; +import * as Sentry from '@sentry/react'; import {Organization} from 'app/types'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx index 66c1c9bc5a8f66..d71d664ade6c50 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx @@ -3,8 +3,8 @@ import {Params} from 'react-router/lib/Router'; import {browserHistory} from 'react-router'; import {Location} from 'history'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/browser'; import isEqual from 'lodash/isEqual'; +import * as Sentry from '@sentry/react'; import {Client} from 'app/api'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/permissionDenied.jsx b/src/sentry/static/sentry/app/views/permissionDenied.jsx index 6b42662123b9cc..300263ec85eaf6 100644 --- a/src/sentry/static/sentry/app/views/permissionDenied.jsx +++ b/src/sentry/static/sentry/app/views/permissionDenied.jsx @@ -2,7 +2,7 @@ import {withRouter} from 'react-router'; import DocumentTitle from 'react-document-title'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {t, tct} from 'app/locale'; import ExternalLink from 'app/components/links/externalLink'; diff --git a/src/sentry/static/sentry/app/views/projectInstall/createProject.jsx b/src/sentry/static/sentry/app/views/projectInstall/createProject.jsx index 6c4214504069fa..0c1e9debf0d6ac 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/createProject.jsx +++ b/src/sentry/static/sentry/app/views/projectInstall/createProject.jsx @@ -1,8 +1,8 @@ import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {inputStyles} from 'app/styles/input'; import {openCreateTeamModal} from 'app/actionCreators/modal'; diff --git a/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx b/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx index 4e17d387f39554..ebddb6cd999e90 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx +++ b/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx @@ -1,7 +1,7 @@ import React, {ReactElement} from 'react'; -import * as Sentry from '@sentry/browser'; import isEqual from 'lodash/isEqual'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {t} from 'app/locale'; import {Organization} from 'app/types'; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx b/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx index fb23a0471ded8d..bcf093fb5163f2 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/index.jsx @@ -5,6 +5,7 @@ import React from 'react'; import styled from '@emotion/styled'; import uniq from 'lodash/uniq'; import flatten from 'lodash/flatten'; +import {withProfiler} from '@sentry/react'; import {sortProjects} from 'app/utils'; import {t} from 'app/locale'; @@ -16,7 +17,6 @@ import PageHeading from 'app/components/pageHeading'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import ProjectsStatsStore from 'app/stores/projectsStatsStore'; import SentryTypes from 'app/sentryTypes'; -import withProfiler from 'app/utils/withProfiler'; import space from 'app/styles/space'; import LoadingIndicator from 'app/components/loadingIndicator'; import withApi from 'app/utils/withApi'; @@ -31,19 +31,10 @@ class Dashboard extends React.Component { static propTypes = { teams: PropTypes.array, organization: SentryTypes.Organization, - finishProfile: PropTypes.func, loadingTeams: PropTypes.bool, error: PropTypes.instanceOf(Error), }; - componentDidMount() { - const {finishProfile} = this.props; - - if (finishProfile) { - finishProfile(); - } - } - componentWillUnmount() { ProjectsStatsStore.reset(); } 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 8cb870943bdb12..2b59744f8a1f25 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,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import pick from 'lodash/pick'; +import {withProfiler} from '@sentry/react'; import {PageContent} from 'app/styles/organization'; import {URL_PARAM} from 'app/constants/globalSelectionHeader'; @@ -13,7 +14,6 @@ import LoadingIndicator from 'app/components/loadingIndicator'; import SentryTypes from 'app/sentryTypes'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization from 'app/utils/withOrganization'; -import withProfiler from 'app/utils/withProfiler'; import withProjects from 'app/utils/withProjects'; import ReleaseHeader from './releaseHeader'; diff --git a/src/sentry/static/sentry/app/views/releases/list/index.jsx b/src/sentry/static/sentry/app/views/releases/list/index.jsx index 05ebc01ab04352..db109365012dc7 100644 --- a/src/sentry/static/sentry/app/views/releases/list/index.jsx +++ b/src/sentry/static/sentry/app/views/releases/list/index.jsx @@ -1,6 +1,7 @@ import {browserHistory} from 'react-router'; import React from 'react'; import styled from '@emotion/styled'; +import {withProfiler} from '@sentry/react'; import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; import {PageContent, PageHeader} from 'app/styles/organization'; @@ -15,7 +16,6 @@ import PageHeading from 'app/components/pageHeading'; import Pagination from 'app/components/pagination'; import SearchBar from 'app/components/searchBar'; import SentryTypes from 'app/sentryTypes'; -import withProfiler from 'app/utils/withProfiler'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization from 'app/utils/withOrganization'; import Feature from 'app/components/acl/feature'; diff --git a/src/sentry/static/sentry/app/views/routeError.jsx b/src/sentry/static/sentry/app/views/routeError.jsx index 46424c04b077d7..b4e184088ac58d 100644 --- a/src/sentry/static/sentry/app/views/routeError.jsx +++ b/src/sentry/static/sentry/app/views/routeError.jsx @@ -2,7 +2,7 @@ import {withRouter} from 'react-router'; import $ from 'jquery'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; diff --git a/src/sentry/static/sentry/app/views/routeNotFound.tsx b/src/sentry/static/sentry/app/views/routeNotFound.tsx index 2d7c6efd5650c7..efef6b29c7541f 100644 --- a/src/sentry/static/sentry/app/views/routeNotFound.tsx +++ b/src/sentry/static/sentry/app/views/routeNotFound.tsx @@ -1,7 +1,7 @@ import React from 'react'; import DocumentTitle from 'react-document-title'; -import * as Sentry from '@sentry/browser'; import {Location} from 'history'; +import * as Sentry from '@sentry/react'; import Footer from 'app/components/footer'; import Sidebar from 'app/components/sidebar'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx index f6e14b99c4d83a..613f5b65a191b0 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx @@ -1,9 +1,9 @@ import {Box} from 'reflexbox'; import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/browser'; import scrollToElement from 'scroll-to-element'; import {Location} from 'history'; +import * as Sentry from '@sentry/react'; import {sanitizeQuerySelector} from 'app/utils/sanitizeQuerySelector'; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx index ef26a3629ae478..1edff119789096 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx @@ -1,5 +1,5 @@ -import * as Sentry from '@sentry/browser'; import React from 'react'; +import * as Sentry from '@sentry/react'; import SettingsNavigationGroup from 'app/views/settings/components/settingsNavigationGroup'; import {NavigationSection, NavigationProps} from 'app/views/settings/types'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/index.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/index.tsx index dc82e515a56d34..4ea10c671f43fb 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import * as Sentry from '@sentry/browser'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import { Action, diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx index b852bab8bd16dc..77d3d0ced281d2 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx @@ -2,7 +2,7 @@ import {withRouter} from 'react-router'; import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {MEMBER_ROLES} from 'app/constants'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx index 22ee5513f14ee7..77ee21812cdf4a 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx @@ -1,8 +1,8 @@ import {RouteComponentProps} from 'react-router/lib/Router'; import {browserHistory} from 'react-router'; import React from 'react'; -import * as Sentry from '@sentry/browser'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {Member, Organization, Team} from 'app/types'; import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx b/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx index bfa503a710dca3..7783302e2cef07 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx @@ -1,7 +1,7 @@ import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; import styled from '@emotion/styled'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {t} from 'app/locale'; import Access from 'app/components/acl/access'; diff --git a/src/sentry/static/sentry/app/views/userFeedback/index.tsx b/src/sentry/static/sentry/app/views/userFeedback/index.tsx index 741ae0b9fbf807..001aa240045299 100644 --- a/src/sentry/static/sentry/app/views/userFeedback/index.tsx +++ b/src/sentry/static/sentry/app/views/userFeedback/index.tsx @@ -3,6 +3,7 @@ import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; import omit from 'lodash/omit'; import styled from '@emotion/styled'; +import {withProfiler} from '@sentry/react'; import {Organization, UserReport} from 'app/types'; import {PageContent} from 'app/styles/organization'; @@ -16,7 +17,6 @@ import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMess import LoadingIndicator from 'app/components/loadingIndicator'; import PageHeading from 'app/components/pageHeading'; import Pagination from 'app/components/pagination'; -import withProfiler from 'app/utils/withProfiler'; import space from 'app/styles/space'; import withOrganization from 'app/utils/withOrganization'; @@ -29,7 +29,6 @@ type State = AsyncView['state'] & { type Props = RouteComponentProps<{orgId: string}, {}> & { organization: Organization; - finishProfile: () => void; }; class OrganizationUserFeedback extends AsyncView { diff --git a/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx b/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx index eef8fe588e3491..59bba5702d2a09 100644 --- a/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx +++ b/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx @@ -1,7 +1,7 @@ import React from 'react'; import styled from '@emotion/styled'; import PropTypes from 'prop-types'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import userFeedback from 'sentry-dreamy-components/dist/user-feedback.svg'; diff --git a/tests/js/setup.js b/tests/js/setup.js index 2ea94361b3ffd1..b40b3e3733ada6 100644 --- a/tests/js/setup.js +++ b/tests/js/setup.js @@ -96,8 +96,8 @@ jest.mock('echarts-for-react/lib/core', () => { }; }); -jest.mock('@sentry/browser', () => { - const SentryBrowser = jest.requireActual('@sentry/browser'); +jest.mock('@sentry/react', () => { + const SentryReact = jest.requireActual('@sentry/react'); return { init: jest.fn(), configureScope: jest.fn(), @@ -113,9 +113,10 @@ jest.mock('@sentry/browser', () => { startSpan: jest.fn(), finishSpan: jest.fn(), lastEventId: jest.fn(), - getCurrentHub: jest.spyOn(SentryBrowser, 'getCurrentHub'), - withScope: jest.spyOn(SentryBrowser, 'withScope'), - Severity: SentryBrowser.Severity, + getCurrentHub: jest.spyOn(SentryReact, 'getCurrentHub'), + withScope: jest.spyOn(SentryReact, 'withScope'), + Severity: SentryReact.Severity, + withProfiler: SentryReact.withProfiler, }; }); diff --git a/tests/js/spec/api.spec.jsx b/tests/js/spec/api.spec.jsx index 68a8052671465c..e54abc9357d1e5 100644 --- a/tests/js/spec/api.spec.jsx +++ b/tests/js/spec/api.spec.jsx @@ -1,5 +1,5 @@ import $ from 'jquery'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {Client, Request, paramsToQueryArgs} from 'app/api'; import GroupActions from 'app/actions/groupActions'; diff --git a/tests/js/spec/utils/handleXhrErrorResponse.spec.jsx b/tests/js/spec/utils/handleXhrErrorResponse.spec.jsx index e53e81371aa0a7..d97ff1b01b131b 100644 --- a/tests/js/spec/utils/handleXhrErrorResponse.spec.jsx +++ b/tests/js/spec/utils/handleXhrErrorResponse.spec.jsx @@ -1,4 +1,4 @@ -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import handleXhrErrorResponse from 'app/utils/handleXhrErrorResponse'; diff --git a/tests/js/spec/views/routeError.spec.jsx b/tests/js/spec/views/routeError.spec.jsx index 4b0824f09e3e27..139d4b23281209 100644 --- a/tests/js/spec/views/routeError.spec.jsx +++ b/tests/js/spec/views/routeError.spec.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import * as Sentry from '@sentry/browser'; +import * as Sentry from '@sentry/react'; import {mount} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/userFeedback/index.spec.jsx b/tests/js/spec/views/userFeedback/index.spec.jsx index 94fe00b4ba65b8..b64abe95f0874b 100644 --- a/tests/js/spec/views/userFeedback/index.spec.jsx +++ b/tests/js/spec/views/userFeedback/index.spec.jsx @@ -39,7 +39,6 @@ describe('UserFeedback', function() { params: { orgId: organization.slug, }, - finishProfile: jest.fn(), }; MockApiClient.addMockResponse({ url: '/organizations/org-slug/projects/', diff --git a/yarn.lock b/yarn.lock index 7153bae7ff95c8..451c24304a5e95 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1898,6 +1898,17 @@ lru_map "^0.3.3" tslib "^1.9.3" +"@sentry/react@5.18.0": + version "5.18.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-5.18.0.tgz#12677ac5a984273d1d51e88a77c05866c6c040da" + integrity sha512-nwEvCqGG2rp3RaK7aioWna7rgNjlCqtLkYWwTsxXxGIBHvmEScOe//3fiE0tYx8JvhzqcDCRCLTPAsMmBlljzg== + dependencies: + "@sentry/browser" "5.18.0" + "@sentry/types" "5.18.0" + "@sentry/utils" "5.18.0" + hoist-non-react-statics "^3.3.2" + tslib "^1.9.3" + "@sentry/release-parser@^0.6.0": version "0.6.0" resolved "https://registry.yarnpkg.com/@sentry/release-parser/-/release-parser-0.6.0.tgz#d7f67fc32d130396a5d77d14b7d43c4a8aee57b4" @@ -8075,7 +8086,7 @@ hoist-non-react-statics@^1.2.0: resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb" integrity sha1-qkSM8JhtVcxAdzsXF0t90GbLfPs= -hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0: +hoist-non-react-statics@^3.0.0, hoist-non-react-statics@^3.1.0, hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==