@sentry/react 7.0.0-alpha.1 → 7.0.0-beta.2

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.
Files changed (92) hide show
  1. package/README.md +2 -3
  2. package/cjs/constants.js +12 -5
  3. package/cjs/constants.js.map +1 -1
  4. package/cjs/errorboundary.js +139 -112
  5. package/cjs/errorboundary.js.map +1 -1
  6. package/cjs/flags.js +7 -3
  7. package/cjs/flags.js.map +1 -1
  8. package/cjs/index.js +30 -21
  9. package/cjs/index.js.map +1 -1
  10. package/cjs/profiler.js +178 -147
  11. package/cjs/profiler.js.map +1 -1
  12. package/cjs/reactrouter.js +147 -100
  13. package/cjs/reactrouter.js.map +1 -1
  14. package/cjs/reactrouterv3.js +107 -83
  15. package/cjs/reactrouterv3.js.map +1 -1
  16. package/cjs/reactrouterv6.js +163 -0
  17. package/cjs/reactrouterv6.js.map +1 -0
  18. package/cjs/redux.js +51 -42
  19. package/cjs/redux.js.map +1 -1
  20. package/cjs/sdk.js +18 -15
  21. package/cjs/sdk.js.map +1 -1
  22. package/esm/constants.js +8 -4
  23. package/esm/constants.js.map +1 -1
  24. package/esm/errorboundary.js +124 -107
  25. package/esm/errorboundary.js.map +1 -1
  26. package/esm/flags.js +5 -2
  27. package/esm/flags.js.map +1 -1
  28. package/esm/index.js +8 -7
  29. package/esm/index.js.map +1 -1
  30. package/esm/profiler.js +161 -140
  31. package/esm/profiler.js.map +1 -1
  32. package/esm/reactrouter.js +133 -94
  33. package/esm/reactrouter.js.map +1 -1
  34. package/esm/reactrouterv3.js +103 -79
  35. package/esm/reactrouterv3.js.map +1 -1
  36. package/esm/reactrouterv6.js +153 -0
  37. package/esm/reactrouterv6.js.map +1 -0
  38. package/esm/redux.js +49 -41
  39. package/esm/redux.js.map +1 -1
  40. package/esm/sdk.js +17 -14
  41. package/esm/sdk.js.map +1 -1
  42. package/package.json +5 -5
  43. package/types/errorboundary.d.ts +1 -0
  44. package/types/errorboundary.d.ts.map +1 -1
  45. package/types/index.d.ts +1 -0
  46. package/types/index.d.ts.map +1 -1
  47. package/types/reactrouterv6.d.ts +27 -0
  48. package/types/reactrouterv6.d.ts.map +1 -0
  49. package/cjs/constants.d.ts +0 -4
  50. package/cjs/constants.d.ts.map +0 -1
  51. package/cjs/errorboundary.d.ts +0 -62
  52. package/cjs/errorboundary.d.ts.map +0 -1
  53. package/cjs/flags.d.ts +0 -3
  54. package/cjs/flags.d.ts.map +0 -1
  55. package/cjs/index.d.ts +0 -8
  56. package/cjs/index.d.ts.map +0 -1
  57. package/cjs/profiler.d.ts +0 -54
  58. package/cjs/profiler.d.ts.map +0 -1
  59. package/cjs/reactrouter.d.ts +0 -25
  60. package/cjs/reactrouter.d.ts.map +0 -1
  61. package/cjs/reactrouterv3.d.ts +0 -26
  62. package/cjs/reactrouterv3.d.ts.map +0 -1
  63. package/cjs/redux.d.ts +0 -33
  64. package/cjs/redux.d.ts.map +0 -1
  65. package/cjs/sdk.d.ts +0 -6
  66. package/cjs/sdk.d.ts.map +0 -1
  67. package/cjs/types.d.ts +0 -8
  68. package/cjs/types.d.ts.map +0 -1
  69. package/cjs/types.js +0 -2
  70. package/cjs/types.js.map +0 -1
  71. package/esm/constants.d.ts +0 -4
  72. package/esm/constants.d.ts.map +0 -1
  73. package/esm/errorboundary.d.ts +0 -62
  74. package/esm/errorboundary.d.ts.map +0 -1
  75. package/esm/flags.d.ts +0 -3
  76. package/esm/flags.d.ts.map +0 -1
  77. package/esm/index.d.ts +0 -8
  78. package/esm/index.d.ts.map +0 -1
  79. package/esm/profiler.d.ts +0 -54
  80. package/esm/profiler.d.ts.map +0 -1
  81. package/esm/reactrouter.d.ts +0 -25
  82. package/esm/reactrouter.d.ts.map +0 -1
  83. package/esm/reactrouterv3.d.ts +0 -26
  84. package/esm/reactrouterv3.d.ts.map +0 -1
  85. package/esm/redux.d.ts +0 -33
  86. package/esm/redux.d.ts.map +0 -1
  87. package/esm/sdk.d.ts +0 -6
  88. package/esm/sdk.d.ts.map +0 -1
  89. package/esm/types.d.ts +0 -8
  90. package/esm/types.d.ts.map +0 -1
  91. package/esm/types.js +0 -1
  92. package/esm/types.js.map +0 -1
