@sentry/react 8.53.0 → 9.0.0-alpha.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/build/cjs/constants.js +1 -1
- package/build/cjs/debug-build.js +1 -1
- package/build/cjs/error.js +1 -1
- package/build/cjs/errorboundary.js +46 -56
- package/build/cjs/errorboundary.js.map +1 -1
- package/build/cjs/index.js +1 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/profiler.js +19 -34
- package/build/cjs/profiler.js.map +1 -1
- package/build/cjs/reactrouter.js +6 -23
- package/build/cjs/reactrouter.js.map +1 -1
- package/build/cjs/reactrouterv3.js +3 -3
- package/build/cjs/reactrouterv3.js.map +1 -1
- package/build/cjs/reactrouterv6-compat-utils.js +24 -36
- package/build/cjs/reactrouterv6-compat-utils.js.map +1 -1
- package/build/cjs/reactrouterv6.js +1 -15
- package/build/cjs/reactrouterv6.js.map +1 -1
- package/build/cjs/reactrouterv7.js +1 -1
- package/build/cjs/redux.js +3 -3
- package/build/cjs/redux.js.map +1 -1
- package/build/cjs/sdk.js +1 -1
- package/build/cjs/tanstackrouter.js +3 -4
- package/build/cjs/tanstackrouter.js.map +1 -1
- package/build/esm/errorboundary.js +41 -34
- package/build/esm/errorboundary.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/profiler.js +12 -10
- package/build/esm/profiler.js.map +1 -1
- package/build/esm/reactrouter.js +3 -3
- package/build/esm/reactrouter.js.map +1 -1
- package/build/esm/reactrouterv3.js +2 -2
- package/build/esm/reactrouterv3.js.map +1 -1
- package/build/esm/reactrouterv6-compat-utils.js +18 -14
- package/build/esm/reactrouterv6-compat-utils.js.map +1 -1
- package/build/esm/reactrouterv6.js +1 -13
- package/build/esm/reactrouterv6.js.map +1 -1
- package/build/esm/redux.js +2 -2
- package/build/esm/redux.js.map +1 -1
- package/build/esm/tanstackrouter.js +2 -3
- package/build/esm/tanstackrouter.js.map +1 -1
- package/build/types/errorboundary.d.ts +19 -7
- package/build/types/errorboundary.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/profiler.d.ts +0 -1
- package/build/types/profiler.d.ts.map +1 -1
- package/build/types/reactrouterv6-compat-utils.d.ts +4 -0
- package/build/types/reactrouterv6-compat-utils.d.ts.map +1 -1
- package/build/types/reactrouterv6.d.ts +0 -10
- package/build/types/reactrouterv6.d.ts.map +1 -1
- package/build/types/tanstackrouter.d.ts +1 -1
- package/build/types/tanstackrouter.d.ts.map +1 -1
- package/build/types/vendor/tanstackrouter-types.d.ts +1 -1
- package/build/types/vendor/tanstackrouter-types.d.ts.map +1 -1
- package/build/types-ts3.8/errorboundary.d.ts +19 -7
- package/build/types-ts3.8/index.d.ts +1 -1
- package/build/types-ts3.8/profiler.d.ts +0 -1
- package/build/types-ts3.8/reactrouterv6-compat-utils.d.ts +4 -0
- package/build/types-ts3.8/reactrouterv6.d.ts +0 -10
- package/build/types-ts3.8/tanstackrouter.d.ts +1 -1
- package/build/types-ts3.8/vendor/tanstackrouter-types.d.ts +1 -1
- package/package.json +7 -8
|
@@ -8,6 +8,10 @@ export type FallbackRender = (errorData: {
|
|
|
8
8
|
eventId: string;
|
|
9
9
|
resetError(): void;
|
|
10
10
|
}) => React.ReactElement;
|
|
11
|
+
type OnUnmountType = {
|
|
12
|
+
(error: null, componentStack: null, eventId: null): void;
|
|
13
|
+
(error: unknown, componentStack: string, eventId: string): void;
|
|
14
|
+
};
|
|
11
15
|
export type ErrorBoundaryProps = {
|
|
12
16
|
children?: React.ReactNode | (() => React.ReactNode);
|
|
13
17
|
/** If a Sentry report dialog should be rendered on error */
|
|
@@ -33,15 +37,23 @@ export type ErrorBoundaryProps = {
|
|
|
33
37
|
*/
|
|
34
38
|
handled?: boolean | undefined;
|
|
35
39
|
/** Called when the error boundary encounters an error */
|
|
36
|
-
onError?: ((error: unknown, componentStack: string
|
|
40
|
+
onError?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;
|
|
37
41
|
/** Called on componentDidMount() */
|
|
38
42
|
onMount?: (() => void) | undefined;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Called when the error boundary resets due to a reset call from the
|
|
45
|
+
* fallback render props function.
|
|
46
|
+
*/
|
|
47
|
+
onReset?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Called on componentWillUnmount() with the error, componentStack, and eventId.
|
|
50
|
+
*
|
|
51
|
+
* If the error boundary never encountered an error, the error
|
|
52
|
+
* componentStack, and eventId will be null.
|
|
53
|
+
*/
|
|
54
|
+
onUnmount?: OnUnmountType | undefined;
|
|
43
55
|
/** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */
|
|
44
|
-
beforeCapture?: ((scope: Scope, error: unknown, componentStack: string
|
|
56
|
+
beforeCapture?: ((scope: Scope, error: unknown, componentStack: string) => void) | undefined;
|
|
45
57
|
};
|
|
46
58
|
type ErrorBoundaryState = {
|
|
47
59
|
componentStack: null;
|
|
@@ -67,7 +79,7 @@ declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBou
|
|
|
67
79
|
componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void;
|
|
68
80
|
componentDidMount(): void;
|
|
69
81
|
componentWillUnmount(): void;
|
|
70
|
-
resetErrorBoundary
|
|
82
|
+
resetErrorBoundary(): void;
|
|
71
83
|
render(): React.ReactNode;
|
|
72
84
|
}
|
|
73
85
|
declare function withErrorBoundary<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>, errorBoundaryOptions: ErrorBoundaryProps): React.FC<P>;
|
|
@@ -8,6 +8,6 @@ export { createReduxEnhancer } from './redux';
|
|
|
8
8
|
export { reactRouterV3BrowserTracingIntegration } from './reactrouterv3';
|
|
9
9
|
export { tanstackRouterBrowserTracingIntegration } from './tanstackrouter';
|
|
10
10
|
export { withSentryRouting, reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, } from './reactrouter';
|
|
11
|
-
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing,
|
|
11
|
+
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapUseRoutesV6, wrapCreateBrowserRouterV6, wrapCreateMemoryRouterV6, } from './reactrouterv6';
|
|
12
12
|
export { reactRouterV7BrowserTracingIntegration, withSentryReactRouterV7Routing, wrapCreateBrowserRouterV7, wrapCreateMemoryRouterV7, wrapUseRoutesV7, } from './reactrouterv7';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -25,7 +25,6 @@ declare class Profiler extends React.Component<ProfilerProps> {
|
|
|
25
25
|
* The span that represents the duration of time between shouldComponentUpdate and componentDidUpdate
|
|
26
26
|
*/
|
|
27
27
|
protected _updateSpan: Span | undefined;
|
|
28
|
-
static defaultProps: Partial<ProfilerProps>;
|
|
29
28
|
constructor(props: ProfilerProps);
|
|
30
29
|
componentDidMount(): void;
|
|
31
30
|
shouldComponentUpdate({ updateProps, includeUpdates }: ProfilerProps): boolean;
|
|
@@ -34,5 +34,9 @@ export declare function handleNavigation(opts: {
|
|
|
34
34
|
allRoutes?: RouteObject[];
|
|
35
35
|
}): void;
|
|
36
36
|
export declare function createV6CompatibleWithSentryReactRouterRouting<P extends Record<string, any>, R extends React.FC<P>>(Routes: R, version: V6CompatibleVersion): R;
|
|
37
|
+
/**
|
|
38
|
+
* Returns number of URL segments of a passed string URL.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getNumberOfUrlSegments(url: string): number;
|
|
37
41
|
export {};
|
|
38
42
|
//# sourceMappingURL=reactrouterv6-compat-utils.d.ts.map
|
|
@@ -13,21 +13,11 @@ export declare function reactRouterV6BrowserTracingIntegration(options: Paramete
|
|
|
13
13
|
* This is used to automatically capture route changes as transactions when using the useRoutes hook.
|
|
14
14
|
*/
|
|
15
15
|
export declare function wrapUseRoutesV6(origUseRoutes: UseRoutes): UseRoutes;
|
|
16
|
-
/**
|
|
17
|
-
* Alias for backwards compatibility
|
|
18
|
-
* @deprecated Use `wrapUseRoutesV6` or `wrapUseRoutesV7` instead.
|
|
19
|
-
*/
|
|
20
|
-
export declare const wrapUseRoutes: typeof wrapUseRoutesV6;
|
|
21
16
|
/**
|
|
22
17
|
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createBrowserRouter function.
|
|
23
18
|
* This is used to automatically capture route changes as transactions when using the createBrowserRouter API.
|
|
24
19
|
*/
|
|
25
20
|
export declare function wrapCreateBrowserRouterV6<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter>;
|
|
26
|
-
/**
|
|
27
|
-
* Alias for backwards compatibility
|
|
28
|
-
* @deprecated Use `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` instead.
|
|
29
|
-
*/
|
|
30
|
-
export declare const wrapCreateBrowserRouter: typeof wrapCreateBrowserRouterV6;
|
|
31
21
|
/**
|
|
32
22
|
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createMemoryRouter function.
|
|
33
23
|
* This is used to automatically capture route changes as transactions when using the createMemoryRouter API.
|
|
@@ -3,7 +3,7 @@ import { Integration } from '@sentry/core';
|
|
|
3
3
|
/**
|
|
4
4
|
* A custom browser tracing integration for TanStack Router.
|
|
5
5
|
*
|
|
6
|
-
* The minimum compatible version of `@tanstack/router` is `1.
|
|
6
|
+
* The minimum compatible version of `@tanstack/react-router` is `1.64.0`.
|
|
7
7
|
*
|
|
8
8
|
* @param router A TanStack Router `Router` instance that should be used for routing instrumentation.
|
|
9
9
|
* @param options Sentry browser tracing configuration.
|
|
@@ -10,7 +10,7 @@ export interface VendoredTanstackRouter {
|
|
|
10
10
|
}) => Array<VendoredTanstackRouterRouteMatch>;
|
|
11
11
|
subscribe(eventType: 'onResolved' | 'onBeforeNavigate', callback: (stateUpdate: {
|
|
12
12
|
toLocation: VendoredTanstackRouterLocation;
|
|
13
|
-
fromLocation
|
|
13
|
+
fromLocation: VendoredTanstackRouterLocation;
|
|
14
14
|
}) => void): () => void;
|
|
15
15
|
}
|
|
16
16
|
interface VendoredTanstackRouterLocation {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-alpha.0",
|
|
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",
|
|
7
7
|
"author": "Sentry",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=18"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"/build"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"typesVersions": {
|
|
32
|
-
"<
|
|
32
|
+
"<5.0": {
|
|
33
33
|
"build/types/index.d.ts": [
|
|
34
34
|
"build/types-ts3.8/index.d.ts"
|
|
35
35
|
]
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sentry/browser": "
|
|
43
|
-
"@sentry/core": "
|
|
42
|
+
"@sentry/browser": "9.0.0-alpha.0",
|
|
43
|
+
"@sentry/core": "9.0.0-alpha.0",
|
|
44
44
|
"hoist-non-react-statics": "^3.3.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -54,9 +54,8 @@
|
|
|
54
54
|
"@types/hoist-non-react-statics": "^3.3.5",
|
|
55
55
|
"@types/node-fetch": "^2.6.11",
|
|
56
56
|
"@types/react": "17.0.3",
|
|
57
|
-
"@types/react-router-
|
|
58
|
-
"@types/react-router-
|
|
59
|
-
"@types/react-router-5": "npm:@types/react-router@5.1.14",
|
|
57
|
+
"@types/react-router-4": "npm:@types/react-router@4.0.25",
|
|
58
|
+
"@types/react-router-5": "npm:@types/react-router@5.1.20",
|
|
60
59
|
"eslint-plugin-react": "^7.20.5",
|
|
61
60
|
"eslint-plugin-react-hooks": "^4.0.8",
|
|
62
61
|
"history-4": "npm:history@4.6.0",
|