@depup/sentry__react 10.44.0-depup.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 +21 -0
- package/README.md +25 -0
- package/build/cjs/constants.js +12 -0
- package/build/cjs/constants.js.map +1 -0
- package/build/cjs/debug-build.js +11 -0
- package/build/cjs/debug-build.js.map +1 -0
- package/build/cjs/error.js +113 -0
- package/build/cjs/error.js.map +1 -0
- package/build/cjs/errorboundary.js +170 -0
- package/build/cjs/errorboundary.js.map +1 -0
- package/build/cjs/hoist-non-react-statics.js +159 -0
- package/build/cjs/hoist-non-react-statics.js.map +1 -0
- package/build/cjs/index.js +51 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/profiler.js +226 -0
- package/build/cjs/profiler.js.map +1 -0
- package/build/cjs/reactrouter-compat-utils/instrumentation.js +1295 -0
- package/build/cjs/reactrouter-compat-utils/instrumentation.js.map +1 -0
- package/build/cjs/reactrouter-compat-utils/lazy-routes.js +160 -0
- package/build/cjs/reactrouter-compat-utils/lazy-routes.js.map +1 -0
- package/build/cjs/reactrouter-compat-utils/route-manifest.js +194 -0
- package/build/cjs/reactrouter-compat-utils/route-manifest.js.map +1 -0
- package/build/cjs/reactrouter-compat-utils/utils.js +336 -0
- package/build/cjs/reactrouter-compat-utils/utils.js.map +1 -0
- package/build/cjs/reactrouter.js +236 -0
- package/build/cjs/reactrouter.js.map +1 -0
- package/build/cjs/reactrouterv3.js +130 -0
- package/build/cjs/reactrouterv3.js.map +1 -0
- package/build/cjs/reactrouterv6.js +61 -0
- package/build/cjs/reactrouterv6.js.map +1 -0
- package/build/cjs/reactrouterv7.js +61 -0
- package/build/cjs/reactrouterv7.js.map +1 -0
- package/build/cjs/redux.js +106 -0
- package/build/cjs/redux.js.map +1 -0
- package/build/cjs/sdk.js +21 -0
- package/build/cjs/sdk.js.map +1 -0
- package/build/cjs/tanstackrouter.js +134 -0
- package/build/cjs/tanstackrouter.js.map +1 -0
- package/build/esm/constants.js +8 -0
- package/build/esm/constants.js.map +1 -0
- package/build/esm/debug-build.js +9 -0
- package/build/esm/debug-build.js.map +1 -0
- package/build/esm/error.js +108 -0
- package/build/esm/error.js.map +1 -0
- package/build/esm/errorboundary.js +166 -0
- package/build/esm/errorboundary.js.map +1 -0
- package/build/esm/hoist-non-react-statics.js +157 -0
- package/build/esm/hoist-non-react-statics.js.map +1 -0
- package/build/esm/index.js +12 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/profiler.js +221 -0
- package/build/esm/profiler.js.map +1 -0
- package/build/esm/reactrouter-compat-utils/instrumentation.js +1281 -0
- package/build/esm/reactrouter-compat-utils/instrumentation.js.map +1 -0
- package/build/esm/reactrouter-compat-utils/lazy-routes.js +156 -0
- package/build/esm/reactrouter-compat-utils/lazy-routes.js.map +1 -0
- package/build/esm/reactrouter-compat-utils/route-manifest.js +191 -0
- package/build/esm/reactrouter-compat-utils/route-manifest.js.map +1 -0
- package/build/esm/reactrouter-compat-utils/utils.js +320 -0
- package/build/esm/reactrouter-compat-utils/utils.js.map +1 -0
- package/build/esm/reactrouter.js +232 -0
- package/build/esm/reactrouter.js.map +1 -0
- package/build/esm/reactrouterv3.js +128 -0
- package/build/esm/reactrouterv3.js.map +1 -0
- package/build/esm/reactrouterv6.js +55 -0
- package/build/esm/reactrouterv6.js.map +1 -0
- package/build/esm/reactrouterv7.js +55 -0
- package/build/esm/reactrouterv7.js.map +1 -0
- package/build/esm/redux.js +104 -0
- package/build/esm/redux.js.map +1 -0
- package/build/esm/sdk.js +19 -0
- package/build/esm/sdk.js.map +1 -0
- package/build/esm/tanstackrouter.js +132 -0
- package/build/esm/tanstackrouter.js.map +1 -0
- package/build/types/constants.d.ts +4 -0
- package/build/types/constants.d.ts.map +1 -0
- package/build/types/debug-build.d.ts +7 -0
- package/build/types/debug-build.d.ts.map +1 -0
- package/build/types/error.d.ts +41 -0
- package/build/types/error.d.ts.map +1 -0
- package/build/types/errorboundary.d.ts +87 -0
- package/build/types/errorboundary.d.ts.map +1 -0
- package/build/types/hoist-non-react-statics.d.ts +21 -0
- package/build/types/hoist-non-react-statics.d.ts.map +1 -0
- package/build/types/index.d.ts +13 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/profiler.d.ts +56 -0
- package/build/types/profiler.d.ts.map +1 -0
- package/build/types/reactrouter-compat-utils/index.d.ts +5 -0
- package/build/types/reactrouter-compat-utils/index.d.ts.map +1 -0
- package/build/types/reactrouter-compat-utils/instrumentation.d.ts +117 -0
- package/build/types/reactrouter-compat-utils/instrumentation.d.ts.map +1 -0
- package/build/types/reactrouter-compat-utils/lazy-routes.d.ts +18 -0
- package/build/types/reactrouter-compat-utils/lazy-routes.d.ts.map +1 -0
- package/build/types/reactrouter-compat-utils/route-manifest.d.ts +13 -0
- package/build/types/reactrouter-compat-utils/route-manifest.d.ts.map +1 -0
- package/build/types/reactrouter-compat-utils/utils.d.ts +71 -0
- package/build/types/reactrouter-compat-utils/utils.d.ts.map +1 -0
- package/build/types/reactrouter.d.ts +41 -0
- package/build/types/reactrouter.d.ts.map +1 -0
- package/build/types/reactrouterv3.d.ts +29 -0
- package/build/types/reactrouterv3.d.ts.map +1 -0
- package/build/types/reactrouterv6.d.ts +32 -0
- package/build/types/reactrouterv6.d.ts.map +1 -0
- package/build/types/reactrouterv7.d.ts +32 -0
- package/build/types/reactrouterv7.d.ts.map +1 -0
- package/build/types/redux.d.ts +38 -0
- package/build/types/redux.d.ts.map +1 -0
- package/build/types/sdk.d.ts +7 -0
- package/build/types/sdk.d.ts.map +1 -0
- package/build/types/tanstackrouter.d.ts +13 -0
- package/build/types/tanstackrouter.d.ts.map +1 -0
- package/build/types/types.d.ts +163 -0
- package/build/types/types.d.ts.map +1 -0
- package/build/types/vendor/tanstackrouter-types.d.ts +36 -0
- package/build/types/vendor/tanstackrouter-types.d.ts.map +1 -0
- package/build/types-ts3.8/constants.d.ts +4 -0
- package/build/types-ts3.8/debug-build.d.ts +7 -0
- package/build/types-ts3.8/error.d.ts +41 -0
- package/build/types-ts3.8/errorboundary.d.ts +87 -0
- package/build/types-ts3.8/hoist-non-react-statics.d.ts +21 -0
- package/build/types-ts3.8/index.d.ts +13 -0
- package/build/types-ts3.8/profiler.d.ts +56 -0
- package/build/types-ts3.8/reactrouter-compat-utils/index.d.ts +5 -0
- package/build/types-ts3.8/reactrouter-compat-utils/instrumentation.d.ts +117 -0
- package/build/types-ts3.8/reactrouter-compat-utils/lazy-routes.d.ts +18 -0
- package/build/types-ts3.8/reactrouter-compat-utils/route-manifest.d.ts +13 -0
- package/build/types-ts3.8/reactrouter-compat-utils/utils.d.ts +77 -0
- package/build/types-ts3.8/reactrouter.d.ts +41 -0
- package/build/types-ts3.8/reactrouterv3.d.ts +29 -0
- package/build/types-ts3.8/reactrouterv6.d.ts +32 -0
- package/build/types-ts3.8/reactrouterv7.d.ts +32 -0
- package/build/types-ts3.8/redux.d.ts +38 -0
- package/build/types-ts3.8/sdk.d.ts +7 -0
- package/build/types-ts3.8/tanstackrouter.d.ts +13 -0
- package/build/types-ts3.8/types.d.ts +163 -0
- package/build/types-ts3.8/vendor/tanstackrouter-types.d.ts +36 -0
- package/changes.json +5 -0
- package/package.json +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAa,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAG9D;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAiB7E;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAEnC,KAAK,EAAE,GAAG,EACV,EAAE,cAAc,EAAE,EAAE,SAAS,EAC7B,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAC5C,MAAM,CAsBR;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAE/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAErE,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAW5C"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ReportDialogOptions } from '@sentry/browser';
|
|
2
|
+
import type { Scope } from '@sentry/core';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export declare const UNKNOWN_COMPONENT = "unknown";
|
|
5
|
+
export type FallbackRender = (errorData: {
|
|
6
|
+
error: unknown;
|
|
7
|
+
componentStack: string;
|
|
8
|
+
eventId: string;
|
|
9
|
+
resetError(): void;
|
|
10
|
+
}) => React.ReactElement;
|
|
11
|
+
type OnUnmountType = {
|
|
12
|
+
(error: null, componentStack: null, eventId: null): void;
|
|
13
|
+
(error: unknown, componentStack: string, eventId: string): void;
|
|
14
|
+
};
|
|
15
|
+
export type ErrorBoundaryProps = {
|
|
16
|
+
children?: React.ReactNode | (() => React.ReactNode);
|
|
17
|
+
/** If a Sentry report dialog should be rendered on error */
|
|
18
|
+
showDialog?: boolean | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Options to be passed into the Sentry report dialog.
|
|
21
|
+
* No-op if {@link showDialog} is false.
|
|
22
|
+
*/
|
|
23
|
+
dialogOptions?: ReportDialogOptions | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* A fallback component that gets rendered when the error boundary encounters an error.
|
|
26
|
+
*
|
|
27
|
+
* Can either provide a React Component, or a function that returns React Component as
|
|
28
|
+
* a valid fallback prop. If a function is provided, the function will be called with
|
|
29
|
+
* the error, the component stack, and an function that resets the error boundary on error.
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
fallback?: React.ReactElement | FallbackRender | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* If set to `true` or `false`, the error `handled` property will be set to the given value.
|
|
35
|
+
* If unset, the default behaviour is to rely on the presence of the `fallback` prop to determine
|
|
36
|
+
* if the error was handled or not.
|
|
37
|
+
*/
|
|
38
|
+
handled?: boolean | undefined;
|
|
39
|
+
/** Called when the error boundary encounters an error */
|
|
40
|
+
onError?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;
|
|
41
|
+
/** Called on componentDidMount() */
|
|
42
|
+
onMount?: (() => void) | undefined;
|
|
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;
|
|
55
|
+
/** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */
|
|
56
|
+
beforeCapture?: ((scope: Scope, error: unknown, componentStack: string) => void) | undefined;
|
|
57
|
+
};
|
|
58
|
+
type ErrorBoundaryState = {
|
|
59
|
+
componentStack: null;
|
|
60
|
+
error: null;
|
|
61
|
+
eventId: null;
|
|
62
|
+
} | {
|
|
63
|
+
componentStack: React.ErrorInfo['componentStack'];
|
|
64
|
+
error: unknown;
|
|
65
|
+
eventId: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A ErrorBoundary component that logs errors to Sentry.
|
|
69
|
+
* NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the
|
|
70
|
+
* Sentry React SDK ErrorBoundary caught an error invoking your application code. This
|
|
71
|
+
* is expected behavior and NOT indicative of a bug with the Sentry React SDK.
|
|
72
|
+
*/
|
|
73
|
+
declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
74
|
+
state: ErrorBoundaryState;
|
|
75
|
+
private readonly _openFallbackReportDialog;
|
|
76
|
+
private _lastEventId?;
|
|
77
|
+
private _cleanupHook?;
|
|
78
|
+
constructor(props: ErrorBoundaryProps);
|
|
79
|
+
componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void;
|
|
80
|
+
componentDidMount(): void;
|
|
81
|
+
componentWillUnmount(): void;
|
|
82
|
+
resetErrorBoundary(): void;
|
|
83
|
+
render(): React.ReactNode;
|
|
84
|
+
}
|
|
85
|
+
declare function withErrorBoundary<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>, errorBoundaryOptions: ErrorBoundaryProps): React.FC<P>;
|
|
86
|
+
export { ErrorBoundary, withErrorBoundary };
|
|
87
|
+
//# sourceMappingURL=errorboundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorboundary.d.ts","sourceRoot":"","sources":["../../src/errorboundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,IAAI,IAAI,CAAC;CACpB,KAAK,KAAK,CAAC,YAAY,CAAC;AAEzB,KAAK,aAAa,GAAG;IACnB,CAAC,KAAK,EAA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ACnB;IACE,cAAc,EAAE,IAAI,CAAC;IACrB,KAAK,EAAE,IAAI,CAAC;IACZ,OAAO,EAAE,IAAI,CAAC;CACf,GACD;IACE,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAClD,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAQN;;;;;GAKG;AACH,cAAM,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAC1E,KAAK,EAAE,kBAAkB,CAAC;IAEjC,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAU;IAEpD,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAC,CAAa;gBAEf,KAAK,EAAE,kBAAkB;IAiBrC,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI;IA6BnE,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAqB5B,kBAAkB,IAAI,IAAI;IAY1B,MAAM,IAAI,KAAK,CAAC,SAAS;CAgCjC;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,CAeb;AAED,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inlined implementation of hoist-non-react-statics
|
|
3
|
+
* Original library: https://github.com/mridgway/hoist-non-react-statics
|
|
4
|
+
* License: BSD-3-Clause
|
|
5
|
+
* Copyright 2015, Yahoo! Inc.
|
|
6
|
+
*
|
|
7
|
+
* This is an inlined version to avoid ESM compatibility issues with the original package.
|
|
8
|
+
*/
|
|
9
|
+
import type * as React from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* Copies non-react specific statics from a child component to a parent component.
|
|
12
|
+
* Similar to Object.assign, but copies all static properties from source to target,
|
|
13
|
+
* excluding React-specific statics and known JavaScript statics.
|
|
14
|
+
*
|
|
15
|
+
* @param targetComponent - The component to copy statics to
|
|
16
|
+
* @param sourceComponent - The component to copy statics from
|
|
17
|
+
* @param excludelist - An optional object of keys to exclude from hoisting
|
|
18
|
+
* @returns The target component with hoisted statics
|
|
19
|
+
*/
|
|
20
|
+
export declare function hoistNonReactStatics<T extends React.ComponentType<any>, S extends React.ComponentType<any>, C extends Record<string, boolean> = Record<string, never>>(targetComponent: T, sourceComponent: S, excludelist?: C): T;
|
|
21
|
+
//# sourceMappingURL=hoist-non-react-statics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hoist-non-react-statics.d.ts","sourceRoot":"","sources":["../../src/hoist-non-react-statics.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAmGpC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAElC,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAElC,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACzD,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,CA4C5D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from '@sentry/browser';
|
|
2
|
+
export { init } from './sdk';
|
|
3
|
+
export { captureReactException, reactErrorHandler } from './error';
|
|
4
|
+
export { Profiler, withProfiler, useProfiler } from './profiler';
|
|
5
|
+
export type { ErrorBoundaryProps, FallbackRender } from './errorboundary';
|
|
6
|
+
export { ErrorBoundary, withErrorBoundary } from './errorboundary';
|
|
7
|
+
export { createReduxEnhancer } from './redux';
|
|
8
|
+
export { reactRouterV3BrowserTracingIntegration } from './reactrouterv3';
|
|
9
|
+
export { tanstackRouterBrowserTracingIntegration } from './tanstackrouter';
|
|
10
|
+
export { withSentryRouting, reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, } from './reactrouter';
|
|
11
|
+
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapUseRoutesV6, wrapCreateBrowserRouterV6, wrapCreateMemoryRouterV6, } from './reactrouterv6';
|
|
12
|
+
export { reactRouterV7BrowserTracingIntegration, withSentryReactRouterV7Routing, wrapCreateBrowserRouterV7, wrapCreateMemoryRouterV7, wrapUseRoutesV7, } from './reactrouterv7';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,sCAAsC,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,uCAAuC,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,sCAAsC,EACtC,sCAAsC,GACvC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,eAAe,EACf,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,EACxB,eAAe,GAChB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Span } from '@sentry/core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare const UNKNOWN_COMPONENT = "unknown";
|
|
4
|
+
export type ProfilerProps = {
|
|
5
|
+
name: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
includeRender?: boolean;
|
|
8
|
+
includeUpdates?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
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
|
+
/**
|
|
25
|
+
* The span that represents the duration of time between shouldComponentUpdate and componentDidUpdate
|
|
26
|
+
*/
|
|
27
|
+
protected _updateSpan: Span | undefined;
|
|
28
|
+
constructor(props: ProfilerProps);
|
|
29
|
+
componentDidMount(): void;
|
|
30
|
+
shouldComponentUpdate({ updateProps, includeUpdates }: ProfilerProps): boolean;
|
|
31
|
+
componentDidUpdate(): void;
|
|
32
|
+
componentWillUnmount(): void;
|
|
33
|
+
render(): React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* withProfiler is a higher order component that wraps a
|
|
37
|
+
* component in a {@link Profiler} component. It is recommended that
|
|
38
|
+
* the higher order component be used over the regular {@link Profiler} component.
|
|
39
|
+
*
|
|
40
|
+
* @param WrappedComponent component that is wrapped by Profiler
|
|
41
|
+
* @param options the {@link ProfilerProps} you can pass into the Profiler
|
|
42
|
+
*/
|
|
43
|
+
declare function withProfiler<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>, options?: Pick<Partial<ProfilerProps>, Exclude<keyof ProfilerProps, 'updateProps' | 'children'>>): React.FC<P>;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* `useProfiler` is a React hook that profiles a React component.
|
|
47
|
+
*
|
|
48
|
+
* Requires React 16.8 or above.
|
|
49
|
+
* @param name displayName of component being profiled
|
|
50
|
+
*/
|
|
51
|
+
declare function useProfiler(name: string, options?: {
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
hasRenderSpan?: boolean;
|
|
54
|
+
}): void;
|
|
55
|
+
export { Profiler, useProfiler, withProfiler };
|
|
56
|
+
//# sourceMappingURL=profiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG;IAE1B,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,WAAW,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,cAAM,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,UAAU,EAAE,IAAI,GAAG,SAAS,CAAC;IACvC;;OAEG;IACH,SAAS,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;gBAErB,KAAK,EAAE,aAAa;IAoBhC,iBAAiB,IAAI,IAAI;IAMzB,qBAAqB,CAAC,EAAE,WAAW,EAAE,cAAqB,EAAE,EAAE,aAAa,GAAG,OAAO;IA6BrF,kBAAkB,IAAI,IAAI;IAS1B,oBAAoB,IAAI,IAAI;IA0B5B,MAAM,IAAI,KAAK,CAAC,SAAS;CAGjC;AAWD;;;;;;;GAOG;AAEH,iBAAS,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjD,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAExC,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,aAAa,EAAE,aAAa,GAAG,UAAU,CAAC,CAAC,GAC/F,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAgBb;AAED;;;;;;GAMG;AACH,iBAAS,WAAW,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAGrD,GACA,IAAI,CA+CN;AAED,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { ReactRouterOptions } from './instrumentation';
|
|
2
|
+
export { createReactRouterV6CompatibleTracingIntegration, createV6CompatibleWithSentryReactRouterRouting, createV6CompatibleWrapCreateBrowserRouter, createV6CompatibleWrapCreateMemoryRouter, createV6CompatibleWrapUseRoutes, handleNavigation, addResolvedRoutesToParent, processResolvedRoutes, updateNavigationSpan, } from './instrumentation';
|
|
3
|
+
export { resolveRouteNameAndSource, getNormalizedName, initializeRouterUtils, locationIsInsideDescendantRoute, prefixWithSlash, rebuildRoutePathFromAllRoutes, pathEndsWithWildcard, pathIsWildcardAndHasChildren, getNumberOfUrlSegments, transactionNameHasWildcard, getActiveRootSpan, setNavigationContext, clearNavigationContext, getNavigationContext, } from './utils';
|
|
4
|
+
export { createAsyncHandlerProxy, handleAsyncHandlerResult, checkRouteForAsyncHandler } from './lazy-routes';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reactrouter-compat-utils/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EACL,+CAA+C,EAC/C,8CAA8C,EAC9C,yCAAyC,EACzC,wCAAwC,EACxC,+BAA+B,EAC/B,gBAAgB,EAChB,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,+BAA+B,EAC/B,eAAe,EACf,6BAA6B,EAC7B,oBAAoB,EACpB,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,iBAAiB,EAEjB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { browserTracingIntegration } from '@sentry/browser';
|
|
2
|
+
import type { Integration, Span } from '@sentry/core';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import type { Action, AgnosticDataRouteMatch, CreateRouterFunction, CreateRoutesFromChildren, Location, MatchRoutes, RouteObject, Router, RouterState, UseEffect, UseLocation, UseNavigationType, UseRoutes } from '../types';
|
|
5
|
+
export declare const allRoutes: Set<RouteObject>;
|
|
6
|
+
/**
|
|
7
|
+
* Computes location key for duplicate detection. Normalizes undefined/null to empty strings.
|
|
8
|
+
* Exported for testing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeLocationKey(location: Location): string;
|
|
11
|
+
/**
|
|
12
|
+
* Determines if a navigation should be skipped as a duplicate, and if an existing span should be updated.
|
|
13
|
+
* Exported for testing.
|
|
14
|
+
*
|
|
15
|
+
* @returns An object with:
|
|
16
|
+
* - skip: boolean - Whether to skip creating a new span
|
|
17
|
+
* - shouldUpdate: boolean - Whether to update the existing span name (wildcard upgrade)
|
|
18
|
+
*/
|
|
19
|
+
export declare function shouldSkipNavigation(trackedNav: {
|
|
20
|
+
span: Span;
|
|
21
|
+
routeName: string;
|
|
22
|
+
pathname: string;
|
|
23
|
+
locationKey: string;
|
|
24
|
+
isPlaceholder?: boolean;
|
|
25
|
+
} | undefined, locationKey: string, proposedName: string, spanHasEnded: boolean): {
|
|
26
|
+
skip: boolean;
|
|
27
|
+
shouldUpdate: boolean;
|
|
28
|
+
};
|
|
29
|
+
export interface ReactRouterOptions {
|
|
30
|
+
useEffect: UseEffect;
|
|
31
|
+
useLocation: UseLocation;
|
|
32
|
+
useNavigationType: UseNavigationType;
|
|
33
|
+
createRoutesFromChildren: CreateRoutesFromChildren;
|
|
34
|
+
matchRoutes: MatchRoutes;
|
|
35
|
+
/**
|
|
36
|
+
* Whether to strip the basename from the pathname when creating transactions.
|
|
37
|
+
*
|
|
38
|
+
* This is useful for applications that use a basename in their routing setup.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
stripBasename?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Enables support for async route handlers.
|
|
44
|
+
*
|
|
45
|
+
* This allows Sentry to track and instrument routes dynamically resolved from async handlers.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
enableAsyncRouteHandlers?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Maximum time (in milliseconds) to wait for lazy routes to load before finalizing span names.
|
|
51
|
+
*
|
|
52
|
+
* - Set to `0` to not wait at all (immediate finalization)
|
|
53
|
+
* - Set to `Infinity` to wait as long as possible (capped at `finalTimeout` to prevent indefinite hangs)
|
|
54
|
+
* - Negative values will fall back to the default
|
|
55
|
+
*
|
|
56
|
+
* Defaults to 3× the configured `idleTimeout` (default: 3000ms).
|
|
57
|
+
*
|
|
58
|
+
* @default idleTimeout * 3
|
|
59
|
+
*/
|
|
60
|
+
lazyRouteTimeout?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Static route manifest for resolving parameterized route names with lazy routes.
|
|
63
|
+
*
|
|
64
|
+
* Requires `enableAsyncRouteHandlers: true`. When provided, the manifest is used
|
|
65
|
+
* as the primary source for determining transaction names. This is more reliable
|
|
66
|
+
* than depending on React Router's lazy route resolution timing.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* lazyRouteManifest: [
|
|
71
|
+
* '/',
|
|
72
|
+
* '/users',
|
|
73
|
+
* '/users/:userId',
|
|
74
|
+
* '/org/:orgSlug/projects/:projectId',
|
|
75
|
+
* ]
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
lazyRouteManifest?: string[];
|
|
79
|
+
}
|
|
80
|
+
type V6CompatibleVersion = '6' | '7';
|
|
81
|
+
export declare function addResolvedRoutesToParent(resolvedRoutes: RouteObject[], parentRoute: RouteObject): void;
|
|
82
|
+
/**
|
|
83
|
+
* Processes resolved routes by adding them to allRoutes and checking for nested async handlers.
|
|
84
|
+
* When capturedSpan is provided, updates that specific span instead of the current active span.
|
|
85
|
+
* This prevents race conditions where a lazy handler resolves after the user has navigated away.
|
|
86
|
+
*/
|
|
87
|
+
export declare function processResolvedRoutes(resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location | null, capturedSpan?: Span): void;
|
|
88
|
+
/**
|
|
89
|
+
* Updates a navigation span with the correct route name after lazy routes have been loaded.
|
|
90
|
+
*/
|
|
91
|
+
export declare function updateNavigationSpan(activeRootSpan: Span, location: Location, allRoutes: RouteObject[], forceUpdate: boolean | undefined, matchRoutes: MatchRoutes): void;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a wrapCreateBrowserRouter function that can be used with all React Router v6 compatible versions.
|
|
94
|
+
*/
|
|
95
|
+
export declare function createV6CompatibleWrapCreateBrowserRouter<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createRouterFunction: CreateRouterFunction<TState, TRouter>, version: V6CompatibleVersion): CreateRouterFunction<TState, TRouter>;
|
|
96
|
+
/**
|
|
97
|
+
* Creates a wrapCreateMemoryRouter function that can be used with all React Router v6 compatible versions.
|
|
98
|
+
*/
|
|
99
|
+
export declare function createV6CompatibleWrapCreateMemoryRouter<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createRouterFunction: CreateRouterFunction<TState, TRouter>, version: V6CompatibleVersion): CreateRouterFunction<TState, TRouter>;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a browser tracing integration that can be used with all React Router v6 compatible versions.
|
|
102
|
+
*/
|
|
103
|
+
export declare function createReactRouterV6CompatibleTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions, version: V6CompatibleVersion): Integration;
|
|
104
|
+
export declare function createV6CompatibleWrapUseRoutes(origUseRoutes: UseRoutes, version: V6CompatibleVersion): UseRoutes;
|
|
105
|
+
export declare function handleNavigation(opts: {
|
|
106
|
+
location: Location;
|
|
107
|
+
routes: RouteObject[];
|
|
108
|
+
navigationType: Action;
|
|
109
|
+
version: V6CompatibleVersion;
|
|
110
|
+
matches?: AgnosticDataRouteMatch;
|
|
111
|
+
basename?: string;
|
|
112
|
+
allRoutes?: RouteObject[];
|
|
113
|
+
}): void;
|
|
114
|
+
export declare function addRoutesToAllRoutes(routes: RouteObject[]): void;
|
|
115
|
+
export declare function createV6CompatibleWithSentryReactRouterRouting<P extends Record<string, any>, R extends React.FC<P>>(Routes: R, version: V6CompatibleVersion): R;
|
|
116
|
+
export {};
|
|
117
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../src/reactrouter-compat-utils/instrumentation.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,yBAAyB,EAI1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAU,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAW9D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EACV,MAAM,EACN,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,QAAQ,EACR,WAAW,EAEX,WAAW,EACX,MAAM,EACN,WAAW,EACX,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,SAAS,EACV,MAAM,UAAU,CAAC;AA+BlB,eAAO,MAAM,SAAS,kBAAyB,CAAC;AA8BhD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE7D;AAUD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EACN;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GACjG,SAAS,EACb,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,OAAO,GACpB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CAkC1C;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,EA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AAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAE/C,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,OAAO,EAAE,mBAAmB,GAC3B,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAsFvC;AAED;;GAEG;AACH,wBAAgB,+CAA+C,CAC7D,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,EAC7E,OAAO,EAAE,mBAAmB,GAC3B,WAAW,CAmFb;AAED,wBAAgB,+BAA+B,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB,GAAG,SAAS,CA8DjH;AAoID,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;CAC3B,GAAG,IAAI,CAyGP;AAGD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAQhE;AAiRD,wBAAgB,8CAA8C,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EACjH,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,mBAAmB,GAC3B,CAAC,CAmDH"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Span } from '@sentry/core';
|
|
2
|
+
import type { Location, RouteObject } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a proxy wrapper for an async handler function.
|
|
5
|
+
* Captures both the location and the active span at invocation time to ensure
|
|
6
|
+
* the correct span is updated when the handler resolves.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createAsyncHandlerProxy(originalFunction: (...args: unknown[]) => unknown, route: RouteObject, handlerKey: string, processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location, capturedSpan?: Span) => void): (...args: unknown[]) => unknown;
|
|
9
|
+
/**
|
|
10
|
+
* Handles the result of an async handler function call.
|
|
11
|
+
* Passes the captured span through to ensure the correct span is updated.
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleAsyncHandlerResult(result: unknown, route: RouteObject, handlerKey: string, processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location, capturedSpan?: Span) => void, currentLocation: Location | null, capturedSpan: Span | undefined): void;
|
|
14
|
+
/**
|
|
15
|
+
* Recursively checks a route for async handlers and sets up Proxies to add discovered child routes to allRoutes when called.
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkRouteForAsyncHandler(route: RouteObject, processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location, capturedSpan?: Span) => void): void;
|
|
18
|
+
//# sourceMappingURL=lazy-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-routes.d.ts","sourceRoot":"","sources":["../../../src/reactrouter-compat-utils/lazy-routes.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AA6DtD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EACjD,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,MAAM,EAClB,qBAAqB,EAAE,CACrB,cAAc,EAAE,WAAW,EAAE,EAC7B,WAAW,CAAC,EAAE,WAAW,EACzB,eAAe,CAAC,EAAE,QAAQ,EAC1B,YAAY,CAAC,EAAE,IAAI,KAChB,IAAI,GACR,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAqBjC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,MAAM,EAClB,qBAAqB,EAAE,CACrB,cAAc,EAAE,WAAW,EAAE,EAC7B,WAAW,CAAC,EAAE,WAAW,EACzB,eAAe,CAAC,EAAE,QAAQ,EAC1B,YAAY,CAAC,EAAE,IAAI,KAChB,IAAI,EACT,eAAe,EAAE,QAAQ,GAAG,IAAI,EAChC,YAAY,EAAE,IAAI,GAAG,SAAS,GAC7B,IAAI,CAcN;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,WAAW,EAClB,qBAAqB,EAAE,CACrB,cAAc,EAAE,WAAW,EAAE,EAC7B,WAAW,CAAC,EAAE,WAAW,EACzB,eAAe,CAAC,EAAE,QAAQ,EAC1B,YAAY,CAAC,EAAE,IAAI,KAChB,IAAI,GACR,IAAI,CAiBN"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strip the basename from a pathname if exists.
|
|
3
|
+
*
|
|
4
|
+
* Vendored and modified from `react-router`
|
|
5
|
+
* https://github.com/remix-run/react-router/blob/462bb712156a3f739d6139a0f14810b76b002df6/packages/router/utils.ts#L1038
|
|
6
|
+
*/
|
|
7
|
+
export declare function stripBasenameFromPathname(pathname: string, basename: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* Matches a pathname against a route manifest and returns the matching pattern.
|
|
10
|
+
* Optionally strips a basename prefix before matching.
|
|
11
|
+
*/
|
|
12
|
+
export declare function matchRouteManifest(pathname: string, manifest: string[], basename?: string): string | null;
|
|
13
|
+
//# sourceMappingURL=route-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-manifest.d.ts","sourceRoot":"","sources":["../../../src/reactrouter-compat-utils/route-manifest.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAmBpF;AAKD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuBzG"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Span, TransactionSource } from '@sentry/core';
|
|
2
|
+
import type { Location, MatchRoutes, RouteMatch, RouteObject } from '../types';
|
|
3
|
+
interface NavigationContext {
|
|
4
|
+
token: object;
|
|
5
|
+
targetPath: string | undefined;
|
|
6
|
+
span: Span | undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Pushes a navigation context and returns a unique token for cleanup.
|
|
10
|
+
* The token uses object identity for uniqueness (no counter needed).
|
|
11
|
+
*/
|
|
12
|
+
export declare function setNavigationContext(targetPath: string | undefined, span: Span | undefined): object;
|
|
13
|
+
/**
|
|
14
|
+
* Clears the navigation context if it's on top of the stack (LIFO).
|
|
15
|
+
* If our context is not on top (out-of-order completion), we leave it -
|
|
16
|
+
* it will be cleaned up by overflow protection when the stack fills up.
|
|
17
|
+
*/
|
|
18
|
+
export declare function clearNavigationContext(token: object): void;
|
|
19
|
+
/** Gets the current (most recent) navigation context if inside a patchRoutesOnNavigation call. */
|
|
20
|
+
export declare function getNavigationContext(): NavigationContext | null;
|
|
21
|
+
/**
|
|
22
|
+
* Initialize function to set dependencies that the router utilities need.
|
|
23
|
+
* Must be called before using any of the exported utility functions.
|
|
24
|
+
*/
|
|
25
|
+
export declare function initializeRouterUtils(matchRoutes: MatchRoutes, stripBasename?: boolean): void;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if a path ends with a wildcard character (*).
|
|
28
|
+
*/
|
|
29
|
+
export declare function pathEndsWithWildcard(path: string): boolean;
|
|
30
|
+
/** Checks if transaction name has wildcard (/* or ends with *). */
|
|
31
|
+
export declare function transactionNameHasWildcard(name: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Checks if a path is a wildcard and has child routes.
|
|
34
|
+
*/
|
|
35
|
+
export declare function pathIsWildcardAndHasChildren(path: string, branch: RouteMatch<string>): boolean;
|
|
36
|
+
/** Check if route is in descendant route (<Routes> within <Routes>) */
|
|
37
|
+
export declare function routeIsDescendant(route: RouteObject): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the number of URL segments in the given URL string.
|
|
40
|
+
* Splits at '/' or '\/' to handle regex URLs correctly.
|
|
41
|
+
*
|
|
42
|
+
* @param url - The URL string to segment.
|
|
43
|
+
* @returns The number of segments in the URL.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getNumberOfUrlSegments(url: string): number;
|
|
46
|
+
/**
|
|
47
|
+
* Ensures a path string starts with a forward slash.
|
|
48
|
+
*/
|
|
49
|
+
export declare function prefixWithSlash(path: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Rebuilds the route path from all available routes by matching against the current location.
|
|
52
|
+
*/
|
|
53
|
+
export declare function rebuildRoutePathFromAllRoutes(allRoutes: RouteObject[], location: Location): string;
|
|
54
|
+
/**
|
|
55
|
+
* Checks if the current location is inside a descendant route (route with splat parameter).
|
|
56
|
+
*/
|
|
57
|
+
export declare function locationIsInsideDescendantRoute(location: Location, routes: RouteObject[]): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Gets a normalized route name and transaction source from the current routes and location.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getNormalizedName(routes: RouteObject[], location: Location, branches: RouteMatch[], basename?: string): [string, TransactionSource];
|
|
62
|
+
/**
|
|
63
|
+
* Shared helper function to resolve route name and source
|
|
64
|
+
*/
|
|
65
|
+
export declare function resolveRouteNameAndSource(location: Location, routes: RouteObject[], allRoutes: RouteObject[], branches: RouteMatch[], basename?: string, lazyRouteManifest?: string[], enableAsyncRouteHandlers?: boolean): [string, TransactionSource];
|
|
66
|
+
/**
|
|
67
|
+
* Gets the active root span if it's a pageload or navigation span.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getActiveRootSpan(): Span | undefined;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/reactrouter-compat-utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAG5D,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAS/E,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAKD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,CASnG;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAK1D;AAED,kGAAkG;AAClG,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAI/D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,GAAE,OAAe,GAAG,IAAI,CAGpG;AAmBD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,mEAAmE;AACnE,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,OAAO,CAE9F;AAED,uEAAuE;AACvE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE7D;AAsBD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG1D;AAID;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CA+BlG;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAYlG;AASD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,WAAW,EAAE,EACrB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,GAAE,MAAW,GACpB,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAsD7B;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,WAAW,EAAE,EACrB,SAAS,EAAE,WAAW,EAAE,EACxB,QAAQ,EAAE,UAAU,EAAE,EACtB,QAAQ,GAAE,MAAW,EACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAC5B,wBAAwB,CAAC,EAAE,OAAO,GACjC,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAyB7B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,GAAG,SAAS,CAYpD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { browserTracingIntegration } from '@sentry/browser';
|
|
2
|
+
import type { Integration } from '@sentry/core';
|
|
3
|
+
import type { ReactElement } from 'react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import type { Action, Location } from './types';
|
|
6
|
+
type Match = {
|
|
7
|
+
path: string;
|
|
8
|
+
url: string;
|
|
9
|
+
params: Record<string, any>;
|
|
10
|
+
isExact: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type RouterHistory = {
|
|
13
|
+
location?: Location;
|
|
14
|
+
listen?(cb: (location: Location, action: Action) => void): void;
|
|
15
|
+
} & Record<string, any>;
|
|
16
|
+
export type RouteConfig = {
|
|
17
|
+
[propName: string]: unknown;
|
|
18
|
+
path?: string | string[];
|
|
19
|
+
exact?: boolean;
|
|
20
|
+
component?: ReactElement;
|
|
21
|
+
routes?: RouteConfig[];
|
|
22
|
+
};
|
|
23
|
+
export type MatchPath = (pathname: string, props: string | string[] | any, parent?: Match | null) => Match | null;
|
|
24
|
+
interface ReactRouterOptions {
|
|
25
|
+
history: RouterHistory;
|
|
26
|
+
routes?: RouteConfig[];
|
|
27
|
+
matchPath?: MatchPath;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A browser tracing integration that uses React Router v4 to instrument navigations.
|
|
31
|
+
* Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.
|
|
32
|
+
*/
|
|
33
|
+
export declare function reactRouterV4BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration;
|
|
34
|
+
/**
|
|
35
|
+
* A browser tracing integration that uses React Router v5 to instrument navigations.
|
|
36
|
+
* Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.
|
|
37
|
+
*/
|
|
38
|
+
export declare function reactRouterV5BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration;
|
|
39
|
+
export declare function withSentryRouting<P extends Record<string, any>, R extends React.ComponentType<P>>(Route: R): R;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=reactrouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactrouter.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O,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAyBb;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAyBb;AAiHD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA4B9G"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { browserTracingIntegration } from '@sentry/browser';
|
|
2
|
+
import type { Integration } from '@sentry/core';
|
|
3
|
+
import type { Location } from './types';
|
|
4
|
+
type HistoryV3 = {
|
|
5
|
+
location?: Location;
|
|
6
|
+
listen?(cb: (location: Location) => void): void;
|
|
7
|
+
} & Record<string, any>;
|
|
8
|
+
export type Route = {
|
|
9
|
+
path?: string;
|
|
10
|
+
childRoutes?: Route[];
|
|
11
|
+
};
|
|
12
|
+
export type Match = (props: {
|
|
13
|
+
location: Location;
|
|
14
|
+
routes: Route[];
|
|
15
|
+
}, cb: (error?: Error, _redirectLocation?: Location, renderProps?: {
|
|
16
|
+
routes?: Route[];
|
|
17
|
+
}) => void) => void;
|
|
18
|
+
interface ReactRouterOptions {
|
|
19
|
+
history: HistoryV3;
|
|
20
|
+
routes: Route[];
|
|
21
|
+
match: Match;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A browser tracing integration that uses React Router v3 to instrument navigations.
|
|
25
|
+
* Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.
|
|
26
|
+
*/
|
|
27
|
+
export declare function reactRouterV3BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=reactrouterv3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactrouterv3.d.ts","sourceRoot":"","sources":["../../src/reactrouterv3.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAI1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AAMnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAKxC,KAAK,SAAS,GAAG;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI,CAAC;CAEjD,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAExB,MAAM,MAAM,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAA;CAAE,CAAC;AAE7D,MAAM,MAAM,KAAK,GAAG,CAClB,KAAK,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,KAAK,EAAE,CAAA;CAAE,EAC9C,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;CAAE,KAAK,IAAI,KAC1F,IAAI,CAAC;AAIV,UAAU,kBAAkB;IAC1B,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAuDb"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { browserTracingIntegration } from '@sentry/browser';
|
|
2
|
+
import type { Integration } from '@sentry/core';
|
|
3
|
+
import type { ReactRouterOptions } from './reactrouter-compat-utils';
|
|
4
|
+
import type { CreateRouterFunction, Router, RouterState, UseRoutes } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* A browser tracing integration that uses React Router v6 to instrument navigations.
|
|
7
|
+
* Expects `useEffect`, `useLocation`, `useNavigationType`, `createRoutesFromChildren` and `matchRoutes` to be passed as options.
|
|
8
|
+
*/
|
|
9
|
+
export declare function reactRouterV6BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration;
|
|
10
|
+
/**
|
|
11
|
+
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 useRoutes hook.
|
|
12
|
+
* This is used to automatically capture route changes as transactions when using the useRoutes hook.
|
|
13
|
+
*/
|
|
14
|
+
export declare function wrapUseRoutesV6(origUseRoutes: UseRoutes): UseRoutes;
|
|
15
|
+
/**
|
|
16
|
+
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createBrowserRouter function.
|
|
17
|
+
* This is used to automatically capture route changes as transactions when using the createBrowserRouter API.
|
|
18
|
+
*/
|
|
19
|
+
export declare function wrapCreateBrowserRouterV6<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter>;
|
|
20
|
+
/**
|
|
21
|
+
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createMemoryRouter function.
|
|
22
|
+
* This is used to automatically capture route changes as transactions when using the createMemoryRouter API.
|
|
23
|
+
* The difference between createBrowserRouter and createMemoryRouter is that with createMemoryRouter,
|
|
24
|
+
* optional `initialEntries` are also taken into account.
|
|
25
|
+
*/
|
|
26
|
+
export declare function wrapCreateMemoryRouterV6<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createMemoryRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter>;
|
|
27
|
+
/**
|
|
28
|
+
* A higher-order component that adds Sentry routing instrumentation to a React Router v6 Route component.
|
|
29
|
+
* This is used to automatically capture route changes as transactions.
|
|
30
|
+
*/
|
|
31
|
+
export declare function withSentryReactRouterV6Routing<P extends Record<string, any>, R extends React.FC<P>>(routes: R): R;
|
|
32
|
+
//# sourceMappingURL=reactrouterv6.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactrouterv6.d.ts","sourceRoot":"","sources":["../../src/reactrouterv6.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAQrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAEb;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,CAEnE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,OAAO,SAAS,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAC/C,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAEpG;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,OAAO,SAAS,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAC/C,0BAA0B,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1G;AAED;;;GAGG;AAEH,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,CAEjH"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { browserTracingIntegration } from '@sentry/browser';
|
|
2
|
+
import type { Integration } from '@sentry/core';
|
|
3
|
+
import type { ReactRouterOptions } from './reactrouter-compat-utils';
|
|
4
|
+
import type { CreateRouterFunction, Router, RouterState, UseRoutes } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* A browser tracing integration that uses React Router v7 to instrument navigations.
|
|
7
|
+
* Expects `useEffect`, `useLocation`, `useNavigationType`, `createRoutesFromChildren` and `matchRoutes` to be passed as options.
|
|
8
|
+
*/
|
|
9
|
+
export declare function reactRouterV7BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration;
|
|
10
|
+
/**
|
|
11
|
+
* A higher-order component that adds Sentry routing instrumentation to a React Router v7 Route component.
|
|
12
|
+
* This is used to automatically capture route changes as transactions.
|
|
13
|
+
*/
|
|
14
|
+
export declare function withSentryReactRouterV7Routing<P extends Record<string, any>, R extends React.FC<P>>(routes: R): R;
|
|
15
|
+
/**
|
|
16
|
+
* A wrapper function that adds Sentry routing instrumentation to a React Router v7 createBrowserRouter function.
|
|
17
|
+
* This is used to automatically capture route changes as transactions when using the createBrowserRouter API.
|
|
18
|
+
*/
|
|
19
|
+
export declare function wrapCreateBrowserRouterV7<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter>;
|
|
20
|
+
/**
|
|
21
|
+
* A wrapper function that adds Sentry routing instrumentation to a React Router v7 createMemoryRouter function.
|
|
22
|
+
* This is used to automatically capture route changes as transactions when using the createMemoryRouter API.
|
|
23
|
+
* The difference between createBrowserRouter and createMemoryRouter is that with createMemoryRouter,
|
|
24
|
+
* optional `initialEntries` are also taken into account.
|
|
25
|
+
*/
|
|
26
|
+
export declare function wrapCreateMemoryRouterV7<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createMemoryRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter>;
|
|
27
|
+
/**
|
|
28
|
+
* A wrapper function that adds Sentry routing instrumentation to a React Router v7 useRoutes hook.
|
|
29
|
+
* This is used to automatically capture route changes as transactions when using the useRoutes hook.
|
|
30
|
+
*/
|
|
31
|
+
export declare function wrapUseRoutesV7(origUseRoutes: UseRoutes): UseRoutes;
|
|
32
|
+
//# sourceMappingURL=reactrouterv7.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactrouterv7.d.ts","sourceRoot":"","sources":["../../src/reactrouterv7.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAQrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC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