@@ -0,0 +1,153 @@
1
+ import { getGlobalObject, logger } from '@sentry/utils';
2
+ import hoistNonReactStatics from 'hoist-non-react-statics';
3
+ import React__default from 'react';
4
+ import { IS_DEBUG_BUILD } from './flags.js';
5
+
6
+ var _jsxFileName = "/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/reactrouterv6.tsx";
7
+
8
+ let activeTransaction;
9
+
10
+ let _useEffect;
11
+ let _useLocation;
12
+ let _useNavigationType;
13
+ let _createRoutesFromChildren;
14
+ let _matchRoutes;
15
+ let _customStartTransaction;
16
+ let _startTransactionOnLocationChange;
17
+
18
+ var global = getGlobalObject();
19
+
20
+ var SENTRY_TAGS = {
21
+ 'routing.instrumentation': 'react-router-v6',
22
+ };
23
+
24
+ function getInitPathName() {
25
+ if (global && global.location) {
26
+ return global.location.pathname;
27
+ }
28
+
29
+ return undefined;
30
+ }
31
+
32
+ function reactRouterV6Instrumentation(
33
+ useEffect,
34
+ useLocation,
35
+ useNavigationType,
36
+ createRoutesFromChildren,
37
+ matchRoutes,
38
+ ) {
39
+ return (
40
+ customStartTransaction,
41
+ startTransactionOnPageLoad = true,
42
+ startTransactionOnLocationChange = true,
43
+ ) => {
44
+ var initPathName = getInitPathName();
45
+ if (startTransactionOnPageLoad && initPathName) {
46
+ activeTransaction = customStartTransaction({
47
+ name: initPathName,
48
+ op: 'pageload',
49
+ tags: SENTRY_TAGS,
50
+ });
51
+ }
52
+
53
+ _useEffect = useEffect;
54
+ _useLocation = useLocation;
55
+ _useNavigationType = useNavigationType;
56
+ _matchRoutes = matchRoutes;
57
+ _createRoutesFromChildren = createRoutesFromChildren;
58
+
59
+ _customStartTransaction = customStartTransaction;
60
+ _startTransactionOnLocationChange = startTransactionOnLocationChange;
61
+ };
62
+ }
63
+
64
+ var getTransactionName = (routes, location, matchRoutes) => {
65
+ if (!routes || routes.length === 0 || !matchRoutes) {
66
+ return location.pathname;
67
+ }
68
+
69
+ var branches = matchRoutes(routes, location);
70
+
71
+ if (branches) {
72
+ for (let x = 0; x < branches.length; x++) {
73
+ if (branches[x].route && branches[x].route.path && branches[x].pathname === location.pathname) {
74
+ return branches[x].route.path || location.pathname;
75
+ }
76
+ }
77
+ }
78
+
79
+ return location.pathname;
80
+ };
81
+
82
+ function withSentryReactRouterV6Routing(Routes) {
83
+ if (
84
+ !_useEffect ||
85
+ !_useLocation ||
86
+ !_useNavigationType ||
87
+ !_createRoutesFromChildren ||
88
+ !_matchRoutes ||
89
+ !_customStartTransaction
90
+ ) {
91
+ IS_DEBUG_BUILD &&
92
+ logger.warn('reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.');
93
+
94
+ return Routes;
95
+ }
96
+
97
+ let isBaseLocation = false;
98
+ let routes;
99
+
100
+ var SentryRoutes = (props) => {
101
+ var location = _useLocation();
102
+ var navigationType = _useNavigationType();
103
+
104
+ _useEffect(() => {
105
+ // Performance concern:
106
+ // This is repeated when <Routes /> is rendered.
107
+ routes = _createRoutesFromChildren(props.children);
108
+ isBaseLocation = true;
109
+
110
+ if (activeTransaction) {
111
+ activeTransaction.setName(getTransactionName(routes, location, _matchRoutes));
112
+ }
113
+
114
+ }, [props.children]);
115
+
116
+ _useEffect(() => {
117
+ if (isBaseLocation) {
118
+ if (activeTransaction) {
119
+ activeTransaction.finish();
120
+ }
121
+
122
+ return;
123
+ }
124
+
125
+ if (_startTransactionOnLocationChange && (navigationType === 'PUSH' || navigationType === 'POP')) {
126
+ if (activeTransaction) {
127
+ activeTransaction.finish();
128
+ }
129
+
130
+ activeTransaction = _customStartTransaction({
131
+ name: getTransactionName(routes, location, _matchRoutes),
132
+ op: 'navigation',
133
+ tags: SENTRY_TAGS,
134
+ });
135
+ }
136
+ }, [props.children, location, navigationType, isBaseLocation]);
137
+
138
+ isBaseLocation = false;
139
+
140
+ // @ts-ignore Setting more specific React Component typing for `R` generic above
141
+ // will break advanced type inference done by react router params
142
+ return React__default.createElement(Routes, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 172}} );
143
+ };
144
+
145
+ hoistNonReactStatics(SentryRoutes, Routes);
146
+
147
+ // @ts-ignore Setting more specific React Component typing for `R` generic above
148
+ // will break advanced type inference done by react router params
149
+ return SentryRoutes;
150
+ }
151
+
152
+ export { reactRouterV6Instrumentation, withSentryReactRouterV6Routing };
153
+ //# sourceMappingURL=reactrouterv6.js.map
@@ -0,0 +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 } from '@sentry/types';\nimport { getGlobalObject, logger } from '@sentry/utils';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport React from 'react';\n\nimport { IS_DEBUG_BUILD } from './flags';\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\ninterface RouteMatch<ParamKey extends string = string> {\n params: Params<ParamKey>;\n pathname: string;\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\nfunction getInitPathName(): string | undefined {\n if (global && global.location) {\n return global.location.pathname;\n }\n\n return undefined;\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 = getInitPathName();\n if (startTransactionOnPageLoad && initPathName) {\n activeTransaction = customStartTransaction({\n name: initPathName,\n op: 'pageload',\n tags: SENTRY_TAGS,\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\nconst getTransactionName = (routes: RouteObject[], location: Location, matchRoutes: MatchRoutes): string => {\n if (!routes || routes.length === 0 || !matchRoutes) {\n return location.pathname;\n }\n\n const branches = matchRoutes(routes, location);\n\n if (branches) {\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let x = 0; x < branches.length; x++) {\n if (branches[x].route && branches[x].route.path && branches[x].pathname === location.pathname) {\n return branches[x].route.path || location.pathname;\n }\n }\n }\n\n return location.pathname;\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 IS_DEBUG_BUILD &&\n logger.warn('reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.');\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 if (activeTransaction) {\n activeTransaction.setName(getTransactionName(routes, location, _matchRoutes));\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.children]);\n\n _useEffect(() => {\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 activeTransaction = _customStartTransaction({\n name: getTransactionName(routes, location, _matchRoutes),\n op: 'navigation',\n tags: SENTRY_TAGS,\n });\n }\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"],"names":[],"mappings":";;;;;AAAA;;AAmCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;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;AAEA;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;;;;"}
package/esm/redux.js CHANGED
@@ -1,55 +1,63 @@
1
- import { __assign } from "tslib";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { configureScope } from '@sentry/minimal';
1
+ import { configureScope } from '@sentry/browser';
2
+
4
3
  var ACTION_BREADCRUMB_CATEGORY = 'redux.action';
5
4
  var ACTION_BREADCRUMB_TYPE = 'info';
6
5
  var STATE_CONTEXT_KEY = 'redux.state';
6
+
7
7
  var defaultOptions = {
8
- actionTransformer: function (action) { return action; },
9
- stateTransformer: function (state) { return state || null; },
8
+ actionTransformer: action => action,
9
+ stateTransformer: state => state || null,
10
10
  };
11
+
11
12
  /**
12
13
  * Creates an enhancer that would be passed to Redux's createStore to log actions and the latest state to Sentry.
13
14
  *
14
15
  * @param enhancerOptions Options to pass to the enhancer
15
16
  */
16
17
  function createReduxEnhancer(enhancerOptions) {
17
- // Note: We return an any type as to not have type conflicts.
18
- var options = __assign(__assign({}, defaultOptions), enhancerOptions);
19
- return function (next) {
20
- return function (reducer, initialState) {
21
- var sentryReducer = function (state, action) {
22
- var newState = reducer(state, action);
23
- configureScope(function (scope) {
24
- /* Action breadcrumbs */
25
- var transformedAction = options.actionTransformer(action);
26
- if (typeof transformedAction !== 'undefined' && transformedAction !== null) {
27
- scope.addBreadcrumb({
28
- category: ACTION_BREADCRUMB_CATEGORY,
29
- data: transformedAction,
30
- type: ACTION_BREADCRUMB_TYPE,
31
- });
32
- }
33
- /* Set latest state to scope */
34
- var transformedState = options.stateTransformer(newState);
35
- if (typeof transformedState !== 'undefined' && transformedState !== null) {
36
- scope.setContext(STATE_CONTEXT_KEY, transformedState);
37
- }
38
- else {
39
- scope.setContext(STATE_CONTEXT_KEY, null);
40
- }
41
- /* Allow user to configure scope with latest state */
42
- // eslint-disable-next-line @typescript-eslint/unbound-method
43
- var configureScopeWithState = options.configureScopeWithState;
44
- if (typeof configureScopeWithState === 'function') {
45
- configureScopeWithState(scope, newState);
46
- }
47
- });
48
- return newState;
49
- };
50
- return next(sentryReducer, initialState);
51
- };
18
+ // Note: We return an any type as to not have type conflicts.
19
+ var options = {
20
+ ...defaultOptions,
21
+ ...enhancerOptions,
22
+ };
23
+
24
+ return (next) =>
25
+ (reducer, initialState) => {
26
+ var sentryReducer = (state, action) => {
27
+ var newState = reducer(state, action);
28
+
29
+ configureScope(scope => {
30
+ /* Action breadcrumbs */
31
+ var transformedAction = options.actionTransformer(action);
32
+ if (typeof transformedAction !== 'undefined' && transformedAction !== null) {
33
+ scope.addBreadcrumb({
34
+ category: ACTION_BREADCRUMB_CATEGORY,
35
+ data: transformedAction,
36
+ type: ACTION_BREADCRUMB_TYPE,
37
+ });
38
+ }
39
+
40
+ /* Set latest state to scope */
41
+ var transformedState = options.stateTransformer(newState);
42
+ if (typeof transformedState !== 'undefined' && transformedState !== null) {
43
+ scope.setContext(STATE_CONTEXT_KEY, transformedState);
44
+ } else {
45
+ scope.setContext(STATE_CONTEXT_KEY, null);
46
+ }
47
+
48
+ /* Allow user to configure scope with latest state */
49
+ const { configureScopeWithState } = options;
50
+ if (typeof configureScopeWithState === 'function') {
51
+ configureScopeWithState(scope, newState);
52
+ }
53
+ });
54
+
55
+ return newState;
56
+ };
57
+
58
+ return next(sentryReducer, initialState);
52
59
  };
53
60
  }
61
+
54
62
  export { createReduxEnhancer };
55
- //# sourceMappingURL=redux.js.map
63
+ //# sourceMappingURL=redux.js.map
package/esm/redux.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"redux.js","sourceRoot":"","sources":["../../src/redux.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,EAAE,cAAc,EAA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AiB,EAAE,IAAI,CAAC,CAAC;qBAC3C;oBAED,qDAAqD;oBACrD,6DAA6D;oBACrD,IAAA,yDAAuB,CAAa;oBAC5C,IAAI,OAAO,uBAAuB,KAAK,UAAU,EAAE;wBACjD,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;qBAC1C;gBACH,CAAC,CAAC,CAAC;gBAEH,OAAO,QAAQ,CAAC;YAClB,CAAC,CAAC;YAEF,OAAO,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QAC3C,CAAC;IAnCD,CAmCC,CAAC;AACN,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { configureScope } from '@sentry/minimal';\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';\nconst STATE_CONTEXT_KEY = 'redux.state';\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_CONTEXT_KEY, transformedState);\n } else {\n scope.setContext(STATE_CONTEXT_KEY, 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"]}
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';\nconst STATE_CONTEXT_KEY = 'redux.state';\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_CONTEXT_KEY, transformedState);\n } else {\n scope.setContext(STATE_CONTEXT_KEY, 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":";;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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
package/esm/sdk.js CHANGED
@@ -1,19 +1,22 @@
1
- import { init as browserInit, SDK_VERSION } from '@sentry/browser';
1
+ import { SDK_VERSION, init as init$1 } from '@sentry/browser';
2
+
2
3
  /**
3
4
  * Inits the React SDK
4
5
  */
5
- export function init(options) {
6
- options._metadata = options._metadata || {};
7
- options._metadata.sdk = options._metadata.sdk || {
8
- name: 'sentry.javascript.react',
9
- packages: [
10
- {
11
- name: 'npm:@sentry/react',
12
- version: SDK_VERSION,
13
- },
14
- ],
6
+ function init(options) {
7
+ options._metadata = options._metadata || {};
8
+ options._metadata.sdk = options._metadata.sdk || {
9
+ name: 'sentry.javascript.react',
10
+ packages: [
11
+ {
12
+ name: 'npm:@sentry/react',
15
13
  version: SDK_VERSION,
16
- };
17
- browserInit(options);
14
+ },
15
+ ],
16
+ version: SDK_VERSION,
17
+ };
18
+ init$1(options);
18
19
  }
19
- //# sourceMappingURL=sdk.js.map
20
+
21
+ export { init };
22
+ //# sourceMappingURL=sdk.js.map
package/esm/sdk.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,IAAI,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnF;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,OAAuB;IAC1C,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAC5C,OAAO,CAAC,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;QAC/C,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,mBAAmB;gBACzB,OAAO,EAAE,WAAW;aACrB;SACF;QACD,OAAO,EAAE,WAAW;KACrB,CAAC;IACF,WAAW,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC","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"]}
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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/react",
3
- "version": "7.0.0-alpha.1",
3
+ "version": "7.0.0-beta.2",
4
4
  "description": "Official Sentry SDK for React.js",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/react",
@@ -16,10 +16,9 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {
19
- "@sentry/browser": "7.0.0-alpha.1",
20
- "@sentry/minimal": "7.0.0-alpha.1",
21
- "@sentry/types": "7.0.0-alpha.1",
22
- "@sentry/utils": "7.0.0-alpha.1",
19
+ "@sentry/browser": "7.0.0-beta.2",
20
+ "@sentry/types": "7.0.0-beta.2",
21
+ "@sentry/utils": "7.0.0-beta.2",
23
22
  "hoist-non-react-statics": "^3.3.2",
24
23
  "tslib": "^1.9.3"
25
24
  },
@@ -45,6 +44,7 @@
45
44
  "react-router-3": "npm:react-router@3.2.0",
46
45
  "react-router-4": "npm:react-router@4.1.0",
47
46
  "react-router-5": "npm:react-router@5.0.0",
47
+ "react-router-6": "npm:react-router@6.3.0",
48
48
  "redux": "^4.0.5"
49
49
  },
50
50
  "sideEffects": false
@@ -9,6 +9,7 @@ export declare type FallbackRender = (errorData: {
9
9
  resetError(): void;
10
10
  }) => React.ReactElement;
11
11
  export declare type ErrorBoundaryProps = {
12
+ children?: React.ReactNode | (() => React.ReactNode);
12
13
  /** If a Sentry report dialog should be rendered on error */
13
14
  showDialog?: boolean;
14
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"errorboundary.d.ts","sourceRoot":"","sources":["../../src/errorboundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,mBAAmB,EAAE,KAAK,EAA+B,MAAM,iBAAiB,CAAC;AAG5G,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED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AACH,cAAM,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAC1E,KAAK,EAAE,kBAAkB,CAAiB;IAE1C,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG;QAAE,KAAK,CAAC,EAAE,KAAK,CAAA;KAAE,EAAE,EAAE,cAAc,EAAE,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IAiC9F,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAQ5B,kBAAkB,EAAE,MAAM,IAAI,CAOnC;IAEK,MAAM,IAAI,KAAK,CAAC,SAAS;CA6BjC;AAGD,iBAAS,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtD,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACxC,oBAAoB,EAAE,kBAAkB,GACvC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAiBb;AAED,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC"}
package/types/index.d.ts CHANGED
@@ -5,4 +5,5 @@ export { ErrorBoundary, withErrorBoundary } from './errorboundary';
5
5
  export { createReduxEnhancer } from './redux';
6
6
  export { reactRouterV3Instrumentation } from './reactrouterv3';
7
7
  export { reactRouterV4Instrumentation, reactRouterV5Instrumentation, withSentryRouting } from './reactrouter';
8
+ export { reactRouterV6Instrumentation, withSentryReactRouterV6Routing } from './reactrouterv6';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC9G,OAAO,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Transaction, TransactionContext } from '@sentry/types';
2
+ import React from 'react';
3
+ import { Action, Location } from './types';
4
+ interface RouteObject {
5
+ caseSensitive?: boolean;
6
+ children?: RouteObject[];
7
+ element?: React.ReactNode;
8
+ index?: boolean;
9
+ path?: string;
10
+ }
11
+ declare type Params<Key extends string = string> = {
12
+ readonly [key in Key]: string | undefined;
13
+ };
14
+ interface RouteMatch<ParamKey extends string = string> {
15
+ params: Params<ParamKey>;
16
+ pathname: string;
17
+ route: RouteObject;
18
+ }
19
+ declare type UseEffect = (cb: () => void, deps: unknown[]) => void;
20
+ declare type UseLocation = () => Location;
21
+ declare type UseNavigationType = () => Action;
22
+ declare type CreateRoutesFromChildren = (children: JSX.Element[]) => RouteObject[];
23
+ declare type MatchRoutes = (routes: RouteObject[], location: Location) => RouteMatch[] | null;
24
+ export declare function reactRouterV6Instrumentation(useEffect: UseEffect, useLocation: UseLocation, useNavigationType: UseNavigationType, createRoutesFromChildren: CreateRoutesFromChildren, matchRoutes: MatchRoutes): (customStartTransaction: (context: TransactionContext) => Transaction | undefined, startTransactionOnPageLoad?: boolean, startTransactionOnLocationChange?: boolean) => void;
25
+ export declare function withSentryReactRouterV6Routing<P extends Record<string, any>, R extends React.FC<P>>(Routes: R): R;
26
+ export {};
27
+ //# sourceMappingURL=reactrouterv6.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactrouterv6.d.ts","sourceRoot":"","sources":["../../src/reactrouterv6.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGhE,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE3C,UAAU,WAAW;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,aAAK,MAAM,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI;IACzC,QAAQ,EAAE,GAAG,IAAI,GAAG,GAAG,MAAM,GAAG,SAAS;CAC1C,CAAC;AAEF,UAAU,UAAU,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IACnD,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,CAAC;CACpB;AAED,aAAK,SAAS,GAAG,CAAC,EAAE,EAAE,MAAM,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;AAC3D,aAAK,WAAW,GAAG,MAAM,QAAQ,CAAC;AAClC,aAAK,iBAAiB,GAAG,MAAM,MAAM,CAAC;AACtC,aAAK,wBAAwB,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,WAAW,EAAE,CAAC;AAC3E,aAAK,WAAW,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,QAAQ,KAAK,UAAU,EAAE,GAAG,IAAI,CAAC;AA0BtF,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,wBAAwB,EAAE,wBAAwB,EAClD,WAAW,EAAE,WAAW,gLAyBzB;AAqBD,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAqEjH"}
@@ -1,4 +0,0 @@
1
- export declare const REACT_RENDER_OP = "ui.react.render";
2
- export declare const REACT_UPDATE_OP = "ui.react.update";
3
- export declare const REACT_MOUNT_OP = "ui.react.mount";
4
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD,eAAO,MAAM,cAAc,mBAAmB,CAAC"}
@@ -1,62 +0,0 @@
1
- import { ReportDialogOptions, Scope } from '@sentry/browser';
2
- import * as React from 'react';
3
- export declare function isAtLeastReact17(version: string): boolean;
4
- export declare const UNKNOWN_COMPONENT = "unknown";
5
- export declare type FallbackRender = (errorData: {
6
- error: Error;
7
- componentStack: string | null;
8
- eventId: string | null;
9
- resetError(): void;
10
- }) => React.ReactElement;
11
- export declare type ErrorBoundaryProps = {
12
- /** If a Sentry report dialog should be rendered on error */
13
- showDialog?: boolean;
14
- /**
15
- * Options to be passed into the Sentry report dialog.
16
- * No-op if {@link showDialog} is false.
17
- */
18
- dialogOptions?: ReportDialogOptions;
19
- /**
20
- * A fallback component that gets rendered when the error boundary encounters an error.
21
- *
22
- * Can either provide a React Component, or a function that returns React Component as
23
- * a valid fallback prop. If a function is provided, the function will be called with
24
- * the error, the component stack, and an function that resets the error boundary on error.
25
- *
26
- */
27
- fallback?: React.ReactElement | FallbackRender;
28
- /** Called when the error boundary encounters an error */
29
- onError?(error: Error, componentStack: string, eventId: string): void;
30
- /** Called on componentDidMount() */
31
- onMount?(): void;
32
- /** Called if resetError() is called from the fallback render props function */
33
- onReset?(error: Error | null, componentStack: string | null, eventId: string | null): void;
34
- /** Called on componentWillUnmount() */
35
- onUnmount?(error: Error | null, componentStack: string | null, eventId: string | null): void;
36
- /** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */
37
- beforeCapture?(scope: Scope, error: Error | null, componentStack: string | null): void;
38
- };
39
- declare type ErrorBoundaryState = {
40
- componentStack: React.ErrorInfo['componentStack'] | null;
41
- error: Error | null;
42
- eventId: string | null;
43
- };
44
- /**
45
- * A ErrorBoundary component that logs errors to Sentry. Requires React >= 16.
46
- * NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the
47
- * Sentry React SDK ErrorBoundary caught an error invoking your application code. This
48
- * is expected behavior and NOT indicative of a bug with the Sentry React SDK.
49
- */
50
- declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
51
- state: ErrorBoundaryState;
52
- componentDidCatch(error: Error & {
53
- cause?: Error;
54
- }, { componentStack }: React.ErrorInfo): void;
55
- componentDidMount(): void;
56
- componentWillUnmount(): void;
57
- resetErrorBoundary: () => void;
58
- render(): React.ReactNode;
59
- }
60
- declare function withErrorBoundary<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>, errorBoundaryOptions: ErrorBoundaryProps): React.FC<P>;
61
- export { ErrorBoundary, withErrorBoundary };
62
- //# sourceMappingURL=errorboundary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorboundary.d.ts","sourceRoot":"","sources":["../../src/errorboundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,mBAAmB,EAAE,KAAK,EAA+B,MAAM,iBAAiB,CAAC;AAG5G,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,oBAAY,cAAc,GAAG,CAAC,SAAS,EAAE;IACvC,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,IAAI,IAAI,CAAC;CACpB,KAAK,KAAK,CAAC,YAAY,CAAC;AAEzB,oBAAY,kBAAkB,GAAG;IAC/B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,cAAc,CAAC;IAC/C,yDAAyD;IACzD,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACtE,oCAAoC;IACpC,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB,gFAAgF;IAChF,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAC3F,uCAAuC;IACvC,SAAS,CAAC,CAAC,KAAK,EAAE,K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EBUG_BUILD: boolean;
3
- //# sourceMappingURL=flags.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/flags.ts"],"names":[],"mappings":"AAgBA,2DAA2D;AAC3D,eAAO,MAAM,cAAc,SAAoE,CAAC"}
package/cjs/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from '@sentry/browser';
2
- export { init } from './sdk';
3
- export { Profiler, withProfiler, useProfiler } from './profiler';
4
- export { ErrorBoundary, withErrorBoundary } from './errorboundary';
5
- export { createReduxEnhancer } from './redux';
6
- export { reactRouterV3Instrumentation } from './reactrouterv3';
7
- export { reactRouterV4Instrumentation, reactRouterV5Instrumentation, withSentryRouting } from './reactrouter';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
package/cjs/profiler.d.ts DELETED
@@ -1,54 +0,0 @@
1
- import { Hub } from '@sentry/browser';
2
- import { Span, Transaction } from '@sentry/types';
3
- import * as React from 'react';
4
- export declare const UNKNOWN_COMPONENT = "unknown";
5
- export declare type ProfilerProps = {
6
- name: string;
7
- disabled?: boolean;
8
- includeRender?: boolean;
9
- includeUpdates?: boolean;
10
- updateProps: {
11
- [key: string]: unknown;
12
- };
13
- };
14
- /**
15
- * The Profiler component leverages Sentry's Tracing integration to generate
16
- * spans based on component lifecycles.
17
- */
18
- declare class Profiler extends React.Component<ProfilerProps> {
19
- /**
20
- * The span of the mount activity
21
- * Made protected for the React Native SDK to access
22
- */
23
- protected _mountSpan: Span | undefined;
24
- static defaultProps: Partial<ProfilerProps>;
25
- constructor(props: ProfilerProps);
26
- componentDidMount(): void;
27
- componentDidUpdate({ updateProps, includeUpdates }: ProfilerProps): void;
28
- componentWillUnmount(): void;
29
- render(): React.ReactNode;
30
- }
31
- /**
32
- * withProfiler is a higher order component that wraps a
33
- * component in a {@link Profiler} component. It is recommended that
34
- * the higher order component be used over the regular {@link Profiler} component.
35
- *
36
- * @param WrappedComponent component that is wrapped by Profiler
37
- * @param options the {@link ProfilerProps} you can pass into the Profiler
38
- */
39
- declare function withProfiler<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>, options?: Pick<Partial<ProfilerProps>, Exclude<keyof ProfilerProps, 'updateProps'>>): React.FC<P>;
40
- /**
41
- *
42
- * `useProfiler` is a React hook that profiles a React component.
43
- *
44
- * Requires React 16.8 or above.
45
- * @param name displayName of component being profiled
46
- */
47
- declare function useProfiler(name: string, options?: {
48
- disabled?: boolean;
49
- hasRenderSpan?: boolean;
50
- }): void;
51
- export { withProfiler, Profiler, useProfiler };
52
- /** Grabs active transaction off scope */
53
- export declare function getActiveTransaction<T extends Transaction>(hub?: Hub): T | undefined;
54
- //# sourceMappingURL=profiler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,oBAAY,aAAa,GAAG;IA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SAAS,WAAW,EAAE,GAAG,GAAE,GAAqB,GAAG,CAAC,GAAG,SAAS,CASrG"}
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- import { Action, Location, ReactRouterInstrumentation } from './types';
3
- declare type Match = {
4
- path: string;
5
- url: string;
6
- params: Record<string, any>;
7
- isExact: boolean;
8
- };
9
- export declare type RouterHistory = {
10
- location?: Location;
11
- listen?(cb: (location: Location, action: Action) => void): void;
12
- } & Record<string, any>;
13
- export declare type RouteConfig = {
14
- [propName: string]: any;
15
- path?: string | string[];
16
- exact?: boolean;
17
- component?: JSX.Element;
18
- routes?: RouteConfig[];
19
- };
20
- declare type MatchPath = (pathname: string, props: string | string[] | any, parent?: Match | null) => Match | null;
21
- export declare function reactRouterV4Instrumentation(history: RouterHistory, routes?: RouteConfig[], matchPath?: MatchPath): ReactRouterInstrumentation;
22
- export declare function reactRouterV5Instrumentation(history: RouterHistory, routes?: RouteConfig[], matchPath?: MatchPath): ReactRouterInstrumentation;
23
- export declare function withSentryRouting<P extends Record<string, any>, R extends React.ComponentType<P>>(Route: R): R;
24
- export {};
25
- //# sourceMappingURL=reactrouter.d.ts.map