@sentry/react 7.15.0 → 7.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +11 -26
- package/cjs/constants.js +3 -3
- package/cjs/constants.js.map +1 -1
- package/cjs/errorboundary.js +14 -14
- package/cjs/errorboundary.js.map +1 -1
- package/cjs/index.js +9 -9
- package/cjs/index.js.map +1 -1
- package/cjs/profiler.js +16 -16
- package/cjs/profiler.js.map +1 -1
- package/cjs/reactrouter.js +15 -18
- package/cjs/reactrouter.js.map +1 -1
- package/cjs/reactrouterv3.js +8 -10
- package/cjs/reactrouterv3.js.map +1 -1
- package/cjs/reactrouterv6.js +33 -30
- package/cjs/reactrouterv6.js.map +1 -1
- package/cjs/redux.js +9 -9
- package/cjs/redux.js.map +1 -1
- package/cjs/sdk.js +1 -1
- package/cjs/sdk.js.map +1 -1
- package/esm/constants.js +3 -3
- package/esm/constants.js.map +1 -1
- package/esm/errorboundary.js +8 -8
- package/esm/errorboundary.js.map +1 -1
- package/esm/profiler.js +9 -9
- package/esm/profiler.js.map +1 -1
- package/esm/reactrouter.js +11 -14
- package/esm/reactrouter.js.map +1 -1
- package/esm/reactrouterv3.js +8 -10
- package/esm/reactrouterv3.js.map +1 -1
- package/esm/reactrouterv6.js +29 -26
- package/esm/reactrouterv6.js.map +1 -1
- package/esm/redux.js +8 -8
- package/esm/redux.js.map +1 -1
- package/esm/sdk.js.map +1 -1
- package/package.json +5 -5
- package/types/reactrouter.d.ts.map +1 -1
- package/types/reactrouterv3.d.ts.map +1 -1
- package/types/reactrouterv6.d.ts +15 -26
- package/types/reactrouterv6.d.ts.map +1 -1
package/cjs/reactrouterv3.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const browser = require('@sentry/browser');
|
|
4
4
|
|
|
5
5
|
// Many of the types below had to be mocked out to prevent typescript issues
|
|
6
6
|
// these types are required for correct functionality.
|
|
7
7
|
|
|
8
|
-
var global = utils.getGlobalObject();
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
9
|
* Creates routing instrumentation for React Router v3
|
|
12
10
|
* Works for React Router >= 3.2.0 and < 4.0.0
|
|
@@ -28,11 +26,11 @@ function reactRouterV3Instrumentation(
|
|
|
28
26
|
let activeTransaction;
|
|
29
27
|
let prevName;
|
|
30
28
|
|
|
31
|
-
// Have to use
|
|
32
|
-
if (startTransactionOnPageLoad &&
|
|
29
|
+
// Have to use window.location because history.location might not be defined.
|
|
30
|
+
if (startTransactionOnPageLoad && browser.WINDOW && browser.WINDOW.location) {
|
|
33
31
|
normalizeTransactionName(
|
|
34
32
|
routes,
|
|
35
|
-
|
|
33
|
+
browser.WINDOW.location ,
|
|
36
34
|
match,
|
|
37
35
|
(localName, source = 'url') => {
|
|
38
36
|
prevName = localName;
|
|
@@ -56,7 +54,7 @@ function reactRouterV3Instrumentation(
|
|
|
56
54
|
if (activeTransaction) {
|
|
57
55
|
activeTransaction.finish();
|
|
58
56
|
}
|
|
59
|
-
|
|
57
|
+
const tags = {
|
|
60
58
|
'routing.instrumentation': 'react-router-v3',
|
|
61
59
|
};
|
|
62
60
|
if (prevName) {
|
|
@@ -99,7 +97,7 @@ function normalizeTransactionName(
|
|
|
99
97
|
return callback(name);
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
const routePath = getRouteStringFromRoutes(renderProps.routes || []);
|
|
103
101
|
if (routePath.length === 0 || routePath === '/*') {
|
|
104
102
|
return callback(name);
|
|
105
103
|
}
|
|
@@ -118,11 +116,11 @@ function getRouteStringFromRoutes(routes) {
|
|
|
118
116
|
return '';
|
|
119
117
|
}
|
|
120
118
|
|
|
121
|
-
|
|
119
|
+
const routesWithPaths = routes.filter((route) => !!route.path);
|
|
122
120
|
|
|
123
121
|
let index = -1;
|
|
124
122
|
for (let x = routesWithPaths.length - 1; x >= 0; x--) {
|
|
125
|
-
|
|
123
|
+
const route = routesWithPaths[x];
|
|
126
124
|
if (route.path && route.path.startsWith('/')) {
|
|
127
125
|
index = x;
|
|
128
126
|
break;
|
package/cjs/reactrouterv3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactrouterv3.js","sources":["../../src/reactrouterv3.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"reactrouterv3.js","sources":["../../src/reactrouterv3.ts"],"sourcesContent":["import { WINDOW } from '@sentry/browser';\nimport { Primitive, Transaction, TransactionContext, TransactionSource } from '@sentry/types';\n\nimport { Location, ReactRouterInstrumentation } from './types';\n\n// Many of the types below had to be mocked out to prevent typescript issues\n// these types are required for correct functionality.\n\ntype HistoryV3 = {\n location?: Location;\n listen?(cb: (location: Location) => void): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n} & Record<string, any>;\n\nexport type Route = { path?: string; childRoutes?: Route[] };\n\nexport type Match = (\n props: { location: Location; routes: Route[] },\n cb: (error?: Error, _redirectLocation?: Location, renderProps?: { routes?: Route[] }) => void,\n) => void;\n\ntype ReactRouterV3TransactionSource = Extract<TransactionSource, 'url' | 'route'>;\n\n/**\n * Creates routing instrumentation for React Router v3\n * Works for React Router >= 3.2.0 and < 4.0.0\n *\n * @param history object from the `history` library\n * @param routes a list of all routes, should be\n * @param match `Router.match` utility\n */\nexport function reactRouterV3Instrumentation(\n history: HistoryV3,\n routes: Route[],\n match: Match,\n): ReactRouterInstrumentation {\n return (\n startTransaction: (context: TransactionContext) => Transaction | undefined,\n startTransactionOnPageLoad: boolean = true,\n startTransactionOnLocationChange: boolean = true,\n ) => {\n let activeTransaction: Transaction | undefined;\n let prevName: string | undefined;\n\n // Have to use window.location because history.location might not be defined.\n if (startTransactionOnPageLoad && WINDOW && WINDOW.location) {\n normalizeTransactionName(\n routes,\n WINDOW.location as unknown as Location,\n match,\n (localName: string, source: ReactRouterV3TransactionSource = 'url') => {\n prevName = localName;\n activeTransaction = startTransaction({\n name: prevName,\n op: 'pageload',\n tags: {\n 'routing.instrumentation': 'react-router-v3',\n },\n metadata: {\n source,\n },\n });\n },\n );\n }\n\n if (startTransactionOnLocationChange && history.listen) {\n history.listen(location => {\n if (location.action === 'PUSH' || location.action === 'POP') {\n if (activeTransaction) {\n activeTransaction.finish();\n }\n const tags: Record<string, Primitive> = {\n 'routing.instrumentation': 'react-router-v3',\n };\n if (prevName) {\n tags.from = prevName;\n }\n normalizeTransactionName(routes, location, match, (localName: string, source: TransactionSource = 'url') => {\n prevName = localName;\n activeTransaction = startTransaction({\n name: prevName,\n op: 'navigation',\n tags,\n metadata: {\n source,\n },\n });\n });\n }\n });\n }\n };\n}\n\n/**\n * Normalize transaction names using `Router.match`\n */\nfunction normalizeTransactionName(\n appRoutes: Route[],\n location: Location,\n match: Match,\n callback: (pathname: string, source?: ReactRouterV3TransactionSource) => void,\n): void {\n let name = location.pathname;\n match(\n {\n location,\n routes: appRoutes,\n },\n (error, _redirectLocation, renderProps) => {\n if (error || !renderProps) {\n return callback(name);\n }\n\n const routePath = getRouteStringFromRoutes(renderProps.routes || []);\n if (routePath.length === 0 || routePath === '/*') {\n return callback(name);\n }\n\n name = routePath;\n return callback(name, 'route');\n },\n );\n}\n\n/**\n * Generate route name from array of routes\n */\nfunction getRouteStringFromRoutes(routes: Route[]): string {\n if (!Array.isArray(routes) || routes.length === 0) {\n return '';\n }\n\n const routesWithPaths: Route[] = routes.filter((route: Route) => !!route.path);\n\n let index = -1;\n for (let x = routesWithPaths.length - 1; x >= 0; x--) {\n const route = routesWithPaths[x];\n if (route.path && route.path.startsWith('/')) {\n index = x;\n break;\n }\n }\n\n return routesWithPaths\n .slice(index)\n .filter(({ path }) => !!path)\n .map(({ path }) => path)\n .join('');\n}\n"],"names":["WINDOW"],"mappings":";;;;AAKA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,4BAAA;AACA,EAAA,OAAA;AACA,EAAA,MAAA;AACA,E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,CAAA,MAAA,KAAA,CAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,MAAA,eAAA,GAAA,MAAA,CAAA,MAAA,CAAA,CAAA,KAAA,KAAA,CAAA,CAAA,KAAA,CAAA,IAAA,CAAA,CAAA;AACA;AACA,EAAA,IAAA,KAAA,GAAA,CAAA,CAAA,CAAA;AACA,EAAA,KAAA,IAAA,CAAA,GAAA,eAAA,CAAA,MAAA,GAAA,CAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,EAAA,EAAA;AACA,IAAA,MAAA,KAAA,GAAA,eAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,IAAA,KAAA,CAAA,IAAA,IAAA,KAAA,CAAA,IAAA,CAAA,UAAA,CAAA,GAAA,CAAA,EAAA;AACA,MAAA,KAAA,GAAA,CAAA,CAAA;AACA,MAAA,MAAA;AACA,KAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,eAAA;AACA,KAAA,KAAA,CAAA,KAAA,CAAA;AACA,KAAA,MAAA,CAAA,CAAA,EAAA,IAAA,EAAA,KAAA,CAAA,CAAA,IAAA,CAAA;AACA,KAAA,GAAA,CAAA,CAAA,EAAA,IAAA,EAAA,KAAA,IAAA,CAAA;AACA,KAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AACA;;;;"}
|
package/cjs/reactrouterv6.js
CHANGED
|
@@ -4,14 +4,15 @@ var {
|
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const browser = require('@sentry/browser');
|
|
8
|
+
const utils = require('@sentry/utils');
|
|
9
|
+
const hoistNonReactStatics = require('hoist-non-react-statics');
|
|
10
|
+
const React = require('react');
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
const hoistNonReactStatics__default = /*#__PURE__*/_interopDefault(hoistNonReactStatics);
|
|
13
|
+
const React__default = /*#__PURE__*/_interopDefault(React);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
const _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/reactrouterv6.tsx";// Inspired from Donnie McNeal's solution:
|
|
15
16
|
|
|
16
17
|
let activeTransaction;
|
|
17
18
|
|
|
@@ -23,9 +24,7 @@ let _matchRoutes;
|
|
|
23
24
|
let _customStartTransaction;
|
|
24
25
|
let _startTransactionOnLocationChange;
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var SENTRY_TAGS = {
|
|
27
|
+
const SENTRY_TAGS = {
|
|
29
28
|
'routing.instrumentation': 'react-router-v6',
|
|
30
29
|
};
|
|
31
30
|
|
|
@@ -41,7 +40,7 @@ function reactRouterV6Instrumentation(
|
|
|
41
40
|
startTransactionOnPageLoad = true,
|
|
42
41
|
startTransactionOnLocationChange = true,
|
|
43
42
|
) => {
|
|
44
|
-
|
|
43
|
+
const initPathName = browser.WINDOW && browser.WINDOW.location && browser.WINDOW.location.pathname;
|
|
45
44
|
if (startTransactionOnPageLoad && initPathName) {
|
|
46
45
|
activeTransaction = customStartTransaction({
|
|
47
46
|
name: initPathName,
|
|
@@ -73,29 +72,33 @@ function getNormalizedName(
|
|
|
73
72
|
return [location.pathname, 'url'];
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
const branches = matchRoutes(routes, location) ;
|
|
77
76
|
|
|
78
77
|
let pathBuilder = '';
|
|
79
78
|
if (branches) {
|
|
80
79
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
81
80
|
for (let x = 0; x < branches.length; x++) {
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
const branch = branches[x];
|
|
82
|
+
const route = branch.route;
|
|
84
83
|
if (route) {
|
|
85
84
|
// Early return if index route
|
|
86
85
|
if (route.index) {
|
|
87
86
|
return [branch.pathname, 'route'];
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
|
|
89
|
+
const path = route.path;
|
|
91
90
|
if (path) {
|
|
92
|
-
|
|
91
|
+
const newPath = path[0] === '/' || pathBuilder[pathBuilder.length - 1] === '/' ? path : `/${path}`;
|
|
93
92
|
pathBuilder += newPath;
|
|
94
93
|
if (branch.pathname === location.pathname) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
if (
|
|
95
|
+
// If the route defined on the element is something like
|
|
96
|
+
// <Route path="/stores/:storeId/products/:productId" element={<div>Product</div>} />
|
|
97
|
+
// We should check against the branch.pathname for the number of / seperators
|
|
98
|
+
utils.getNumberOfUrlSegments(pathBuilder) !== utils.getNumberOfUrlSegments(branch.pathname) &&
|
|
99
|
+
// We should not count wildcard operators in the url segments calculation
|
|
100
|
+
pathBuilder.slice(-2) !== '/*'
|
|
101
|
+
) {
|
|
99
102
|
return [newPath, 'route'];
|
|
100
103
|
}
|
|
101
104
|
return [pathBuilder, 'route'];
|
|
@@ -165,14 +168,14 @@ function withSentryReactRouterV6Routing(Routes) {
|
|
|
165
168
|
let isBaseLocation = false;
|
|
166
169
|
let routes;
|
|
167
170
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
+
const SentryRoutes = (props) => {
|
|
172
|
+
const location = _useLocation();
|
|
173
|
+
const navigationType = _useNavigationType();
|
|
171
174
|
|
|
172
175
|
_useEffect(() => {
|
|
173
176
|
// Performance concern:
|
|
174
177
|
// This is repeated when <Routes /> is rendered.
|
|
175
|
-
routes = _createRoutesFromChildren(props.children);
|
|
178
|
+
routes = _createRoutesFromChildren(props.children) ;
|
|
176
179
|
isBaseLocation = true;
|
|
177
180
|
|
|
178
181
|
updatePageloadTransaction(location, routes);
|
|
@@ -187,7 +190,7 @@ function withSentryReactRouterV6Routing(Routes) {
|
|
|
187
190
|
|
|
188
191
|
// @ts-ignore Setting more specific React Component typing for `R` generic above
|
|
189
192
|
// will break advanced type inference done by react router params
|
|
190
|
-
return React__default.createElement(Routes, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber:
|
|
193
|
+
return React__default.createElement(Routes, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 249}} );
|
|
191
194
|
};
|
|
192
195
|
|
|
193
196
|
hoistNonReactStatics__default(SentryRoutes, Routes);
|
|
@@ -210,12 +213,12 @@ function wrapUseRoutes(origUseRoutes) {
|
|
|
210
213
|
let isBaseLocation = false;
|
|
211
214
|
|
|
212
215
|
return (routes, location) => {
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
const SentryRoutes = (props) => {
|
|
217
|
+
const Routes = origUseRoutes(routes, location);
|
|
215
218
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
+
const locationArgObject = typeof location === 'string' ? { pathname: location } : location;
|
|
220
|
+
const locationObject = (locationArgObject ) || _useLocation();
|
|
221
|
+
const navigationType = _useNavigationType();
|
|
219
222
|
|
|
220
223
|
_useEffect(() => {
|
|
221
224
|
isBaseLocation = true;
|
|
@@ -232,7 +235,7 @@ function wrapUseRoutes(origUseRoutes) {
|
|
|
232
235
|
return Routes;
|
|
233
236
|
};
|
|
234
237
|
|
|
235
|
-
return React__default.createElement(SentryRoutes, {__self: this, __source: {fileName: _jsxFileName, lineNumber:
|
|
238
|
+
return React__default.createElement(SentryRoutes, {__self: this, __source: {fileName: _jsxFileName, lineNumber: 294}} );
|
|
236
239
|
};
|
|
237
240
|
}
|
|
238
241
|
|
package/cjs/reactrouterv6.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactrouterv6.js","sources":["../../src/reactrouterv6.tsx"],"sourcesContent":["// Inspired from Donnie McNeal's solution:\n// https://gist.github.com/wontondon/e8c4bdf2888875e4c755712e99279536\n\nimport { Transaction, TransactionContext, TransactionSource } from '@sentry/types';\nimport { getGlobalObject, getNumberOfUrlSegments, logger } from '@sentry/utils';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport React from 'react';\n\nimport { Action, Location } from './types';\n\ninterface RouteObject {\n caseSensitive?: boolean;\n children?: RouteObject[];\n element?: React.ReactNode;\n index?: boolean;\n path?: string;\n}\n\ntype Params<Key extends string = string> = {\n readonly [key in Key]: string | undefined;\n};\n\ntype UseRoutes = (routes: RouteObject[], locationArg?: Partial<Location> | string) => React.ReactElement | null;\n\n// https://github.com/remix-run/react-router/blob/9fa54d643134cd75a0335581a75db8100ed42828/packages/react-router/lib/router.ts#L114-L134\ninterface RouteMatch<ParamKey extends string = string> {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params<ParamKey>;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The route object that was used to match.\n */\n route: RouteObject;\n}\n\ntype UseEffect = (cb: () => void, deps: unknown[]) => void;\ntype UseLocation = () => Location;\ntype UseNavigationType = () => Action;\ntype CreateRoutesFromChildren = (children: JSX.Element[]) => RouteObject[];\ntype MatchRoutes = (routes: RouteObject[], location: Location) => RouteMatch[] | null;\n\nlet activeTransaction: Transaction | undefined;\n\nlet _useEffect: UseEffect;\nlet _useLocation: UseLocation;\nlet _useNavigationType: UseNavigationType;\nlet _createRoutesFromChildren: CreateRoutesFromChildren;\nlet _matchRoutes: MatchRoutes;\nlet _customStartTransaction: (context: TransactionContext) => Transaction | undefined;\nlet _startTransactionOnLocationChange: boolean;\n\nconst global = getGlobalObject<Window>();\n\nconst SENTRY_TAGS = {\n 'routing.instrumentation': 'react-router-v6',\n};\n\nexport function reactRouterV6Instrumentation(\n useEffect: UseEffect,\n useLocation: UseLocation,\n useNavigationType: UseNavigationType,\n createRoutesFromChildren: CreateRoutesFromChildren,\n matchRoutes: MatchRoutes,\n) {\n return (\n customStartTransaction: (context: TransactionContext) => Transaction | undefined,\n startTransactionOnPageLoad = true,\n startTransactionOnLocationChange = true,\n ): void => {\n const initPathName = global && global.location && global.location.pathname;\n if (startTransactionOnPageLoad && initPathName) {\n activeTransaction = customStartTransaction({\n name: initPathName,\n op: 'pageload',\n tags: SENTRY_TAGS,\n metadata: {\n source: 'url',\n },\n });\n }\n\n _useEffect = useEffect;\n _useLocation = useLocation;\n _useNavigationType = useNavigationType;\n _matchRoutes = matchRoutes;\n _createRoutesFromChildren = createRoutesFromChildren;\n\n _customStartTransaction = customStartTransaction;\n _startTransactionOnLocationChange = startTransactionOnLocationChange;\n };\n}\n\nfunction getNormalizedName(\n routes: RouteObject[],\n location: Location,\n matchRoutes: MatchRoutes,\n): [string, TransactionSource] {\n if (!routes || routes.length === 0 || !matchRoutes) {\n return [location.pathname, 'url'];\n }\n\n const branches = matchRoutes(routes, location);\n\n let pathBuilder = '';\n if (branches) {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let x = 0; x < branches.length; x++) {\n const branch = branches[x];\n const route = branch.route;\n if (route) {\n // Early return if index route\n if (route.index) {\n return [branch.pathname, 'route'];\n }\n\n const path = route.path;\n if (path) {\n const newPath = path[0] === '/' ? path : `/${path}`;\n pathBuilder += newPath;\n if (branch.pathname === location.pathname) {\n // If the route defined on the element is something like\n // <Route path=\"/stores/:storeId/products/:productId\" element={<div>Product</div>} />\n // We should check against the branch.pathname for the number of / seperators\n if (getNumberOfUrlSegments(pathBuilder) !== getNumberOfUrlSegments(branch.pathname)) {\n return [newPath, 'route'];\n }\n return [pathBuilder, 'route'];\n }\n }\n }\n }\n }\n\n return [location.pathname, 'url'];\n}\n\nfunction updatePageloadTransaction(location: Location, routes: RouteObject[]): void {\n if (activeTransaction) {\n activeTransaction.setName(...getNormalizedName(routes, location, _matchRoutes));\n }\n}\n\nfunction handleNavigation(\n location: Location,\n routes: RouteObject[],\n navigationType: Action,\n isBaseLocation: boolean,\n): void {\n if (isBaseLocation) {\n if (activeTransaction) {\n activeTransaction.finish();\n }\n\n return;\n }\n\n if (_startTransactionOnLocationChange && (navigationType === 'PUSH' || navigationType === 'POP')) {\n if (activeTransaction) {\n activeTransaction.finish();\n }\n\n const [name, source] = getNormalizedName(routes, location, _matchRoutes);\n activeTransaction = _customStartTransaction({\n name,\n op: 'navigation',\n tags: SENTRY_TAGS,\n metadata: {\n source,\n },\n });\n }\n}\n\nexport function withSentryReactRouterV6Routing<P extends Record<string, any>, R extends React.FC<P>>(Routes: R): R {\n if (\n !_useEffect ||\n !_useLocation ||\n !_useNavigationType ||\n !_createRoutesFromChildren ||\n !_matchRoutes ||\n !_customStartTransaction\n ) {\n __DEBUG_BUILD__ &&\n logger.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.\n useEffect: ${_useEffect}. useLocation: ${_useLocation}. useNavigationType: ${_useNavigationType}.\n createRoutesFromChildren: ${_createRoutesFromChildren}. matchRoutes: ${_matchRoutes}. customStartTransaction: ${_customStartTransaction}.`);\n\n return Routes;\n }\n\n let isBaseLocation: boolean = false;\n let routes: RouteObject[];\n\n const SentryRoutes: React.FC<P> = (props: P) => {\n const location = _useLocation();\n const navigationType = _useNavigationType();\n\n _useEffect(() => {\n // Performance concern:\n // This is repeated when <Routes /> is rendered.\n routes = _createRoutesFromChildren(props.children);\n isBaseLocation = true;\n\n updatePageloadTransaction(location, routes);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.children]);\n\n _useEffect(() => {\n handleNavigation(location, routes, navigationType, isBaseLocation);\n }, [props.children, location, navigationType, isBaseLocation]);\n\n isBaseLocation = false;\n\n // @ts-ignore Setting more specific React Component typing for `R` generic above\n // will break advanced type inference done by react router params\n return <Routes {...props} />;\n };\n\n hoistNonReactStatics(SentryRoutes, Routes);\n\n // @ts-ignore Setting more specific React Component typing for `R` generic above\n // will break advanced type inference done by react router params\n return SentryRoutes;\n}\n\nexport function wrapUseRoutes(origUseRoutes: UseRoutes): UseRoutes {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes || !_customStartTransaction) {\n __DEBUG_BUILD__ &&\n logger.warn(\n 'reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.',\n );\n\n return origUseRoutes;\n }\n\n let isBaseLocation: boolean = false;\n\n return (routes: RouteObject[], location?: Partial<Location> | string): React.ReactElement | null => {\n const SentryRoutes: React.FC<unknown> = (props: unknown) => {\n const Routes = origUseRoutes(routes, location);\n\n const locationArgObject = typeof location === 'string' ? { pathname: location } : location;\n const locationObject = (locationArgObject as Location) || _useLocation();\n const navigationType = _useNavigationType();\n\n _useEffect(() => {\n isBaseLocation = true;\n\n updatePageloadTransaction(locationObject, routes);\n }, [props]);\n\n _useEffect(() => {\n handleNavigation(locationObject, routes, navigationType, isBaseLocation);\n }, [props, locationObject, navigationType, isBaseLocation]);\n\n isBaseLocation = false;\n\n return Routes;\n };\n\n return <SentryRoutes />;\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;AAkDA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;AAEA;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA;;AAEA;;;;AAIA;;AAEA;;;;;AAKA;;;;;;;;;;;;;;;;;;;;;;;;AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA;;;;"}
|
|
1
|
+
{"version":3,"file":"reactrouterv6.js","sources":["../../src/reactrouterv6.tsx"],"sourcesContent":["// Inspired from Donnie McNeal's solution:\n// https://gist.github.com/wontondon/e8c4bdf2888875e4c755712e99279536\n\nimport { WINDOW } from '@sentry/browser';\nimport { Transaction, TransactionContext, TransactionSource } from '@sentry/types';\nimport { getNumberOfUrlSegments, logger } from '@sentry/utils';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport React from 'react';\n\nimport { Action, Location } from './types';\n\ninterface NonIndexRouteObject {\n caseSensitive?: boolean;\n children?: RouteObject[];\n element?: React.ReactNode | null;\n index?: false;\n path?: string;\n}\n\ninterface IndexRouteObject {\n caseSensitive?: boolean;\n children?: undefined;\n element?: React.ReactNode | null;\n index?: true;\n path?: string;\n}\n\n// This type was originally just `type RouteObject = IndexRouteObject`, but this was changed\n// in https://github.com/remix-run/react-router/pull/9366, which was released with `6.4.2`\n// See https://github.com/remix-run/react-router/issues/9427 for a discussion on this.\ntype RouteObject = IndexRouteObject | NonIndexRouteObject;\n\ntype Params<Key extends string = string> = {\n readonly [key in Key]: string | undefined;\n};\n\ntype UseRoutes = (routes: RouteObject[], locationArg?: Partial<Location> | string) => React.ReactElement | null;\n\n// https://github.com/remix-run/react-router/blob/9fa54d643134cd75a0335581a75db8100ed42828/packages/react-router/lib/router.ts#L114-L134\ninterface RouteMatch<ParamKey extends string = string> {\n /**\n * The names and values of dynamic parameters in the URL.\n */\n params: Params<ParamKey>;\n /**\n * The portion of the URL pathname that was matched.\n */\n pathname: string;\n /**\n * The portion of the URL pathname that was matched before child routes.\n */\n pathnameBase: string;\n /**\n * The route object that was used to match.\n */\n route: RouteObject;\n}\n\ntype UseEffect = (cb: () => void, deps: unknown[]) => void;\ntype UseLocation = () => Location;\ntype UseNavigationType = () => Action;\n\n// For both of these types, use `any` instead of `RouteObject[]` or `RouteMatch[]`.\n// Have to do this so we maintain backwards compatability between\n// react-router > 6.0.0 and >= 6.4.2.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype RouteObjectArrayAlias = any;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype RouteMatchAlias = any;\ntype CreateRoutesFromChildren = (children: JSX.Element[]) => RouteObjectArrayAlias;\ntype MatchRoutes = (routes: RouteObjectArrayAlias, location: Location) => RouteMatchAlias[] | null;\n\nlet activeTransaction: Transaction | undefined;\n\nlet _useEffect: UseEffect;\nlet _useLocation: UseLocation;\nlet _useNavigationType: UseNavigationType;\nlet _createRoutesFromChildren: CreateRoutesFromChildren;\nlet _matchRoutes: MatchRoutes;\nlet _customStartTransaction: (context: TransactionContext) => Transaction | undefined;\nlet _startTransactionOnLocationChange: boolean;\n\nconst SENTRY_TAGS = {\n 'routing.instrumentation': 'react-router-v6',\n};\n\nexport function reactRouterV6Instrumentation(\n useEffect: UseEffect,\n useLocation: UseLocation,\n useNavigationType: UseNavigationType,\n createRoutesFromChildren: CreateRoutesFromChildren,\n matchRoutes: MatchRoutes,\n) {\n return (\n customStartTransaction: (context: TransactionContext) => Transaction | undefined,\n startTransactionOnPageLoad = true,\n startTransactionOnLocationChange = true,\n ): void => {\n const initPathName = WINDOW && WINDOW.location && WINDOW.location.pathname;\n if (startTransactionOnPageLoad && initPathName) {\n activeTransaction = customStartTransaction({\n name: initPathName,\n op: 'pageload',\n tags: SENTRY_TAGS,\n metadata: {\n source: 'url',\n },\n });\n }\n\n _useEffect = useEffect;\n _useLocation = useLocation;\n _useNavigationType = useNavigationType;\n _matchRoutes = matchRoutes;\n _createRoutesFromChildren = createRoutesFromChildren;\n\n _customStartTransaction = customStartTransaction;\n _startTransactionOnLocationChange = startTransactionOnLocationChange;\n };\n}\n\nfunction getNormalizedName(\n routes: RouteObject[],\n location: Location,\n matchRoutes: MatchRoutes,\n): [string, TransactionSource] {\n if (!routes || routes.length === 0 || !matchRoutes) {\n return [location.pathname, 'url'];\n }\n\n const branches = matchRoutes(routes, location) as unknown as RouteMatch[];\n\n let pathBuilder = '';\n if (branches) {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let x = 0; x < branches.length; x++) {\n const branch = branches[x];\n const route = branch.route;\n if (route) {\n // Early return if index route\n if (route.index) {\n return [branch.pathname, 'route'];\n }\n\n const path = route.path;\n if (path) {\n const newPath = path[0] === '/' || pathBuilder[pathBuilder.length - 1] === '/' ? path : `/${path}`;\n pathBuilder += newPath;\n if (branch.pathname === location.pathname) {\n if (\n // If the route defined on the element is something like\n // <Route path=\"/stores/:storeId/products/:productId\" element={<div>Product</div>} />\n // We should check against the branch.pathname for the number of / seperators\n getNumberOfUrlSegments(pathBuilder) !== getNumberOfUrlSegments(branch.pathname) &&\n // We should not count wildcard operators in the url segments calculation\n pathBuilder.slice(-2) !== '/*'\n ) {\n return [newPath, 'route'];\n }\n return [pathBuilder, 'route'];\n }\n }\n }\n }\n }\n\n return [location.pathname, 'url'];\n}\n\nfunction updatePageloadTransaction(location: Location, routes: RouteObject[]): void {\n if (activeTransaction) {\n activeTransaction.setName(...getNormalizedName(routes, location, _matchRoutes));\n }\n}\n\nfunction handleNavigation(\n location: Location,\n routes: RouteObject[],\n navigationType: Action,\n isBaseLocation: boolean,\n): void {\n if (isBaseLocation) {\n if (activeTransaction) {\n activeTransaction.finish();\n }\n\n return;\n }\n\n if (_startTransactionOnLocationChange && (navigationType === 'PUSH' || navigationType === 'POP')) {\n if (activeTransaction) {\n activeTransaction.finish();\n }\n\n const [name, source] = getNormalizedName(routes, location, _matchRoutes);\n activeTransaction = _customStartTransaction({\n name,\n op: 'navigation',\n tags: SENTRY_TAGS,\n metadata: {\n source,\n },\n });\n }\n}\n\nexport function withSentryReactRouterV6Routing<P extends Record<string, any>, R extends React.FC<P>>(Routes: R): R {\n if (\n !_useEffect ||\n !_useLocation ||\n !_useNavigationType ||\n !_createRoutesFromChildren ||\n !_matchRoutes ||\n !_customStartTransaction\n ) {\n __DEBUG_BUILD__ &&\n logger.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.\n useEffect: ${_useEffect}. useLocation: ${_useLocation}. useNavigationType: ${_useNavigationType}.\n createRoutesFromChildren: ${_createRoutesFromChildren}. matchRoutes: ${_matchRoutes}. customStartTransaction: ${_customStartTransaction}.`);\n\n return Routes;\n }\n\n let isBaseLocation: boolean = false;\n let routes: RouteObject[];\n\n const SentryRoutes: React.FC<P> = (props: P) => {\n const location = _useLocation();\n const navigationType = _useNavigationType();\n\n _useEffect(() => {\n // Performance concern:\n // This is repeated when <Routes /> is rendered.\n routes = _createRoutesFromChildren(props.children) as RouteObject[];\n isBaseLocation = true;\n\n updatePageloadTransaction(location, routes);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.children]);\n\n _useEffect(() => {\n handleNavigation(location, routes, navigationType, isBaseLocation);\n }, [props.children, location, navigationType, isBaseLocation]);\n\n isBaseLocation = false;\n\n // @ts-ignore Setting more specific React Component typing for `R` generic above\n // will break advanced type inference done by react router params\n return <Routes {...props} />;\n };\n\n hoistNonReactStatics(SentryRoutes, Routes);\n\n // @ts-ignore Setting more specific React Component typing for `R` generic above\n // will break advanced type inference done by react router params\n return SentryRoutes;\n}\n\nexport function wrapUseRoutes(origUseRoutes: UseRoutes): UseRoutes {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes || !_customStartTransaction) {\n __DEBUG_BUILD__ &&\n logger.warn(\n 'reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.',\n );\n\n return origUseRoutes;\n }\n\n let isBaseLocation: boolean = false;\n\n return (routes: RouteObject[], location?: Partial<Location> | string): React.ReactElement | null => {\n const SentryRoutes: React.FC<unknown> = (props: unknown) => {\n const Routes = origUseRoutes(routes, location);\n\n const locationArgObject = typeof location === 'string' ? { pathname: location } : location;\n const locationObject = (locationArgObject as Location) || _useLocation();\n const navigationType = _useNavigationType();\n\n _useEffect(() => {\n isBaseLocation = true;\n\n updatePageloadTransaction(locationObject, routes);\n }, [props]);\n\n _useEffect(() => {\n handleNavigation(locationObject, routes, navigationType, isBaseLocation);\n }, [props, locationObject, navigationType, isBaseLocation]);\n\n isBaseLocation = false;\n\n return Routes;\n };\n\n return <SentryRoutes />;\n };\n}\n"],"names":["WINDOW","getNumberOfUrlSegments","logger","React","hoistNonReactStatics"],"mappings":";;;;;;;;;;;;;;AAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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A,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;EACA,CAAA;AACA;;;;"}
|
package/cjs/redux.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const browser = require('@sentry/browser');
|
|
4
4
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
const ACTION_BREADCRUMB_CATEGORY = 'redux.action';
|
|
8
|
+
const ACTION_BREADCRUMB_TYPE = 'info';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const defaultOptions = {
|
|
11
11
|
actionTransformer: action => action,
|
|
12
12
|
stateTransformer: state => state || null,
|
|
13
13
|
};
|
|
@@ -19,19 +19,19 @@ var defaultOptions = {
|
|
|
19
19
|
*/
|
|
20
20
|
function createReduxEnhancer(enhancerOptions) {
|
|
21
21
|
// Note: We return an any type as to not have type conflicts.
|
|
22
|
-
|
|
22
|
+
const options = {
|
|
23
23
|
...defaultOptions,
|
|
24
24
|
...enhancerOptions,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
return (next) =>
|
|
28
28
|
(reducer, initialState) => {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const sentryReducer = (state, action) => {
|
|
30
|
+
const newState = reducer(state, action);
|
|
31
31
|
|
|
32
32
|
browser.configureScope(scope => {
|
|
33
33
|
/* Action breadcrumbs */
|
|
34
|
-
|
|
34
|
+
const transformedAction = options.actionTransformer(action);
|
|
35
35
|
if (typeof transformedAction !== 'undefined' && transformedAction !== null) {
|
|
36
36
|
scope.addBreadcrumb({
|
|
37
37
|
category: ACTION_BREADCRUMB_CATEGORY,
|
|
@@ -41,7 +41,7 @@ function createReduxEnhancer(enhancerOptions) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/* Set latest state to scope */
|
|
44
|
-
|
|
44
|
+
const transformedState = options.stateTransformer(newState);
|
|
45
45
|
if (typeof transformedState !== 'undefined' && transformedState !== null) {
|
|
46
46
|
scope.setContext('state', { state: { type: 'redux', value: transformedState } });
|
|
47
47
|
} else {
|
package/cjs/redux.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redux.js","sources":["../../src/redux.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { configureScope } from '@sentry/browser';\nimport { Scope } from '@sentry/types';\n\ninterface Action<T = any> {\n type: T;\n}\n\ninterface AnyAction extends Action {\n [extraProps: string]: any;\n}\n\ntype Reducer<S = any, A extends Action = AnyAction> = (state: S | undefined, action: A) => S;\n\ntype Dispatch<A extends Action = AnyAction> = <T extends A>(action: T, ...extraArgs: any[]) => T;\n\ntype ExtendState<State, Extension> = [Extension] extends [never] ? State : State & Extension;\n\ntype Unsubscribe = () => void;\n\ninterface Store<S = any, A extends Action = AnyAction, StateExt = never, Ext = Record<string, unknown>> {\n dispatch: Dispatch<A>;\n getState(): S;\n subscribe(listener: () => void): Unsubscribe;\n replaceReducer<NewState, NewActions extends Action>(\n nextReducer: Reducer<NewState, NewActions>,\n ): Store<ExtendState<NewState, StateExt>, NewActions, StateExt, Ext> & Ext;\n}\n\ndeclare const $CombinedState: unique symbol;\n\ntype CombinedState<S> = { readonly [$CombinedState]?: undefined } & S;\n\ntype PreloadedState<S> = Required<S> extends {\n [$CombinedState]: undefined;\n}\n ? S extends CombinedState<infer S1>\n ? { [K in keyof S1]?: S1[K] extends Record<string, unknown> ? PreloadedState<S1[K]> : S1[K] }\n : never\n : { [K in keyof S]: S[K] extends string | number | boolean | symbol ? S[K] : PreloadedState<S[K]> };\n\ntype StoreEnhancerStoreCreator<Ext = Record<string, unknown>, StateExt = never> = <\n S = any,\n A extends Action = AnyAction,\n>(\n reducer: Reducer<S, A>,\n preloadedState?: PreloadedState<S>,\n) => Store<ExtendState<S, StateExt>, A, StateExt, Ext> & Ext;\n\nexport interface SentryEnhancerOptions<S = any> {\n /**\n * Transforms the state before attaching it to an event.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not attach the state.\n */\n stateTransformer(state: S | undefined): (S & any) | null;\n /**\n * Transforms the action before sending it as a breadcrumb.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not send the breadcrumb.\n */\n actionTransformer(action: AnyAction): AnyAction | null;\n /**\n * Called on every state update, configure the Sentry Scope with the redux state.\n */\n configureScopeWithState?(scope: Scope, state: S): void;\n}\n\nconst ACTION_BREADCRUMB_CATEGORY = 'redux.action';\nconst ACTION_BREADCRUMB_TYPE = 'info';\n\nconst defaultOptions: SentryEnhancerOptions = {\n actionTransformer: action => action,\n stateTransformer: state => state || null,\n};\n\n/**\n * Creates an enhancer that would be passed to Redux's createStore to log actions and the latest state to Sentry.\n *\n * @param enhancerOptions Options to pass to the enhancer\n */\nfunction createReduxEnhancer(enhancerOptions?: Partial<SentryEnhancerOptions>): any {\n // Note: We return an any type as to not have type conflicts.\n const options = {\n ...defaultOptions,\n ...enhancerOptions,\n };\n\n return (next: StoreEnhancerStoreCreator): StoreEnhancerStoreCreator =>\n <S = any, A extends Action = AnyAction>(reducer: Reducer<S, A>, initialState?: PreloadedState<S>) => {\n const sentryReducer: Reducer<S, A> = (state, action): S => {\n const newState = reducer(state, action);\n\n configureScope(scope => {\n /* Action breadcrumbs */\n const transformedAction = options.actionTransformer(action);\n if (typeof transformedAction !== 'undefined' && transformedAction !== null) {\n scope.addBreadcrumb({\n category: ACTION_BREADCRUMB_CATEGORY,\n data: transformedAction,\n type: ACTION_BREADCRUMB_TYPE,\n });\n }\n\n /* Set latest state to scope */\n const transformedState = options.stateTransformer(newState);\n if (typeof transformedState !== 'undefined' && transformedState !== null) {\n scope.setContext('state', { state: { type: 'redux', value: transformedState } });\n } else {\n scope.setContext('state', null);\n }\n\n /* Allow user to configure scope with latest state */\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { configureScopeWithState } = options;\n if (typeof configureScopeWithState === 'function') {\n configureScopeWithState(scope, newState);\n }\n });\n\n return newState;\n };\n\n return next(sentryReducer, initialState);\n };\n}\n\nexport { createReduxEnhancer };\n"],"names":[],"mappings":";;;;AAAA;;AAoEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"redux.js","sources":["../../src/redux.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { configureScope } from '@sentry/browser';\nimport { Scope } from '@sentry/types';\n\ninterface Action<T = any> {\n type: T;\n}\n\ninterface AnyAction extends Action {\n [extraProps: string]: any;\n}\n\ntype Reducer<S = any, A extends Action = AnyAction> = (state: S | undefined, action: A) => S;\n\ntype Dispatch<A extends Action = AnyAction> = <T extends A>(action: T, ...extraArgs: any[]) => T;\n\ntype ExtendState<State, Extension> = [Extension] extends [never] ? State : State & Extension;\n\ntype Unsubscribe = () => void;\n\ninterface Store<S = any, A extends Action = AnyAction, StateExt = never, Ext = Record<string, unknown>> {\n dispatch: Dispatch<A>;\n getState(): S;\n subscribe(listener: () => void): Unsubscribe;\n replaceReducer<NewState, NewActions extends Action>(\n nextReducer: Reducer<NewState, NewActions>,\n ): Store<ExtendState<NewState, StateExt>, NewActions, StateExt, Ext> & Ext;\n}\n\ndeclare const $CombinedState: unique symbol;\n\ntype CombinedState<S> = { readonly [$CombinedState]?: undefined } & S;\n\ntype PreloadedState<S> = Required<S> extends {\n [$CombinedState]: undefined;\n}\n ? S extends CombinedState<infer S1>\n ? { [K in keyof S1]?: S1[K] extends Record<string, unknown> ? PreloadedState<S1[K]> : S1[K] }\n : never\n : { [K in keyof S]: S[K] extends string | number | boolean | symbol ? S[K] : PreloadedState<S[K]> };\n\ntype StoreEnhancerStoreCreator<Ext = Record<string, unknown>, StateExt = never> = <\n S = any,\n A extends Action = AnyAction,\n>(\n reducer: Reducer<S, A>,\n preloadedState?: PreloadedState<S>,\n) => Store<ExtendState<S, StateExt>, A, StateExt, Ext> & Ext;\n\nexport interface SentryEnhancerOptions<S = any> {\n /**\n * Transforms the state before attaching it to an event.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not attach the state.\n */\n stateTransformer(state: S | undefined): (S & any) | null;\n /**\n * Transforms the action before sending it as a breadcrumb.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not send the breadcrumb.\n */\n actionTransformer(action: AnyAction): AnyAction | null;\n /**\n * Called on every state update, configure the Sentry Scope with the redux state.\n */\n configureScopeWithState?(scope: Scope, state: S): void;\n}\n\nconst ACTION_BREADCRUMB_CATEGORY = 'redux.action';\nconst ACTION_BREADCRUMB_TYPE = 'info';\n\nconst defaultOptions: SentryEnhancerOptions = {\n actionTransformer: action => action,\n stateTransformer: state => state || null,\n};\n\n/**\n * Creates an enhancer that would be passed to Redux's createStore to log actions and the latest state to Sentry.\n *\n * @param enhancerOptions Options to pass to the enhancer\n */\nfunction createReduxEnhancer(enhancerOptions?: Partial<SentryEnhancerOptions>): any {\n // Note: We return an any type as to not have type conflicts.\n const options = {\n ...defaultOptions,\n ...enhancerOptions,\n };\n\n return (next: StoreEnhancerStoreCreator): StoreEnhancerStoreCreator =>\n <S = any, A extends Action = AnyAction>(reducer: Reducer<S, A>, initialState?: PreloadedState<S>) => {\n const sentryReducer: Reducer<S, A> = (state, action): S => {\n const newState = reducer(state, action);\n\n configureScope(scope => {\n /* Action breadcrumbs */\n const transformedAction = options.actionTransformer(action);\n if (typeof transformedAction !== 'undefined' && transformedAction !== null) {\n scope.addBreadcrumb({\n category: ACTION_BREADCRUMB_CATEGORY,\n data: transformedAction,\n type: ACTION_BREADCRUMB_TYPE,\n });\n }\n\n /* Set latest state to scope */\n const transformedState = options.stateTransformer(newState);\n if (typeof transformedState !== 'undefined' && transformedState !== null) {\n scope.setContext('state', { state: { type: 'redux', value: transformedState } });\n } else {\n scope.setContext('state', null);\n }\n\n /* Allow user to configure scope with latest state */\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { configureScopeWithState } = options;\n if (typeof configureScopeWithState === 'function') {\n configureScopeWithState(scope, newState);\n }\n });\n\n return newState;\n };\n\n return next(sentryReducer, initialState);\n };\n}\n\nexport { createReduxEnhancer };\n"],"names":["configureScope"],"mappings":";;;;AAAA;;AAoEA,MAAA,0BAAA,GAAA,cAAA,CAAA;AACA,MAAA,sBAAA,GAAA,MAAA,CAAA;AACA;AACA,MAAA,cAAA,GAAA;AACA,EAAA,iBAAA,EAAA,MAAA,IAAA,MAAA;AACA,EAAA,gBAAA,EAAA,KAAA,IAAA,KAAA,IAAA,IAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,mBAAA,CAAA,eAAA,EAAA;AACA;AACA,EAAA,MAAA,OAAA,GAAA;AACA,IAAA,GAAA,cAAA;AACA,IAAA,GAAA,eAAA;AACA,GAAA,CAAA;AACA;AACA,EAAA,OAAA,CAAA,IAAA;AACA,IAAA,CAAA,OAAA,EAAA,YAAA,KAAA;AACA,MAAA,MAAA,aAAA,GAAA,CAAA,KAAA,EAAA,MAAA,KAAA;AACA,QAAA,MAAA,QAAA,GAAA,OAAA,CAAA,KAAA,EAAA,MAAA,CAAA,CAAA;AACA;AACA,QAAAA,sBAAA,CAAA,KAAA,IAAA;AACA;AACA,UAAA,MAAA,iBAAA,GAAA,OAAA,CAAA,iBAAA,CAAA,MAAA,CAAA,CAAA;AACA,UAAA,IAAA,OAAA,iBAAA,KAAA,WAAA,IAAA,iBAAA,KAAA,IAAA,EAAA;AACA,YAAA,KAAA,CAAA,aAAA,CAAA;AACA,cAAA,QAAA,EAAA,0BAAA;AACA,cAAA,IAAA,EAAA,iBAAA;AACA,cAAA,IAAA,EAAA,sBAAA;AACA,aAAA,CAAA,CAAA;AACA,WAAA;AACA;AACA;AACA,UAAA,MAAA,gBAAA,GAAA,OAAA,CAAA,gBAAA,CAAA,QAAA,CAAA,CAAA;AACA,UAAA,IAAA,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA,KAAA,IAAA,EAAA;AACA,YAAA,KAAA,CAAA,UAAA,CAAA,OAAA,EAAA,EAAA,KAAA,EAAA,EAAA,IAAA,EAAA,OAAA,EAAA,KAAA,EAAA,gBAAA,EAAA,EAAA,CAAA,CAAA;AACA,WAAA,MAAA;AACA,YAAA,KAAA,CAAA,UAAA,CAAA,OAAA,EAAA,IAAA,CAAA,CAAA;AACA,WAAA;AACA;AACA;AACA;AACA,UAAA,MAAA,EAAA,uBAAA,EAAA,GAAA,OAAA,CAAA;AACA,UAAA,IAAA,OAAA,uBAAA,KAAA,UAAA,EAAA;AACA,YAAA,uBAAA,CAAA,KAAA,EAAA,QAAA,CAAA,CAAA;AACA,WAAA;AACA,SAAA,CAAA,CAAA;AACA;AACA,QAAA,OAAA,QAAA,CAAA;AACA,OAAA,CAAA;AACA;AACA,MAAA,OAAA,IAAA,CAAA,aAAA,EAAA,YAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA;;;;"}
|
package/cjs/sdk.js
CHANGED
package/cjs/sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import { BrowserOptions, init as browserInit, SDK_VERSION } from '@sentry/browser';\n\n/**\n * Inits the React SDK\n */\nexport function init(options: BrowserOptions): void {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.react',\n packages: [\n {\n name: 'npm:@sentry/react',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n browserInit(options);\n}\n"],"names":[],"mappings":";;;;AAEA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import { BrowserOptions, init as browserInit, SDK_VERSION } from '@sentry/browser';\n\n/**\n * Inits the React SDK\n */\nexport function init(options: BrowserOptions): void {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.react',\n packages: [\n {\n name: 'npm:@sentry/react',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n browserInit(options);\n}\n"],"names":["SDK_VERSION","browserInit"],"mappings":";;;;AAEA;AACA;AACA;AACA,SAAA,IAAA,CAAA,OAAA,EAAA;AACA,EAAA,OAAA,CAAA,SAAA,GAAA,OAAA,CAAA,SAAA,IAAA,EAAA,CAAA;AACA,EAAA,OAAA,CAAA,SAAA,CAAA,GAAA,GAAA,OAAA,CAAA,SAAA,CAAA,GAAA,IAAA;AACA,IAAA,IAAA,EAAA,yBAAA;AACA,IAAA,QAAA,EAAA;AACA,MAAA;AACA,QAAA,IAAA,EAAA,mBAAA;AACA,QAAA,OAAA,EAAAA,mBAAA;AACA,OAAA;AACA,KAAA;AACA,IAAA,OAAA,EAAAA,mBAAA;AACA,GAAA,CAAA;AACA,EAAAC,YAAA,CAAA,OAAA,CAAA,CAAA;AACA;;;;"}
|
package/esm/constants.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
const REACT_RENDER_OP = 'ui.react.render';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const REACT_UPDATE_OP = 'ui.react.update';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const REACT_MOUNT_OP = 'ui.react.mount';
|
|
6
6
|
|
|
7
7
|
export { REACT_MOUNT_OP, REACT_RENDER_OP, REACT_UPDATE_OP };
|
|
8
8
|
//# sourceMappingURL=constants.js.map
|
package/esm/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const REACT_RENDER_OP = 'ui.react.render';\n\nexport const REACT_UPDATE_OP = 'ui.react.update';\n\nexport const REACT_MOUNT_OP = 'ui.react.mount';\n"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const REACT_RENDER_OP = 'ui.react.render';\n\nexport const REACT_UPDATE_OP = 'ui.react.update';\n\nexport const REACT_MOUNT_OP = 'ui.react.mount';\n"],"names":[],"mappings":"AAAA,MAAA,eAAA,GAAA,kBAAA;AACA;AACA,MAAA,eAAA,GAAA,kBAAA;AACA;AACA,MAAA,cAAA,GAAA;;;;"}
|
package/esm/errorboundary.js
CHANGED
|
@@ -3,15 +3,15 @@ import { logger } from '@sentry/utils';
|
|
|
3
3
|
import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/errorboundary.tsx";
|
|
7
7
|
function isAtLeastReact17(version) {
|
|
8
|
-
|
|
8
|
+
const major = version.match(/^([^.]+)/);
|
|
9
9
|
return major !== null && parseInt(major[0]) >= 17;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const UNKNOWN_COMPONENT = 'unknown';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const INITIAL_STATE = {
|
|
15
15
|
componentStack: null,
|
|
16
16
|
error: null,
|
|
17
17
|
eventId: null,
|
|
@@ -34,7 +34,7 @@ class ErrorBoundary extends React.Component {constructor(...args) { super(...arg
|
|
|
34
34
|
// to to the original error using `error.cause` otherwise relies on error param for stacktrace.
|
|
35
35
|
// Linking errors requires the `LinkedErrors` integration be enabled.
|
|
36
36
|
if (isAtLeastReact17(React.version)) {
|
|
37
|
-
|
|
37
|
+
const errorBoundaryError = new Error(error.message);
|
|
38
38
|
errorBoundaryError.name = `React ErrorBoundary ${errorBoundaryError.name}`;
|
|
39
39
|
errorBoundaryError.stack = componentStack;
|
|
40
40
|
|
|
@@ -45,7 +45,7 @@ class ErrorBoundary extends React.Component {constructor(...args) { super(...arg
|
|
|
45
45
|
if (beforeCapture) {
|
|
46
46
|
beforeCapture(scope, error, componentStack);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
const eventId = captureException(error, { contexts: { react: { componentStack } } });
|
|
49
49
|
if (onError) {
|
|
50
50
|
onError(error, componentStack, eventId);
|
|
51
51
|
}
|
|
@@ -120,9 +120,9 @@ function withErrorBoundary(
|
|
|
120
120
|
errorBoundaryOptions,
|
|
121
121
|
) {
|
|
122
122
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
123
|
-
|
|
123
|
+
const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
const Wrapped = (props) => (
|
|
126
126
|
React.createElement(ErrorBoundary, { ...errorBoundaryOptions, __self: this, __source: {fileName: _jsxFileName, lineNumber: 168}}
|
|
127
127
|
, React.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 169}} )
|
|
128
128
|
)
|
package/esm/errorboundary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorboundary.js","sources":["../../src/errorboundary.tsx"],"sourcesContent":["import { captureException, ReportDialogOptions, Scope, showReportDialog, withScope } from '@sentry/browser';\nimport { logger } from '@sentry/utils';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\n\nexport function isAtLeastReact17(version: string): boolean {\n const major = version.match(/^([^.]+)/);\n return major !== null && parseInt(major[0]) >= 17;\n}\n\nexport const UNKNOWN_COMPONENT = 'unknown';\n\nexport type FallbackRender = (errorData: {\n error: Error;\n componentStack: string | null;\n eventId: string | null;\n resetError(): void;\n}) => React.ReactElement;\n\nexport type ErrorBoundaryProps = {\n children?: React.ReactNode | (() => React.ReactNode);\n /** If a Sentry report dialog should be rendered on error */\n showDialog?: boolean;\n /**\n * Options to be passed into the Sentry report dialog.\n * No-op if {@link showDialog} is false.\n */\n dialogOptions?: ReportDialogOptions;\n /**\n * A fallback component that gets rendered when the error boundary encounters an error.\n *\n * Can either provide a React Component, or a function that returns React Component as\n * a valid fallback prop. If a function is provided, the function will be called with\n * the error, the component stack, and an function that resets the error boundary on error.\n *\n */\n fallback?: React.ReactElement | FallbackRender;\n /** Called when the error boundary encounters an error */\n onError?(error: Error, componentStack: string, eventId: string): void;\n /** Called on componentDidMount() */\n onMount?(): void;\n /** Called if resetError() is called from the fallback render props function */\n onReset?(error: Error | null, componentStack: string | null, eventId: string | null): void;\n /** Called on componentWillUnmount() */\n onUnmount?(error: Error | null, componentStack: string | null, eventId: string | null): void;\n /** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */\n beforeCapture?(scope: Scope, error: Error | null, componentStack: string | null): void;\n};\n\ntype ErrorBoundaryState = {\n componentStack: React.ErrorInfo['componentStack'] | null;\n error: Error | null;\n eventId: string | null;\n};\n\nconst INITIAL_STATE = {\n componentStack: null,\n error: null,\n eventId: null,\n};\n\n/**\n * A ErrorBoundary component that logs errors to Sentry. Requires React >= 16.\n * NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the\n * Sentry React SDK ErrorBoundary caught an error invoking your application code. This\n * is expected behavior and NOT indicative of a bug with the Sentry React SDK.\n */\nclass ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state: ErrorBoundaryState = INITIAL_STATE;\n\n public componentDidCatch(error: Error & { cause?: Error }, { componentStack }: React.ErrorInfo): void {\n const { beforeCapture, onError, showDialog, dialogOptions } = this.props;\n\n withScope(scope => {\n // If on React version >= 17, create stack trace from componentStack param and links\n // to to the original error using `error.cause` otherwise relies on error param for stacktrace.\n // Linking errors requires the `LinkedErrors` integration be enabled.\n if (isAtLeastReact17(React.version)) {\n const errorBoundaryError = new Error(error.message);\n errorBoundaryError.name = `React ErrorBoundary ${errorBoundaryError.name}`;\n errorBoundaryError.stack = componentStack;\n\n // Using the `LinkedErrors` integration to link the errors together.\n error.cause = errorBoundaryError;\n }\n\n if (beforeCapture) {\n beforeCapture(scope, error, componentStack);\n }\n const eventId = captureException(error, { contexts: { react: { componentStack } } });\n if (onError) {\n onError(error, componentStack, eventId);\n }\n if (showDialog) {\n showReportDialog({ ...dialogOptions, eventId });\n }\n\n // componentDidCatch is used over getDerivedStateFromError\n // so that componentStack is accessible through state.\n this.setState({ error, componentStack, eventId });\n });\n }\n\n public componentDidMount(): void {\n const { onMount } = this.props;\n if (onMount) {\n onMount();\n }\n }\n\n public componentWillUnmount(): void {\n const { error, componentStack, eventId } = this.state;\n const { onUnmount } = this.props;\n if (onUnmount) {\n onUnmount(error, componentStack, eventId);\n }\n }\n\n public resetErrorBoundary: () => void = () => {\n const { onReset } = this.props;\n const { error, componentStack, eventId } = this.state;\n if (onReset) {\n onReset(error, componentStack, eventId);\n }\n this.setState(INITIAL_STATE);\n };\n\n public render(): React.ReactNode {\n const { fallback, children } = this.props;\n const { error, componentStack, eventId } = this.state;\n\n if (error) {\n let element: React.ReactElement | undefined = undefined;\n if (typeof fallback === 'function') {\n element = fallback({ error, componentStack, resetError: this.resetErrorBoundary, eventId });\n } else {\n element = fallback;\n }\n\n if (React.isValidElement(element)) {\n return element;\n }\n\n if (fallback) {\n __DEBUG_BUILD__ && logger.warn('fallback did not produce a valid ReactElement');\n }\n\n // Fail gracefully if no fallback provided or is not valid\n return null;\n }\n\n if (typeof children === 'function') {\n return (children as () => React.ReactNode)();\n }\n return children;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withErrorBoundary<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n errorBoundaryOptions: ErrorBoundaryProps,\n): React.FC<P> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;\n\n const Wrapped: React.FC<P> = (props: P) => (\n <ErrorBoundary {...errorBoundaryOptions}>\n <WrappedComponent {...props} />\n </ErrorBoundary>\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n Wrapped.displayName = `errorBoundary(${componentDisplayName})`;\n\n // Copy over static methods from Wrapped component to Profiler HOC\n // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over\n hoistNonReactStatics(Wrapped, WrappedComponent);\n return Wrapped;\n}\n\nexport { ErrorBoundary, withErrorBoundary };\n"],"names":[],"mappings":";;;;;AAAA,gHAIA;;AAEA;AACA;AACA;AACA;;;AA8CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"errorboundary.js","sources":["../../src/errorboundary.tsx"],"sourcesContent":["import { captureException, ReportDialogOptions, Scope, showReportDialog, withScope } from '@sentry/browser';\nimport { logger } from '@sentry/utils';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\n\nexport function isAtLeastReact17(version: string): boolean {\n const major = version.match(/^([^.]+)/);\n return major !== null && parseInt(major[0]) >= 17;\n}\n\nexport const UNKNOWN_COMPONENT = 'unknown';\n\nexport type FallbackRender = (errorData: {\n error: Error;\n componentStack: string | null;\n eventId: string | null;\n resetError(): void;\n}) => React.ReactElement;\n\nexport type ErrorBoundaryProps = {\n children?: React.ReactNode | (() => React.ReactNode);\n /** If a Sentry report dialog should be rendered on error */\n showDialog?: boolean;\n /**\n * Options to be passed into the Sentry report dialog.\n * No-op if {@link showDialog} is false.\n */\n dialogOptions?: ReportDialogOptions;\n /**\n * A fallback component that gets rendered when the error boundary encounters an error.\n *\n * Can either provide a React Component, or a function that returns React Component as\n * a valid fallback prop. If a function is provided, the function will be called with\n * the error, the component stack, and an function that resets the error boundary on error.\n *\n */\n fallback?: React.ReactElement | FallbackRender;\n /** Called when the error boundary encounters an error */\n onError?(error: Error, componentStack: string, eventId: string): void;\n /** Called on componentDidMount() */\n onMount?(): void;\n /** Called if resetError() is called from the fallback render props function */\n onReset?(error: Error | null, componentStack: string | null, eventId: string | null): void;\n /** Called on componentWillUnmount() */\n onUnmount?(error: Error | null, componentStack: string | null, eventId: string | null): void;\n /** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */\n beforeCapture?(scope: Scope, error: Error | null, componentStack: string | null): void;\n};\n\ntype ErrorBoundaryState = {\n componentStack: React.ErrorInfo['componentStack'] | null;\n error: Error | null;\n eventId: string | null;\n};\n\nconst INITIAL_STATE = {\n componentStack: null,\n error: null,\n eventId: null,\n};\n\n/**\n * A ErrorBoundary component that logs errors to Sentry. Requires React >= 16.\n * NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the\n * Sentry React SDK ErrorBoundary caught an error invoking your application code. This\n * is expected behavior and NOT indicative of a bug with the Sentry React SDK.\n */\nclass ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state: ErrorBoundaryState = INITIAL_STATE;\n\n public componentDidCatch(error: Error & { cause?: Error }, { componentStack }: React.ErrorInfo): void {\n const { beforeCapture, onError, showDialog, dialogOptions } = this.props;\n\n withScope(scope => {\n // If on React version >= 17, create stack trace from componentStack param and links\n // to to the original error using `error.cause` otherwise relies on error param for stacktrace.\n // Linking errors requires the `LinkedErrors` integration be enabled.\n if (isAtLeastReact17(React.version)) {\n const errorBoundaryError = new Error(error.message);\n errorBoundaryError.name = `React ErrorBoundary ${errorBoundaryError.name}`;\n errorBoundaryError.stack = componentStack;\n\n // Using the `LinkedErrors` integration to link the errors together.\n error.cause = errorBoundaryError;\n }\n\n if (beforeCapture) {\n beforeCapture(scope, error, componentStack);\n }\n const eventId = captureException(error, { contexts: { react: { componentStack } } });\n if (onError) {\n onError(error, componentStack, eventId);\n }\n if (showDialog) {\n showReportDialog({ ...dialogOptions, eventId });\n }\n\n // componentDidCatch is used over getDerivedStateFromError\n // so that componentStack is accessible through state.\n this.setState({ error, componentStack, eventId });\n });\n }\n\n public componentDidMount(): void {\n const { onMount } = this.props;\n if (onMount) {\n onMount();\n }\n }\n\n public componentWillUnmount(): void {\n const { error, componentStack, eventId } = this.state;\n const { onUnmount } = this.props;\n if (onUnmount) {\n onUnmount(error, componentStack, eventId);\n }\n }\n\n public resetErrorBoundary: () => void = () => {\n const { onReset } = this.props;\n const { error, componentStack, eventId } = this.state;\n if (onReset) {\n onReset(error, componentStack, eventId);\n }\n this.setState(INITIAL_STATE);\n };\n\n public render(): React.ReactNode {\n const { fallback, children } = this.props;\n const { error, componentStack, eventId } = this.state;\n\n if (error) {\n let element: React.ReactElement | undefined = undefined;\n if (typeof fallback === 'function') {\n element = fallback({ error, componentStack, resetError: this.resetErrorBoundary, eventId });\n } else {\n element = fallback;\n }\n\n if (React.isValidElement(element)) {\n return element;\n }\n\n if (fallback) {\n __DEBUG_BUILD__ && logger.warn('fallback did not produce a valid ReactElement');\n }\n\n // Fail gracefully if no fallback provided or is not valid\n return null;\n }\n\n if (typeof children === 'function') {\n return (children as () => React.ReactNode)();\n }\n return children;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withErrorBoundary<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n errorBoundaryOptions: ErrorBoundaryProps,\n): React.FC<P> {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;\n\n const Wrapped: React.FC<P> = (props: P) => (\n <ErrorBoundary {...errorBoundaryOptions}>\n <WrappedComponent {...props} />\n </ErrorBoundary>\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n Wrapped.displayName = `errorBoundary(${componentDisplayName})`;\n\n // Copy over static methods from Wrapped component to Profiler HOC\n // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over\n hoistNonReactStatics(Wrapped, WrappedComponent);\n return Wrapped;\n}\n\nexport { ErrorBoundary, withErrorBoundary };\n"],"names":[],"mappings":";;;;;AAAA,MAAA,YAAA,GAAA,4FAAA,CAIA;AACA,SAAA,gBAAA,CAAA,OAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,OAAA,CAAA,KAAA,CAAA,UAAA,CAAA,CAAA;AACA,EAAA,OAAA,KAAA,KAAA,IAAA,IAAA,QAAA,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAAA,CAAA;AACA,CAAA;AACA;AACA,MAAA,iBAAA,GAAA,UAAA;;AA6CA,MAAA,aAAA,GAAA;AACA,EAAA,cAAA,EAAA,IAAA;AACA,EAAA,KAAA,EAAA,IAAA;AACA,EAAA,OAAA,EAAA,IAAA;AACA,CAAA,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,aAAA,SAAA,KAAA,CAAA,SAAA,CAAA,CAAA,WAAA,CAAA,GAAA,IAAA,EAAA,EAAA,KAAA,CAAA,GAAA,IAAA,CAAA,CAAA,CAAA,aAAA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AAA,YAAA,EAAA,UAAA,EAAA,GAAA,CAAA,CAAA,EAAA;AACA,KAAA;AACA,GAAA,CAAA;AACA;AACA;AACA,EAAA,OAAA,CAAA,WAAA,GAAA,CAAA,cAAA,EAAA,oBAAA,CAAA,CAAA,CAAA,CAAA;AACA;AACA;AACA;AACA,EAAA,oBAAA,CAAA,OAAA,EAAA,gBAAA,CAAA,CAAA;AACA,EAAA,OAAA,OAAA,CAAA;AACA;;;;"}
|
package/esm/profiler.js
CHANGED
|
@@ -4,9 +4,9 @@ import hoistNonReactStatics from 'hoist-non-react-statics';
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { REACT_MOUNT_OP, REACT_UPDATE_OP, REACT_RENDER_OP } from './constants.js';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/profiler.tsx";/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const UNKNOWN_COMPONENT = 'unknown';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The Profiler component leverages Sentry's Tracing integration to generate
|
|
@@ -38,7 +38,7 @@ class Profiler extends React.Component {
|
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const activeTransaction = getActiveTransaction();
|
|
42
42
|
if (activeTransaction) {
|
|
43
43
|
this._mountSpan = activeTransaction.startChild({
|
|
44
44
|
description: `<${name}>`,
|
|
@@ -61,9 +61,9 @@ class Profiler extends React.Component {
|
|
|
61
61
|
if (includeUpdates && this._mountSpan && updateProps !== this.props.updateProps) {
|
|
62
62
|
// See what props haved changed between the previous props, and the current props. This is
|
|
63
63
|
// set as data on the span. We just store the prop keys as the values could be potenially very large.
|
|
64
|
-
|
|
64
|
+
const changedProps = Object.keys(updateProps).filter(k => updateProps[k] !== this.props.updateProps[k]);
|
|
65
65
|
if (changedProps.length > 0) {
|
|
66
|
-
|
|
66
|
+
const now = timestampWithMs();
|
|
67
67
|
this._updateSpan = this._mountSpan.startChild({
|
|
68
68
|
data: {
|
|
69
69
|
changedProps,
|
|
@@ -120,10 +120,10 @@ function withProfiler(
|
|
|
120
120
|
// We do not want to have `updateProps` given in options, it is instead filled through the HOC.
|
|
121
121
|
options,
|
|
122
122
|
) {
|
|
123
|
-
|
|
123
|
+
const componentDisplayName =
|
|
124
124
|
(options && options.name) || WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
const Wrapped = (props) => (
|
|
127
127
|
React.createElement(Profiler, { ...options, name: componentDisplayName, updateProps: props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 143}}
|
|
128
128
|
, React.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 144}} )
|
|
129
129
|
)
|
|
@@ -156,7 +156,7 @@ function useProfiler(
|
|
|
156
156
|
return undefined;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
const activeTransaction = getActiveTransaction();
|
|
160
160
|
if (activeTransaction) {
|
|
161
161
|
return activeTransaction.startChild({
|
|
162
162
|
description: `<${name}>`,
|
|
@@ -190,7 +190,7 @@ function useProfiler(
|
|
|
190
190
|
/** Grabs active transaction off scope */
|
|
191
191
|
function getActiveTransaction(hub = getCurrentHub()) {
|
|
192
192
|
if (hub) {
|
|
193
|
-
|
|
193
|
+
const scope = hub.getScope();
|
|
194
194
|
if (scope) {
|
|
195
195
|
return scope.getTransaction() ;
|
|
196
196
|
}
|