@sentry/react 10.23.0 → 10.25.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.
@@ -1 +1 @@
1
- {"version":3,"file":"reactrouterv3.js","sources":["../../src/reactrouterv3.ts"],"sourcesContent":["import {\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Integration, TransactionSource } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport type { Location } from './types';\n\n// Many of the types below had to be mocked out to prevent typescript issues\n// these types are required for correct functionality.\n\ntype HistoryV3 = {\n location?: Location;\n listen?(cb: (location: Location) => void): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n} & Record<string, any>;\n\nexport type Route = { path?: string; childRoutes?: Route[] };\n\nexport type Match = (\n props: { location: Location; routes: Route[] },\n cb: (error?: Error, _redirectLocation?: Location, renderProps?: { routes?: Route[] }) => void,\n) => void;\n\ntype ReactRouterV3TransactionSource = Extract<TransactionSource, 'url' | 'route'>;\n\ninterface ReactRouterOptions {\n history: HistoryV3;\n routes: Route[];\n match: Match;\n}\n\n/**\n * A browser tracing integration that uses React Router v3 to instrument navigations.\n * Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.\n */\nexport function reactRouterV3BrowserTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n): Integration {\n const integration = browserTracingIntegration({\n ...options,\n instrumentPageLoad: false,\n instrumentNavigation: false,\n });\n\n const { history, routes, match, instrumentPageLoad = true, instrumentNavigation = true } = options;\n\n return {\n ...integration,\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n if (instrumentPageLoad && WINDOW.location) {\n normalizeTransactionName(\n routes,\n WINDOW.location as unknown as Location,\n match,\n (localName: string, source: ReactRouterV3TransactionSource = 'url') => {\n startBrowserTracingPageLoadSpan(client, {\n name: localName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.reactrouter_v3',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n },\n });\n },\n );\n }\n\n if (instrumentNavigation && history.listen) {\n history.listen(location => {\n if (location.action === 'PUSH' || location.action === 'POP') {\n normalizeTransactionName(\n routes,\n location,\n match,\n (localName: string, source: TransactionSource = 'url') => {\n startBrowserTracingNavigationSpan(client, {\n name: localName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.reactrouter_v3',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n },\n });\n },\n );\n }\n });\n }\n },\n };\n}\n\n/**\n * Normalize transaction names using `Router.match`\n */\nfunction normalizeTransactionName(\n appRoutes: Route[],\n location: Location,\n match: Match,\n callback: (pathname: string, source?: ReactRouterV3TransactionSource) => void,\n): void {\n let name = location.pathname;\n match(\n {\n location,\n routes: appRoutes,\n },\n (error, _redirectLocation, renderProps) => {\n if (error || !renderProps) {\n return callback(name);\n }\n\n const routePath = getRouteStringFromRoutes(renderProps.routes || []);\n if (routePath.length === 0 || routePath === '/*') {\n return callback(name);\n }\n\n name = routePath;\n return callback(name, 'route');\n },\n );\n}\n\n/**\n * Generate route name from array of routes\n */\nfunction getRouteStringFromRoutes(routes: Route[]): string {\n if (!Array.isArray(routes) || routes.length === 0) {\n return '';\n }\n\n const routesWithPaths: Route[] = routes.filter((route: Route) => !!route.path);\n\n let index = -1;\n for (let x = routesWithPaths.length - 1; x >= 0; x--) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const route = routesWithPaths[x]!;\n if (route.path?.startsWith('/')) {\n index = x;\n break;\n }\n }\n\n return routesWithPaths.slice(index).reduce((acc, { path }) => {\n const pathSegment = acc === '/' || acc === '' ? path : `/${path}`;\n return `${acc}${pathSegment}`;\n }, '');\n}\n"],"names":["browserTracingIntegration","WINDOW","startBrowserTracingPageLoadSpan","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","startBrowserTracingNavigationSpan"],"mappings":";;;;;AAcA;AACA;;AAuBA;AACA;AACA;AACA;AACO,SAAS,sCAAsC;AACtD,EAAE,OAAO;AACT,EAAe;AACf,EAAE,MAAM,WAAA,GAAcA,iCAAyB,CAAC;AAChD,IAAI,GAAG,OAAO;AACd,IAAI,kBAAkB,EAAE,KAAK;AAC7B,IAAI,oBAAoB,EAAE,KAAK;AAC/B,GAAG,CAAC;;AAEJ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAA,GAAqB,IAAI,EAAE,oBAAA,GAAuB,IAAA,EAAK,GAAI,OAAO;;AAEpG,EAAE,OAAO;AACT,IAAI,GAAG,WAAW;AAClB,IAAI,aAAa,CAAC,MAAM,EAAE;AAC1B,MAAM,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC;;AAEvC,MAAM,IAAI,kBAAA,IAAsBC,cAAM,CAAC,QAAQ,EAAE;AACjD,QAAQ,wBAAwB;AAChC,UAAU,MAAM;AAChB,UAAUA,cAAM,CAAC,QAAA;AACjB,UAAU,KAAK;AACf,UAAU,CAAC,SAAS,EAAU,MAAM,GAAmC,KAAK,KAAK;AACjF,YAAYC,uCAA+B,CAAC,MAAM,EAAE;AACpD,cAAc,IAAI,EAAE,SAAS;AAC7B,cAAc,UAAU,EAAE;AAC1B,gBAAgB,CAACC,iCAA4B,GAAG,UAAU;AAC1D,gBAAgB,CAACC,qCAAgC,GAAG,oCAAoC;AACxF,gBAAgB,CAACC,qCAAgC,GAAG,MAAM;AA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","sources":["../../src/reactrouterv3.ts"],"sourcesContent":["import {\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Integration, TransactionSource } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport type { Location } from './types';\n\n// Many of the types below had to be mocked out to prevent typescript issues\n// these types are required for correct functionality.\n\ntype HistoryV3 = {\n location?: Location;\n listen?(cb: (location: Location) => void): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n} & Record<string, any>;\n\nexport type Route = { path?: string; childRoutes?: Route[] };\n\nexport type Match = (\n props: { location: Location; routes: Route[] },\n cb: (error?: Error, _redirectLocation?: Location, renderProps?: { routes?: Route[] }) => void,\n) => void;\n\ntype ReactRouterV3TransactionSource = Extract<TransactionSource, 'url' | 'route'>;\n\ninterface ReactRouterOptions {\n history: HistoryV3;\n routes: Route[];\n match: Match;\n}\n\n/**\n * A browser tracing integration that uses React Router v3 to instrument navigations.\n * Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.\n */\nexport function reactRouterV3BrowserTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n): Integration {\n const integration = browserTracingIntegration({\n ...options,\n instrumentPageLoad: false,\n instrumentNavigation: false,\n });\n\n const { history, routes, match, instrumentPageLoad = true, instrumentNavigation = true } = options;\n\n return {\n ...integration,\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n if (instrumentPageLoad && WINDOW.location) {\n normalizeTransactionName(\n routes,\n WINDOW.location as unknown as Location,\n match,\n (localName: string, source: ReactRouterV3TransactionSource = 'url') => {\n startBrowserTracingPageLoadSpan(client, {\n name: localName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.reactrouter_v3',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n },\n });\n },\n );\n }\n\n if (instrumentNavigation && history.listen) {\n history.listen(location => {\n if (location.action === 'PUSH' || location.action === 'POP') {\n normalizeTransactionName(\n routes,\n location,\n match,\n (localName: string, source: TransactionSource = 'url') => {\n startBrowserTracingNavigationSpan(client, {\n name: localName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.reactrouter_v3',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n },\n });\n },\n );\n }\n });\n }\n },\n };\n}\n\n/**\n * Normalize transaction names using `Router.match`\n */\nfunction normalizeTransactionName(\n appRoutes: Route[],\n location: Location,\n match: Match,\n callback: (pathname: string, source?: ReactRouterV3TransactionSource) => void,\n): void {\n let name = location.pathname;\n match(\n {\n location,\n routes: appRoutes,\n },\n (error, _redirectLocation, renderProps) => {\n if (error || !renderProps) {\n return callback(name);\n }\n\n const routePath = getRouteStringFromRoutes(renderProps.routes || []);\n if (routePath.length === 0 || routePath === '/*') {\n return callback(name);\n }\n\n name = routePath;\n return callback(name, 'route');\n },\n );\n}\n\n/**\n * Generate route name from array of routes\n */\nfunction getRouteStringFromRoutes(routes: Route[]): string {\n if (!Array.isArray(routes) || routes.length === 0) {\n return '';\n }\n\n const routesWithPaths: Route[] = routes.filter((route: Route) => !!route.path);\n\n let index = -1;\n for (let x = routesWithPaths.length - 1; x >= 0; x--) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const route = routesWithPaths[x]!;\n if (route.path?.startsWith('/')) {\n index = x;\n break;\n }\n }\n\n return routesWithPaths.slice(index).reduce((acc, { path }) => {\n const pathSegment = acc === '/' || acc === '' ? path : `/${path}`;\n return `${acc}${pathSegment}`;\n }, '');\n}\n"],"names":["browserTracingIntegration","WIND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it-any */\nimport type { Scope } from '@sentry/core';\nimport { addBreadcrumb, addNonEnumerableProperty, getClient, getCurrentScope, getGlobalScope } from '@sentry/core';\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> =\n 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 * Redux state in attachments or not.\n * @default true\n */\n attachReduxState?: boolean;\n\n /**\n * Transforms the state before attaching it to an event.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not attach the state.\n */\n stateTransformer(state: S | undefined): (S & any) | null;\n /**\n * Transforms the action before sending it as a breadcrumb.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not send the breadcrumb.\n */\n actionTransformer(action: AnyAction): AnyAction | null;\n /**\n * Called on every state update, configure the Sentry Scope with the redux state.\n */\n configureScopeWithState?(scope: Scope, state: S): void;\n}\n\nconst ACTION_BREADCRUMB_CATEGORY = 'redux.action';\nconst ACTION_BREADCRUMB_TYPE = 'info';\n\nconst defaultOptions: SentryEnhancerOptions = {\n attachReduxState: true,\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 options.attachReduxState &&\n getGlobalScope().addEventProcessor((event, hint) => {\n try {\n // @ts-expect-error try catch to reduce bundle size\n if (event.type === undefined && event.contexts.state.state.type === 'redux') {\n hint.attachments = [\n ...(hint.attachments || []),\n // @ts-expect-error try catch to reduce bundle size\n { filename: 'redux_state.json', data: JSON.stringify(event.contexts.state.state.value) },\n ];\n }\n } catch {\n // empty\n }\n return event;\n });\n\n function sentryWrapReducer(reducer: Reducer<S, A>): Reducer<S, A> {\n return (state, action): S => {\n const newState = reducer(state, action);\n\n const scope = getCurrentScope();\n\n /* Action breadcrumbs */\n const transformedAction = options.actionTransformer(action);\n if (typeof transformedAction !== 'undefined' && transformedAction !== null) {\n 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 const client = getClient();\n const options = client?.getOptions();\n const normalizationDepth = options?.normalizeDepth || 3; // default state normalization depth to 3\n\n // Set the normalization depth of the redux state to the configured `normalizeDepth` option or a sane number as a fallback\n const newStateContext = { state: { type: 'redux', value: transformedState } };\n addNonEnumerableProperty(\n newStateContext,\n '__sentry_override_normalization_depth__',\n 3 + // 3 layers for `state.value.transformedState`\n normalizationDepth, // rest for the actual state\n );\n\n scope.setContext('state', newStateContext);\n } else {\n scope.setContext('state', null);\n }\n\n /* Allow user to configure scope with latest state */\n const { configureScopeWithState } = options;\n if (typeof configureScopeWithState === 'function') {\n configureScopeWithState(scope, newState);\n }\n\n return newState;\n };\n }\n\n const store = next(sentryWrapReducer(reducer), initialState);\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n store.replaceReducer = new Proxy(store.replaceReducer, {\n apply: function (target, thisArg, args) {\n target.apply(thisArg, [sentryWrapReducer(args[0])]);\n },\n });\n\n return store;\n };\n}\n\nexport { createReduxEnhancer };\n"],"names":["getGlobalScope","getCurrentScope","addBreadcrumb","getClient","addNonEnumerableProperty"],"mappings":";;;;AA2EA,MAAM,0BAAA,GAA6B,cAAc;AACjD,MAAM,sBAAA,GAAyB,MAAM;;AAErC,MAAM,cAAc,GAA0B;AAC9C,EAAE,gBAAgB,EAAE,IAAI;AACxB,EAAE,iBAAiB,EAAE,MAAA,IAAU,MAAM;AACrC,EAAE,gBAAgB,EAAE,KAAA,IAAS,KAAA,IAAS,IAAI;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB,CAAC,eAAe,EAAwC;AACpF;AACA,EAAE,MAAM,UAAU;AAClB,IAAI,GAAG,cAAc;AACrB,IAAI,GAAG,eAAe;AACtB,GAAG;;AAEH,EAAE,OAAO,CAAC,IAAI;AACd,IAAI,CAAwC,OAAO,EAAiB,YAAY,KAAyB;AACzG,MAAM,OAAO,CAAC,gBAAA;AACd,QAAQA,mBAAc,EAAE,CAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE,IAAI,KAA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kBAAA,GAAqB,OAAO,EAAE,cAAA,IAAkB,CAAC,CAAA;;AAEnE;AACA,YAAY,MAAM,eAAA,GAAkB,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAA,IAAoB;AACzF,YAAYC,6BAAwB;AACpC,cAAc,eAAe;AAC7B,cAAc,yCAAyC;AACvD,cAAc,CAAA;AACd,gBAAgB,kBAAkB;AAClC,aAAa;;AAEb,YAAY,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC;AACtD,iBAAiB;AACjB,YAAY,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC;AAC3C;;AAEA;AACA,UAAU,MAAM,EAAE,uBAAA,EAAwB,GAAI,OAAO;AACrD,UAAU,IAAI,OAAO,uBAAA,KAA4B,UAAU,EAAE;AAC7D,YAAY,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC;AACpD;;AAEA,UAAU,OAAO,QAAQ;AACzB,SAAS;AACT;;AAEA,MAAM,MAAM,KAAA,GAAQ,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;;AAElE;AACA,MAAM,KAAK,CAAC,cAAA,GAAiB,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE;AAC7D,QAAQ,KAAK,EAAE,UAAU,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AAChD,UAAU,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,SAAS;AACT,OAAO,CAAC;;AAER,MAAM,OAAO,KAAK;AAClB,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"redux.js","sources":["../../src/redux.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { Scope } from '@sentry/core';\nimport { addBreadcrumb, addNonEnumerableProperty, getClient, getCurrentScope, getGlobalScope } from '@sentry/core';\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> =\n 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 * Redux state in attachments or not.\n * @default true\n */\n attachReduxState?: boolean;\n\n /**\n * Transforms the state before attaching it to an event.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not attach the state.\n */\n stateTransformer(state: S | undefined): (S & any) | null;\n /**\n * Transforms the action before sending it as a breadcrumb.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not send the breadcrumb.\n */\n actionTransformer(action: AnyAction): AnyAction | null;\n /**\n * Called on every state update, configure the Sentry Scope with the redux state.\n */\n configureScopeWithState?(scope: Scope, state: S): void;\n}\n\nconst ACTION_BREADCRUMB_CATEGORY = 'redux.action';\nconst ACTION_BREADCRUMB_TYPE = 'info';\n\nconst defaultOptions: SentryEnhancerOptions = {\n attachReduxState: true,\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 options.attachReduxState &&\n getGlobalScope().addEventProcessor((event, hint) => {\n try {\n // @ts-expect-error try catch to reduce bundle size\n if (event.type === undefined && event.contexts.state.state.type === 'redux') {\n hint.attachments = [\n ...(hint.attachments || []),\n // @ts-expect-error try catch to reduce bundle size\n { filename: 'redux_state.json', data: JSON.stringify(event.contexts.state.state.value) },\n ];\n }\n } catch {\n // empty\n }\n return event;\n });\n\n function sentryWrapReducer(reducer: Reducer<S, A>): Reducer<S, A> {\n return (state, action): S => {\n const newState = reducer(state, action);\n\n const scope = getCurrentScope();\n\n /* Action breadcrumbs */\n const transformedAction = options.actionTransformer(action);\n if (typeof transformedAction !== 'undefined' && transformedAction !== null) {\n 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 const client = getClient();\n const options = client?.getOptions();\n const normalizationDepth = options?.normalizeDepth || 3; // default state normalization depth to 3\n\n // Set the normalization depth of the redux state to the configured `normalizeDepth` option or a sane number as a fallback\n const newStateContext = { state: { type: 'redux', value: transformedState } };\n addNonEnumerableProperty(\n newStateContext,\n '__sentry_override_normalization_depth__',\n 3 + // 3 layers for `state.value.transformedState`\n normalizationDepth, // rest for the actual state\n );\n\n scope.setContext('state', newStateContext);\n } else {\n scope.setContext('state', null);\n }\n\n /* Allow user to configure scope with latest state */\n const { configureScopeWithState } = options;\n if (typeof configureScopeWithState === 'function') {\n configureScopeWithState(scope, newState);\n }\n\n return newState;\n };\n }\n\n const store = next(sentryWrapReducer(reducer), initialState);\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n store.replaceReducer = new Proxy(store.replaceReducer, {\n apply: function (target, thisArg, args) {\n target.apply(thisArg, [sentryWrapReducer(args[0])]);\n },\n });\n\n return store;\n };\n}\n\nexport { createReduxEnhancer };\n"],"names":["getGlobalScope","getCurrentScope","addBreadcrumb","getClient","addNonEnumerableProperty"],"mappings":";;;;AA2EA,MAAM,0BAAA,GAA6B,cAAc;AACjD,MAAM,sBAAA,GAAyB,MAAM;;AAErC,MAAM,cAAc,GAA0B;AAC9C,EAAE,gBAAgB,EAAE,IAAI;AACxB,EAAE,iBAAiB,EAAE,MAAA,IAAU,MAAM;AACrC,EAAE,gBAAgB,EAAE,KAAA,IAAS,KAAA,IAAS,IAAI;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB,CAAC,eAAe,EAAwC;AACpF;AACA,EAAE,MAAM,UAAU;AAClB,IAAI,GAAG,cAAc;AACrB,IAAI,GAAG,eAAe;AACtB,GAAG;;AAEH,EAAE,OAAO,CAAC,IAAI;AACd,IAAI,CAAwC,OAAO,EAAiB,YAAY,KAAyB;AACzG,MAAM,OAAO,CAAC,gBAAA;AACd,QAAQA,mBAAc,EAAE,CAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK;AAC5D,UAAU,IAAI;AACd;AACA,YAAY,IAAI,KAAK,CAAC,IAAA,KAAS,aAAa,KAAK,CAAC,QAAQ,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AACA,YAAY,MAAM,eAAA,GAAkB,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAA,IAAoB;AACzF,YAAYC,6BAAwB;AACpC,cAAc,eAAe;AAC7B,cAAc,yCAAyC;AACvD,cAAc,CAAA;AACd,gBAAgB,kBAAkB;AAClC,aAAa;;AAEb,YAAY,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC;AACtD,UAAU,OAAO;AACjB,YAAY,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC;AAC3C,UAAU;;AAEV;AACA,UAAU,MAAM,EAAE,uBAAA,EAAwB,GAAI,OAAO;AACrD,UAAU,IAAI,OAAO,uBAAA,KAA4B,UAAU,EAAE;AAC7D,YAAY,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC;AACpD,UAAU;;AAEV,UAAU,OAAO,QAAQ;AACzB,QAAQ,CAAC;AACT,MAAM;;AAEN,MAAM,MAAM,KAAA,GAAQ,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC;;AAElE;AACA,MAAM,KAAK,CAAC,cAAA,GAAiB,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc,EAAE;AAC7D,QAAQ,KAAK,EAAE,UAAU,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;AAChD,UAAU,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7D,QAAQ,CAAC;AACT,OAAO,CAAC;;AAER,MAAM,OAAO,KAAK;AAClB,IAAI,CAAC;AACL;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"tanstackrouter.js","sources":["../../src/tanstackrouter.ts"],"sourcesContent":["import {\n browserTracingIntegration as originalBrowserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport type { VendoredTanstackRouter, VendoredTanstackRouterRouteMatch } from './vendor/tanstackrouter-types';\n\n/**\n * A custom browser tracing integration for TanStack Router.\n *\n * The minimum compatible version of `@tanstack/react-router` is `1.64.0`.\n *\n * @param router A TanStack Router `Router` instance that should be used for routing instrumentation.\n * @param options Sentry browser tracing configuration.\n */\nexport function tanstackRouterBrowserTracingIntegration(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n router: any, // This is `any` because we don't want any type mismatches if TanStack Router changes their types\n options: Parameters<typeof originalBrowserTracingIntegration>[0] = {},\n): Integration {\n const castRouterInstance: VendoredTanstackRouter = router;\n\n const browserTracingIntegrationInstance = originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n instrumentPageLoad: false,\n });\n\n const { instrumentPageLoad = true, instrumentNavigation = true } = options;\n\n return {\n ...browserTracingIntegrationInstance,\n afterAllSetup(client) {\n browserTracingIntegrationInstance.afterAllSetup(client);\n\n const initialWindowLocation = WINDOW.location;\n if (instrumentPageLoad && initialWindowLocation) {\n const matchedRoutes = castRouterInstance.matchRoutes(\n initialWindowLocation.pathname,\n castRouterInstance.options.parseSearch(initialWindowLocation.search),\n { preload: false, throwOnError: false },\n );\n\n const lastMatch = matchedRoutes[matchedRoutes.length - 1];\n\n startBrowserTracingPageLoadSpan(client, {\n name: lastMatch ? lastMatch.routeId : initialWindowLocation.pathname,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.tanstack_router',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: lastMatch ? 'route' : 'url',\n ...routeMatchToParamSpanAttributes(lastMatch),\n },\n });\n }\n\n if (instrumentNavigation) {\n // The onBeforeNavigate hook is called at the very beginning of a navigation and is only called once per navigation, even when the user is redirected\n castRouterInstance.subscribe('onBeforeNavigate', onBeforeNavigateArgs => {\n // onBeforeNavigate is called during pageloads. We can avoid creating navigation spans by comparing the states of the to and from arguments.\n if (onBeforeNavigateArgs.toLocation.state === onBeforeNavigateArgs.fromLocation?.state) {\n return;\n }\n\n const onResolvedMatchedRoutes = castRouterInstance.matchRoutes(\n onBeforeNavigateArgs.toLocation.pathname,\n onBeforeNavigateArgs.toLocation.search,\n { preload: false, throwOnError: false },\n );\n\n const onBeforeNavigateLastMatch = onResolvedMatchedRoutes[onResolvedMatchedRoutes.length - 1];\n\n const navigationLocation = WINDOW.location;\n const navigationSpan = startBrowserTracingNavigationSpan(client, {\n name: onBeforeNavigateLastMatch ? onBeforeNavigateLastMatch.routeId : navigationLocation.pathname,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.tanstack_router',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: onBeforeNavigateLastMatch ? 'route' : 'url',\n },\n });\n\n // In case the user is redirected during navigation we want to update the span with the right value.\n const unsubscribeOnResolved = castRouterInstance.subscribe('onResolved', onResolvedArgs => {\n unsubscribeOnResolved();\n if (navigationSpan) {\n const onResolvedMatchedRoutes = castRouterInstance.matchRoutes(\n onResolvedArgs.toLocation.pathname,\n onResolvedArgs.toLocation.search,\n { preload: false, throwOnError: false },\n );\n\n const onResolvedLastMatch = onResolvedMatchedRoutes[onResolvedMatchedRoutes.length - 1];\n\n if (onResolvedLastMatch) {\n navigationSpan.updateName(onResolvedLastMatch.routeId);\n navigationSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n navigationSpan.setAttributes(routeMatchToParamSpanAttributes(onResolvedLastMatch));\n }\n }\n });\n });\n }\n },\n };\n}\n\nfunction routeMatchToParamSpanAttributes(match: VendoredTanstackRouterRouteMatch | undefined): Record<string, string> {\n if (!match) {\n return {};\n }\n\n const paramAttributes: Record<string, string> = {};\n Object.entries(match.params).forEach(([key, value]) => {\n paramAttributes[`url.path.params.${key}`] = value; // TODO(v11): remove attribute which does not adhere to Sentry's semantic convention\n paramAttributes[`url.path.parameter.${key}`] = value;\n paramAttributes[`params.${key}`] = value; // params.[key] is an alias\n });\n\n return paramAttributes;\n}\n"],"names":["originalBrowserTracingIntegration","WINDOW","startBrowserTracingPageLoadSpan","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","startBrowserTracingNavigationSpan"],"mappings":";;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uCAAuC;AACvD;AACA,EAAE,MAAM;AACR,EAAE,OAAO,GAA4D,EAAE;AACvE,EAAe;AACf,EAAE,MAAM,kBAAkB,GAA2B,MAAM;;AAE3D,EAAE,MAAM,iCAAA,GAAoCA,iCAAiC,CAAC;AAC9E,IAAI,GAAG,OAAO;AACd,IAAI,oBAAoB,EAAE,KAAK;AAC/B,IAAI,kBAAkB,EAAE,KAAK;AAC7B,GAAG,CAAC;;AAEJ,EAAE,MAAM,EAAE,kBAAA,GAAqB,IAAI,EAAE,oBAAA,GAAuB,IAAA,EAAK,GAAI,OAAO;;AAE5E,EAAE,OAAO;AACT,IAAI,GAAG,iCAAiC;AACxC,IAAI,aAAa,CAAC,MAAM,EAAE;AAC1B,MAAM,iCAAiC,CAAC,aAAa,CAAC,MAAM,CAAC;;AAE7D,MAAM,MAAM,qBAAA,GAAwBC,cAAM,CAAC,QAAQ;AACnD,MAAM,IAAI,kBAAA,IAAsB,qBAAqB,EAAE;AACvD,QAAQ,MAAM,aAAA,GAAgB,kBAAkB,CAAC,WAAW;AAC5D,UAAU,qBAAqB,CAAC,QAAQ;AACxC,UAAU,kBAAkB,CAAC,OAAO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O,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACzD,IAAI,eAAe,CAAC,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA,CAAA,GAAA,KAAA,CAAA;AACA,IAAA,eAAA,CAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA,KAAA;AACA,IAAA,eAAA,CAAA,CAAA,OAAA,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA;AACA,GAAA,CAAA;;AAEA,EAAA,OAAA,eAAA;AACA;;;;"}
1
+ {"version":3,"file":"tanstackrouter.js","sources":["../../src/tanstackrouter.ts"],"sourcesContent":["import {\n browserTracingIntegration as originalBrowserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport type { VendoredTanstackRouter, VendoredTanstackRouterRouteMatch } from './vendor/tanstackrouter-types';\n\n/**\n * A custom browser tracing integration for TanStack Router.\n *\n * The minimum compatible version of `@tanstack/react-router` is `1.64.0`.\n *\n * @param router A TanStack Router `Router` instance that should be used for routing instrumentation.\n * @param options Sentry browser tracing configuration.\n */\nexport function tanstackRouterBrowserTracingIntegration(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n router: any, // This is `any` because we don't want any type mismatches if TanStack Router changes their types\n options: Parameters<typeof originalBrowserTracingIntegration>[0] = {},\n): Integration {\n const castRouterInstance: VendoredTanstackRouter = router;\n\n const browserTracingIntegrationInstance = originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n instrumentPageLoad: false,\n });\n\n const { instrumentPageLoad = true, instrumentNavigation = true } = options;\n\n return {\n ...browserTracingIntegrationInstance,\n afterAllSetup(client) {\n browserTracingIntegrationInstance.afterAllSetup(client);\n\n const initialWindowLocation = WINDOW.location;\n if (instrumentPageLoad && initialWindowLocation) {\n const matchedRoutes = castRouterInstance.matchRoutes(\n initialWindowLocation.pathname,\n castRouterInstance.options.parseSearch(initialWindowLocation.search),\n { preload: false, throwOnError: false },\n );\n\n const lastMatch = matchedRoutes[matchedRoutes.length - 1];\n\n startBrowserTracingPageLoadSpan(client, {\n name: lastMatch ? lastMatch.routeId : initialWindowLocation.pathname,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.tanstack_router',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: lastMatch ? 'route' : 'url',\n ...routeMatchToParamSpanAttributes(lastMatch),\n },\n });\n }\n\n if (instrumentNavigation) {\n // The onBeforeNavigate hook is called at the very beginning of a navigation and is only called once per navigation, even when the user is redirected\n castRouterInstance.subscribe('onBeforeNavigate', onBeforeNavigateArgs => {\n // onBeforeNavigate is called during pageloads. We can avoid creating navigation spans by comparing the states of the to and from arguments.\n if (onBeforeNavigateArgs.toLocation.state === onBeforeNavigateArgs.fromLocation?.state) {\n return;\n }\n\n const onResolvedMatchedRoutes = castRouterInstance.matchRoutes(\n onBeforeNavigateArgs.toLocation.pathname,\n onBeforeNavigateArgs.toLocation.search,\n { preload: false, throwOnError: false },\n );\n\n const onBeforeNavigateLastMatch = onResolvedMatchedRoutes[onResolvedMatchedRoutes.length - 1];\n\n const navigationLocation = WINDOW.location;\n const navigationSpan = startBrowserTracingNavigationSpan(client, {\n name: onBeforeNavigateLastMatch ? onBeforeNavigateLastMatch.routeId : navigationLocation.pathname,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.tanstack_router',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: onBeforeNavigateLastMatch ? 'route' : 'url',\n },\n });\n\n // In case the user is redirected during navigation we want to update the span with the right value.\n const unsubscribeOnResolved = castRouterInstance.subscribe('onResolved', onResolvedArgs => {\n unsubscribeOnResolved();\n if (navigationSpan) {\n const onResolvedMatchedRoutes = castRouterInstance.matchRoutes(\n onResolvedArgs.toLocation.pathname,\n onResolvedArgs.toLocation.search,\n { preload: false, throwOnError: false },\n );\n\n const onResolvedLastMatch = onResolvedMatchedRoutes[onResolvedMatchedRoutes.length - 1];\n\n if (onResolvedLastMatch) {\n navigationSpan.updateName(onResolvedLastMatch.routeId);\n navigationSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n navigationSpan.setAttributes(routeMatchToParamSpanAttributes(onResolvedLastMatch));\n }\n }\n });\n });\n }\n },\n };\n}\n\nfunction routeMatchToParamSpanAttributes(match: VendoredTanstackRouterRouteMatch | undefined): Record<string, string> {\n if (!match) {\n return {};\n }\n\n const paramAttributes: Record<string, string> = {};\n Object.entries(match.params).forEach(([key, value]) => {\n paramAttributes[`url.path.params.${key}`] = value; // TODO(v11): remove attribute which does not adhere to Sentry's semantic convention\n paramAttributes[`url.path.parameter.${key}`] = value;\n paramAttributes[`params.${key}`] = value; // params.[key] is an alias\n });\n\n return paramAttributes;\n}\n"],"names":["originalBrowserTracingIntegration","WINDOW","startBrowserTracingPageLoadSpan","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","startBrowserTracingNavigationSpan"],"mappings":";;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uCAAuC;AACvD;AACA,EAAE,MAAM;AACR,EAAE,OAAO,GAA4D,EAAE;AACvE,EAAe;AACf,EAAE,MAAM,kBAAkB,GAA2B,MAAM;;AAE3D,EAAE,MAAM,iCAAA,GAAoCA,iCAAiC,CAAC;AAC9E,IAAI,GAAG,OAAO;AACd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CAAC,CAAC;;AAErG,cAAc,IAAI,mBAAmB,EAAE;AACvC,gBAAgB,cAAc,CAAC,UAAU,CAAC,mBAAmB,CAAC,OAAO,CAAC;AACtE,gBAAgB,cAAc,CAAC,YAAY,CAACA,qCAAgC,EAAE,OAAO,CAAC;AACtF,gBAAgB,cAAc,CAAC,aAAa,CAAC,+BAA+B,CAAC,mBAAmB,CAAC,CAAC;AAClG,cAAc;AACd,YAAY;AACZ,UAAU,CAAC,CAAC;AACZ,QAAQ,CAAC,CAAC;AACV,MAAM;AACN,IAAI,CAAC;AACL,GAAG;AACH;;AAEA,SAAS,+BAA+B,CAAC,KAAK,EAAwE;AACtH,EAAE,IAAI,CAAC,KAAK,EAAE;AACd,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF,EAAE,MAAM,eAAe,GAA2B,EAAE;AACpD,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACzD,IAAI,eAAe,CAAC,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA,CAAA,GAAA,KAAA,CAAA;AACA,IAAA,eAAA,CAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA,KAAA;AACA,IAAA,eAAA,CAAA,CAAA,OAAA,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA;AACA,EAAA,CAAA,CAAA;;AAEA,EAAA,OAAA,eAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sources":["../../src/error.ts"],"sourcesContent":["import { captureException, withScope } from '@sentry/browser';\nimport { isError } from '@sentry/core';\nimport type { ErrorInfo } from 'react';\nimport { version } from 'react';\n\n/**\n * See if React major version is 17+ by parsing version string.\n */\nexport function isAtLeastReact17(reactVersion: string): boolean {\n const reactMajor = reactVersion.match(/^([^.]+)/);\n return reactMajor !== null && parseInt(reactMajor[0]) >= 17;\n}\n\n/**\n * Recurse through `error.cause` chain to set cause on an error.\n */\nexport function setCause(error: Error & { cause?: Error }, cause: Error): void {\n const seenErrors = new WeakSet();\n\n function recurse(error: Error & { cause?: Error }, cause: Error): void {\n // If we've already seen the error, there is a recursive loop somewhere in the error's\n // cause chain. Let's just bail out then to prevent a stack overflow.\n if (seenErrors.has(error)) {\n return;\n }\n if (error.cause) {\n seenErrors.add(error);\n return recurse(error.cause, cause);\n }\n error.cause = cause;\n }\n\n recurse(error, cause);\n}\n\n/**\n * Captures an error that was thrown by a React ErrorBoundary or React root.\n *\n * @param error The error to capture.\n * @param errorInfo The errorInfo provided by React.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureReactException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error: any,\n { componentStack }: ErrorInfo,\n hint?: Parameters<typeof captureException>[1],\n): string {\n // If on React version >= 17, create stack trace from componentStack param and links\n // to to the original error using `error.cause` otherwise relies on error param for stacktrace.\n // Linking errors requires the `LinkedErrors` integration be enabled.\n // See: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#native-component-stacks\n //\n // Although `componentDidCatch` is typed to accept an `Error` object, it can also be invoked\n // with non-error objects. This is why we need to check if the error is an error-like object.\n // See: https://github.com/getsentry/sentry-javascript/issues/6167\n if (isAtLeastReact17(version) && isError(error) && componentStack) {\n const errorBoundaryError = new Error(error.message);\n errorBoundaryError.name = `React ErrorBoundary ${error.name}`;\n errorBoundaryError.stack = componentStack;\n\n // Using the `LinkedErrors` integration to link the errors together.\n setCause(error, errorBoundaryError);\n }\n\n return withScope(scope => {\n scope.setContext('react', { componentStack });\n return captureException(error, hint);\n });\n}\n\n/**\n * Creates an error handler that can be used with the `onCaughtError`, `onUncaughtError`,\n * and `onRecoverableError` options in `createRoot` and `hydrateRoot` React DOM methods.\n *\n * @param callback An optional callback that will be called after the error is captured.\n * Use this to add custom handling for errors.\n *\n * @example\n *\n * ```JavaScript\n * const root = createRoot(container, {\n * onCaughtError: Sentry.reactErrorHandler(),\n * onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {\n * console.warn('Caught error', error, errorInfo.componentStack);\n * });\n * });\n * ```\n */\nexport function reactErrorHandler(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback?: (error: any, errorInfo: ErrorInfo, eventId: string) => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): (error: any, errorInfo: ErrorInfo) => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (error: any, errorInfo: ErrorInfo) => {\n const hasCallback = !!callback;\n const eventId = captureReactException(error, errorInfo, {\n mechanism: { handled: hasCallback, type: 'auto.function.react.error_handler' },\n });\n if (hasCallback) {\n callback(error, errorInfo, eventId);\n }\n };\n}\n"],"names":[],"mappings":";;;;AAKA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,YAAY,EAAmB;AAChE,EAAE,MAAM,aAAa,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC;AACnD,EAAE,OAAO,UAAA,KAAe,IAAA,IAAQ,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,EAAE;AAC7D;;AAEA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,KAAK,EAA6B,KAAK,EAAe;AAC/E,EAAE,MAAM,UAAA,GAAa,IAAI,OAAO,EAAE;;AAElC,EAAE,SAAS,OAAO,CAAC,KAAK,EAA6B,KAAK,EAAe;AACzE;AACA;AACA,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;AAC/B,MAAM;AACN;AACA,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE;AACrB,MAAM,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC;AAC3B,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC;AACxC;AACA,IAAI,KAAK,CAAC,KAAA,GAAQ,KAAK;AACvB;;AAEA,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,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AAA;AACA;;;;"}
1
+ {"version":3,"file":"error.js","sources":["../../src/error.ts"],"sourcesContent":["import { captureException, withScope } from '@sentry/browser';\nimport { isError } from '@sentry/core';\nimport type { ErrorInfo } from 'react';\nimport { version } from 'react';\n\n/**\n * See if React major version is 17+ by parsing version string.\n */\nexport function isAtLeastReact17(reactVersion: string): boolean {\n const reactMajor = reactVersion.match(/^([^.]+)/);\n return reactMajor !== null && parseInt(reactMajor[0]) >= 17;\n}\n\n/**\n * Recurse through `error.cause` chain to set cause on an error.\n */\nexport function setCause(error: Error & { cause?: Error }, cause: Error): void {\n const seenErrors = new WeakSet();\n\n function recurse(error: Error & { cause?: Error }, cause: Error): void {\n // If we've already seen the error, there is a recursive loop somewhere in the error's\n // cause chain. Let's just bail out then to prevent a stack overflow.\n if (seenErrors.has(error)) {\n return;\n }\n if (error.cause) {\n seenErrors.add(error);\n return recurse(error.cause, cause);\n }\n error.cause = cause;\n }\n\n recurse(error, cause);\n}\n\n/**\n * Captures an error that was thrown by a React ErrorBoundary or React root.\n *\n * @param error The error to capture.\n * @param errorInfo The errorInfo provided by React.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nexport function captureReactException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error: any,\n { componentStack }: ErrorInfo,\n hint?: Parameters<typeof captureException>[1],\n): string {\n // If on React version >= 17, create stack trace from componentStack param and links\n // to to the original error using `error.cause` otherwise relies on error param for stacktrace.\n // Linking errors requires the `LinkedErrors` integration be enabled.\n // See: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#native-component-stacks\n //\n // Although `componentDidCatch` is typed to accept an `Error` object, it can also be invoked\n // with non-error objects. This is why we need to check if the error is an error-like object.\n // See: https://github.com/getsentry/sentry-javascript/issues/6167\n if (isAtLeastReact17(version) && isError(error) && componentStack) {\n const errorBoundaryError = new Error(error.message);\n errorBoundaryError.name = `React ErrorBoundary ${error.name}`;\n errorBoundaryError.stack = componentStack;\n\n // Using the `LinkedErrors` integration to link the errors together.\n setCause(error, errorBoundaryError);\n }\n\n return withScope(scope => {\n scope.setContext('react', { componentStack });\n return captureException(error, hint);\n });\n}\n\n/**\n * Creates an error handler that can be used with the `onCaughtError`, `onUncaughtError`,\n * and `onRecoverableError` options in `createRoot` and `hydrateRoot` React DOM methods.\n *\n * @param callback An optional callback that will be called after the error is captured.\n * Use this to add custom handling for errors.\n *\n * @example\n *\n * ```JavaScript\n * const root = createRoot(container, {\n * onCaughtError: Sentry.reactErrorHandler(),\n * onUncaughtError: Sentry.reactErrorHandler((error, errorInfo) => {\n * console.warn('Caught error', error, errorInfo.componentStack);\n * });\n * });\n * ```\n */\nexport function reactErrorHandler(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n callback?: (error: any, errorInfo: ErrorInfo, eventId: string) => void,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): (error: any, errorInfo: ErrorInfo) => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (error: any, errorInfo: ErrorInfo) => {\n const hasCallback = !!callback;\n const eventId = captureReactException(error, errorInfo, {\n mechanism: { handled: hasCallback, type: 'auto.function.react.error_handler' },\n });\n if (hasCallback) {\n callback(error, errorInfo, eventId);\n }\n };\n}\n"],"names":[],"mappings":";;;;AAKA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,YAAY,EAAmB;AAChE,EAAE,MAAM,aAAa,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC;AACnD,EAAE,OAAO,UAAA,KAAe,IAAA,IAAQ,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA,IAAK,EAAE;AAC7D;;AAEA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,KAAK,EAA6B,KAAK,EAAe;AAC/E,EAAE,MAAM,UAAA,GAAa,IAAI,OAAO,EAAE;;AAElC,EAAE,SAAS,OAAO,CAAC,KAAK,EAA6B,KAAK,EAAe;AACzE;AACA;AACA,IAAI,IAAI,UAAU,CAAC,GAAG,CA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,EAAA,SAAA,KAAA;AACA,IAAA,MAAA,WAAA,GAAA,CAAA,CAAA,QAAA;AACA,IAAA,MAAA,OAAA,GAAA,qBAAA,CAAA,KAAA,EAAA,SAAA,EAAA;AACA,MAAA,SAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,IAAA,EAAA,mCAAA,EAAA;AACA,KAAA,CAAA;AACA,IAAA,IAAA,WAAA,EAAA;AACA,MAAA,QAAA,CAAA,KAAA,EAAA,SAAA,EAAA,OAAA,CAAA;AACA,IAAA;AACA,EAAA,CAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorboundary.js","sources":["../../src/errorboundary.tsx"],"sourcesContent":["import type { ReportDialogOptions } from '@sentry/browser';\nimport { getClient, showReportDialog, withScope } from '@sentry/browser';\nimport type { Scope } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport * as React from 'react';\nimport { DEBUG_BUILD } from './debug-build';\nimport { captureReactException } from './error';\nimport { hoistNonReactStatics } from './hoist-non-react-statics';\n\nexport const UNKNOWN_COMPONENT = 'unknown';\n\nexport type FallbackRender = (errorData: {\n error: unknown;\n componentStack: string;\n eventId: string;\n resetError(): void;\n}) => React.ReactElement;\n\ntype OnUnmountType = {\n (error: null, componentStack: null, eventId: null): void;\n (error: unknown, componentStack: string, eventId: string): void;\n};\n\nexport type ErrorBoundaryProps = {\n children?: React.ReactNode | (() => React.ReactNode);\n /** If a Sentry report dialog should be rendered on error */\n showDialog?: boolean | undefined;\n /**\n * Options to be passed into the Sentry report dialog.\n * No-op if {@link showDialog} is false.\n */\n dialogOptions?: ReportDialogOptions | undefined;\n /**\n * A fallback component that gets rendered when the error boundary encounters an error.\n *\n * Can either provide a React Component, or a function that returns React Component as\n * a valid fallback prop. If a function is provided, the function will be called with\n * the error, the component stack, and an function that resets the error boundary on error.\n *\n */\n fallback?: React.ReactElement | FallbackRender | undefined;\n /**\n * If set to `true` or `false`, the error `handled` property will be set to the given value.\n * If unset, the default behaviour is to rely on the presence of the `fallback` prop to determine\n * if the error was handled or not.\n */\n handled?: boolean | undefined;\n /** Called when the error boundary encounters an error */\n onError?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;\n /** Called on componentDidMount() */\n onMount?: (() => void) | undefined;\n /**\n * Called when the error boundary resets due to a reset call from the\n * fallback render props function.\n */\n onReset?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;\n /**\n * Called on componentWillUnmount() with the error, componentStack, and eventId.\n *\n * If the error boundary never encountered an error, the error\n * componentStack, and eventId will be null.\n */\n onUnmount?: OnUnmountType | undefined;\n /** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */\n beforeCapture?: ((scope: Scope, error: unknown, componentStack: string) => void) | undefined;\n};\n\ntype ErrorBoundaryState =\n | {\n componentStack: null;\n error: null;\n eventId: null;\n }\n | {\n componentStack: React.ErrorInfo['componentStack'];\n error: unknown;\n eventId: string;\n };\n\nconst INITIAL_STATE: ErrorBoundaryState = {\n componentStack: null,\n error: null,\n eventId: null,\n};\n\n/**\n * A ErrorBoundary component that logs errors to Sentry.\n * NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the\n * Sentry React SDK ErrorBoundary caught an error invoking your application code. This\n * is expected behavior and NOT indicative of a bug with the Sentry React SDK.\n */\nclass ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state: ErrorBoundaryState;\n\n private readonly _openFallbackReportDialog: boolean;\n\n private _lastEventId?: string;\n private _cleanupHook?: () => void;\n\n public constructor(props: ErrorBoundaryProps) {\n super(props);\n\n this.state = INITIAL_STATE;\n this._openFallbackReportDialog = true;\n\n const client = getClient();\n if (client && props.showDialog) {\n this._openFallbackReportDialog = false;\n this._cleanupHook = client.on('afterSendEvent', event => {\n if (!event.type && this._lastEventId && event.event_id === this._lastEventId) {\n showReportDialog({ ...props.dialogOptions, eventId: this._lastEventId });\n }\n });\n }\n }\n\n public componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void {\n const { componentStack } = errorInfo;\n const { beforeCapture, onError, showDialog, dialogOptions } = this.props;\n withScope(scope => {\n if (beforeCapture) {\n beforeCapture(scope, error, componentStack);\n }\n\n const handled = this.props.handled != null ? this.props.handled : !!this.props.fallback;\n const eventId = captureReactException(error, errorInfo, {\n mechanism: { handled, type: 'auto.function.react.error_boundary' },\n });\n\n if (onError) {\n onError(error, componentStack, eventId);\n }\n if (showDialog) {\n this._lastEventId = eventId;\n if (this._openFallbackReportDialog) {\n showReportDialog({ ...dialogOptions, eventId });\n }\n }\n\n // componentDidCatch is used over getDerivedStateFromError\n // so that componentStack is accessible through state.\n this.setState({ error, componentStack, eventId });\n });\n }\n\n public componentDidMount(): void {\n const { onMount } = this.props;\n if (onMount) {\n onMount();\n }\n }\n\n public componentWillUnmount(): void {\n const { error, componentStack, eventId } = this.state;\n const { onUnmount } = this.props;\n if (onUnmount) {\n if (this.state === INITIAL_STATE) {\n // If the error boundary never encountered an error, call onUnmount with null values\n onUnmount(null, null, null);\n } else {\n // `componentStack` and `eventId` are guaranteed to be non-null here because `onUnmount` is only called\n // when the error boundary has already encountered an error.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onUnmount(error, componentStack!, eventId!);\n }\n }\n\n if (this._cleanupHook) {\n this._cleanupHook();\n this._cleanupHook = undefined;\n }\n }\n\n public resetErrorBoundary(): void {\n const { onReset } = this.props;\n const { error, componentStack, eventId } = this.state;\n if (onReset) {\n // `componentStack` and `eventId` are guaranteed to be non-null here because `onReset` is only called\n // when the error boundary has already encountered an error.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onReset(error, componentStack!, eventId!);\n }\n this.setState(INITIAL_STATE);\n }\n\n public render(): React.ReactNode {\n const { fallback, children } = this.props;\n const state = this.state;\n\n // `componentStack` is only null in the initial state, when no error has been captured.\n // If an error has been captured, `componentStack` will be a string.\n // We cannot check `state.error` because null can be thrown as an error.\n if (state.componentStack === null) {\n return typeof children === 'function' ? children() : children;\n }\n\n const element =\n typeof fallback === 'function'\n ? React.createElement(fallback, {\n error: state.error,\n componentStack: state.componentStack,\n resetError: () => this.resetErrorBoundary(),\n eventId: state.eventId,\n })\n : fallback;\n\n if (React.isValidElement(element)) {\n return element;\n }\n\n if (fallback) {\n DEBUG_BUILD && debug.warn('fallback did not produce a valid ReactElement');\n }\n\n // Fail gracefully if no fallback provided or is not valid\n return null;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withErrorBoundary<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n errorBoundaryOptions: ErrorBoundaryProps,\n): React.FC<P> {\n const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;\n\n const Wrapped = React.memo((props: P) => (\n <ErrorBoundary {...errorBoundaryOptions}>\n <WrappedComponent {...props} />\n </ErrorBoundary>\n )) as unknown as React.FC<P>;\n\n Wrapped.displayName = `errorBoundary(${componentDisplayName})`;\n\n // Copy over static methods from Wrapped component to Profiler HOC\n // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over\n hoistNonReactStatics(Wrapped, WrappedComponent);\n return Wrapped;\n}\n\nexport { ErrorBoundary, withErrorBoundary };\n"],"names":[],"mappings":";;;;;;;AASO,MAAM,iBAAA,GAAoB;;AAsEjC,MAAM,aAAa,GAAuB;AAC1C,EAAE,cAAc,EAAE,IAAI;AACtB,EAAE,KAAK,EAAE,IAAI;AACb,EAAE,OAAO,EAAE,IAAI;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAA,SAAsB,KAAK,CAAC,SAAS,CAAyC;;AAQpF,GAAS,WAAW,CAAC,KAAK,EAAsB;AAChD,IAAI,KAAK,CAAC,KAAK,CAAC;;AAEhB,IAAI,IAAI,CAAC,KAAA,GAAQ,aAAa;AAC9B,IAAI,IAAI,CAAC,yBAAA,GAA4B,IAAI;;AAEzC,IAAI,MAAM,MAAA,GAAS,SAAS,EAAE;AAC9B,IAAI,IAAI,MAAA,IAAU,KA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iB,GAAI,KAAK;AACjC;AACA,GAAG,CAAA;;AAEH,EAAE,OAAO,CAAC,WAAA,GAAc,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC,CAAC;;AAEhE;AACA;AACA,EAAE,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,CAAC;AACjD,EAAE,OAAO,OAAO;AAChB;;;;"}
1
+ {"version":3,"file":"errorboundary.js","sources":["../../src/errorboundary.tsx"],"sourcesContent":["import type { ReportDialogOptions } from '@sentry/browser';\nimport { getClient, showReportDialog, withScope } from '@sentry/browser';\nimport type { Scope } from '@sentry/core';\nimport { debug } from '@sentry/core';\nimport * as React from 'react';\nimport { DEBUG_BUILD } from './debug-build';\nimport { captureReactException } from './error';\nimport { hoistNonReactStatics } from './hoist-non-react-statics';\n\nexport const UNKNOWN_COMPONENT = 'unknown';\n\nexport type FallbackRender = (errorData: {\n error: unknown;\n componentStack: string;\n eventId: string;\n resetError(): void;\n}) => React.ReactElement;\n\ntype OnUnmountType = {\n (error: null, componentStack: null, eventId: null): void;\n (error: unknown, componentStack: string, eventId: string): void;\n};\n\nexport type ErrorBoundaryProps = {\n children?: React.ReactNode | (() => React.ReactNode);\n /** If a Sentry report dialog should be rendered on error */\n showDialog?: boolean | undefined;\n /**\n * Options to be passed into the Sentry report dialog.\n * No-op if {@link showDialog} is false.\n */\n dialogOptions?: ReportDialogOptions | undefined;\n /**\n * A fallback component that gets rendered when the error boundary encounters an error.\n *\n * Can either provide a React Component, or a function that returns React Component as\n * a valid fallback prop. If a function is provided, the function will be called with\n * the error, the component stack, and an function that resets the error boundary on error.\n *\n */\n fallback?: React.ReactElement | FallbackRender | undefined;\n /**\n * If set to `true` or `false`, the error `handled` property will be set to the given value.\n * If unset, the default behaviour is to rely on the presence of the `fallback` prop to determine\n * if the error was handled or not.\n */\n handled?: boolean | undefined;\n /** Called when the error boundary encounters an error */\n onError?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;\n /** Called on componentDidMount() */\n onMount?: (() => void) | undefined;\n /**\n * Called when the error boundary resets due to a reset call from the\n * fallback render props function.\n */\n onReset?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;\n /**\n * Called on componentWillUnmount() with the error, componentStack, and eventId.\n *\n * If the error boundary never encountered an error, the error\n * componentStack, and eventId will be null.\n */\n onUnmount?: OnUnmountType | undefined;\n /** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */\n beforeCapture?: ((scope: Scope, error: unknown, componentStack: string) => void) | undefined;\n};\n\ntype ErrorBoundaryState =\n | {\n componentStack: null;\n error: null;\n eventId: null;\n }\n | {\n componentStack: React.ErrorInfo['componentStack'];\n error: unknown;\n eventId: string;\n };\n\nconst INITIAL_STATE: ErrorBoundaryState = {\n componentStack: null,\n error: null,\n eventId: null,\n};\n\n/**\n * A ErrorBoundary component that logs errors to Sentry.\n * NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the\n * Sentry React SDK ErrorBoundary caught an error invoking your application code. This\n * is expected behavior and NOT indicative of a bug with the Sentry React SDK.\n */\nclass ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {\n public state: ErrorBoundaryState;\n\n private readonly _openFallbackReportDialog: boolean;\n\n private _lastEventId?: string;\n private _cleanupHook?: () => void;\n\n public constructor(props: ErrorBoundaryProps) {\n super(props);\n\n this.state = INITIAL_STATE;\n this._openFallbackReportDialog = true;\n\n const client = getClient();\n if (client && props.showDialog) {\n this._openFallbackReportDialog = false;\n this._cleanupHook = client.on('afterSendEvent', event => {\n if (!event.type && this._lastEventId && event.event_id === this._lastEventId) {\n showReportDialog({ ...props.dialogOptions, eventId: this._lastEventId });\n }\n });\n }\n }\n\n public componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void {\n const { componentStack } = errorInfo;\n const { beforeCapture, onError, showDialog, dialogOptions } = this.props;\n withScope(scope => {\n if (beforeCapture) {\n beforeCapture(scope, error, componentStack);\n }\n\n const handled = this.props.handled != null ? this.props.handled : !!this.props.fallback;\n const eventId = captureReactException(error, errorInfo, {\n mechanism: { handled, type: 'auto.function.react.error_boundary' },\n });\n\n if (onError) {\n onError(error, componentStack, eventId);\n }\n if (showDialog) {\n this._lastEventId = eventId;\n if (this._openFallbackReportDialog) {\n showReportDialog({ ...dialogOptions, eventId });\n }\n }\n\n // componentDidCatch is used over getDerivedStateFromError\n // so that componentStack is accessible through state.\n this.setState({ error, componentStack, eventId });\n });\n }\n\n public componentDidMount(): void {\n const { onMount } = this.props;\n if (onMount) {\n onMount();\n }\n }\n\n public componentWillUnmount(): void {\n const { error, componentStack, eventId } = this.state;\n const { onUnmount } = this.props;\n if (onUnmount) {\n if (this.state === INITIAL_STATE) {\n // If the error boundary never encountered an error, call onUnmount with null values\n onUnmount(null, null, null);\n } else {\n // `componentStack` and `eventId` are guaranteed to be non-null here because `onUnmount` is only called\n // when the error boundary has already encountered an error.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onUnmount(error, componentStack!, eventId!);\n }\n }\n\n if (this._cleanupHook) {\n this._cleanupHook();\n this._cleanupHook = undefined;\n }\n }\n\n public resetErrorBoundary(): void {\n const { onReset } = this.props;\n const { error, componentStack, eventId } = this.state;\n if (onReset) {\n // `componentStack` and `eventId` are guaranteed to be non-null here because `onReset` is only called\n // when the error boundary has already encountered an error.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n onReset(error, componentStack!, eventId!);\n }\n this.setState(INITIAL_STATE);\n }\n\n public render(): React.ReactNode {\n const { fallback, children } = this.props;\n const state = this.state;\n\n // `componentStack` is only null in the initial state, when no error has been captured.\n // If an error has been captured, `componentStack` will be a string.\n // We cannot check `state.error` because null can be thrown as an error.\n if (state.componentStack === null) {\n return typeof children === 'function' ? children() : children;\n }\n\n const element =\n typeof fallback === 'function'\n ? React.createElement(fallback, {\n error: state.error,\n componentStack: state.componentStack,\n resetError: () => this.resetErrorBoundary(),\n eventId: state.eventId,\n })\n : fallback;\n\n if (React.isValidElement(element)) {\n return element;\n }\n\n if (fallback) {\n DEBUG_BUILD && debug.warn('fallback did not produce a valid ReactElement');\n }\n\n // Fail gracefully if no fallback provided or is not valid\n return null;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withErrorBoundary<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n errorBoundaryOptions: ErrorBoundaryProps,\n): React.FC<P> {\n const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;\n\n const Wrapped = React.memo((props: P) => (\n <ErrorBoundary {...errorBoundaryOptions}>\n <WrappedComponent {...props} />\n </ErrorBoundary>\n )) as unknown as React.FC<P>;\n\n Wrapped.displayName = `errorBoundary(${componentDisplayName})`;\n\n // Copy over static methods from Wrapped component to Profiler HOC\n // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over\n hoistNonReactStatics(Wrapped, WrappedComponent);\n return Wrapped;\n}\n\nexport { ErrorBoundary, withErrorBoundary };\n"],"names":[],"mappings":";;;;;;;AASO,MAAM,iBAAA,GAAoB;;AAsEjC,MAAM,aAAa,GAAuB;AAC1C,EAAE,cAAc,EAAE,IAAI;AACtB,EAAE,KAAK,EAAE,IAAI;AACb,EAAE,OAAO,EAAE,IAAI;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAA,SAAsB,KAAK,CAAC,SAAS,CAAyC;;AAQpF,GAAS,WAAW,CAAC,KAAK,EAAsB;AAChD,IAAI,KAAK,CAAC,KAAK,CAAC;;AAEhB,IAAI,IAAI,CAAC,KAAA,GAAQ,aAAa;AAC9B,IAAI,IAAI,CAAC,yBAAA,GAA4B,IAAI;;AAEzC,IAAI,MAAM,MAAA,GAAS,SAAS,EAAE;AAC9B,IAAI,IAAI,MAAA,IAAU,KAAK,CAAC,UAAU,EAAE;AACpC,MAAM,IAAI,CAAC,yBAAA,GAA4B,KAAK;AAC5C,MAAM,IAAI,CAAC,YAAA,GAAe,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,KAA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,EAAiB,GAAI,KAAK;AACjC;AACA,GAAG,CAAA;;AAEH,EAAE,OAAO,CAAC,WAAA,GAAc,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC,CAAC;;AAEhE;AACA;AACA,EAAE,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,CAAC;AACjD,EAAE,OAAO,OAAO;AAChB;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.23.0","sideEffects":false}
1
+ {"type":"module","version":"10.25.0","sideEffects":false}
@@ -1 +1 @@
1
- {"version":3,"file":"profiler.js","sources":["../../src/profiler.tsx"],"sourcesContent":["import { startInactiveSpan } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON, timestampInSeconds, withActiveSpan } from '@sentry/core';\nimport * as React from 'react';\nimport { REACT_MOUNT_OP, REACT_RENDER_OP, REACT_UPDATE_OP } from './constants';\nimport { hoistNonReactStatics } from './hoist-non-react-statics';\n\nexport const UNKNOWN_COMPONENT = 'unknown';\n\nexport type ProfilerProps = {\n // The name of the component being profiled.\n name: string;\n // If the Profiler is disabled. False by default. This is useful if you want to disable profilers\n // in certain environments.\n disabled?: boolean;\n // If time component is on page should be displayed as spans. True by default.\n includeRender?: boolean;\n // If component updates should be displayed as spans. True by default.\n includeUpdates?: boolean;\n // Component that is being profiled.\n children?: React.ReactNode;\n // props given to component being profiled.\n updateProps: { [key: string]: unknown };\n};\n\n/**\n * The Profiler component leverages Sentry's Tracing integration to generate\n * spans based on component lifecycles.\n */\nclass Profiler extends React.Component<ProfilerProps> {\n /**\n * The span of the mount activity\n * Made protected for the React Native SDK to access\n */\n protected _mountSpan: Span | undefined;\n /**\n * The span that represents the duration of time between shouldComponentUpdate and componentDidUpdate\n */\n protected _updateSpan: Span | undefined;\n\n public constructor(props: ProfilerProps) {\n super(props);\n const { name, disabled = false } = this.props;\n\n if (disabled) {\n return;\n }\n\n this._mountSpan = startInactiveSpan({\n name: `<${name}>`,\n onlyIfParent: true,\n op: REACT_MOUNT_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n }\n\n // If a component mounted, we can finish the mount activity.\n public componentDidMount(): void {\n if (this._mountSpan) {\n this._mountSpan.end();\n }\n }\n\n public shouldComponentUpdate({ updateProps, includeUpdates = true }: ProfilerProps): boolean {\n // Only generate an update span if includeUpdates is true, if there is a valid mountSpan,\n // and if the updateProps have changed. It is ok to not do a deep equality check here as it is expensive.\n // We are just trying to give baseline clues for further investigation.\n if (includeUpdates && this._mountSpan && updateProps !== this.props.updateProps) {\n // See what props have changed between the previous props, and the current props. This is\n // set as data on the span. We just store the prop keys as the values could be potentially very large.\n const changedProps = Object.keys(updateProps).filter(k => updateProps[k] !== this.props.updateProps[k]);\n if (changedProps.length > 0) {\n const now = timestampInSeconds();\n this._updateSpan = withActiveSpan(this._mountSpan, () => {\n return startInactiveSpan({\n name: `<${this.props.name}>`,\n onlyIfParent: true,\n op: REACT_UPDATE_OP,\n startTime: now,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': this.props.name,\n 'ui.react.changed_props': changedProps,\n },\n });\n });\n }\n }\n\n return true;\n }\n\n public componentDidUpdate(): void {\n if (this._updateSpan) {\n this._updateSpan.end();\n this._updateSpan = undefined;\n }\n }\n\n // If a component is unmounted, we can say it is no longer on the screen.\n // This means we can finish the span representing the component render.\n public componentWillUnmount(): void {\n const endTimestamp = timestampInSeconds();\n const { name, includeRender = true } = this.props;\n\n if (this._mountSpan && includeRender) {\n const startTime = spanToJSON(this._mountSpan).timestamp;\n withActiveSpan(this._mountSpan, () => {\n const renderSpan = startInactiveSpan({\n onlyIfParent: true,\n name: `<${name}>`,\n op: REACT_RENDER_OP,\n startTime,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n if (renderSpan) {\n // Have to cast to Span because the type of _mountSpan is Span | undefined\n // and not getting narrowed properly\n renderSpan.end(endTimestamp);\n }\n });\n }\n }\n\n public render(): React.ReactNode {\n return this.props.children;\n }\n}\n\n// React.Component default props are defined as static property on the class\nObject.assign(Profiler, {\n defaultProps: {\n disabled: false,\n includeRender: true,\n includeUpdates: true,\n },\n});\n\n/**\n * withProfiler is a higher order component that wraps a\n * component in a {@link Profiler} component. It is recommended that\n * the higher order component be used over the regular {@link Profiler} component.\n *\n * @param WrappedComponent component that is wrapped by Profiler\n * @param options the {@link ProfilerProps} you can pass into the Profiler\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withProfiler<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n // We do not want to have `updateProps` given in options, it is instead filled through the HOC.\n options?: Pick<Partial<ProfilerProps>, Exclude<keyof ProfilerProps, 'updateProps' | 'children'>>,\n): React.FC<P> {\n const componentDisplayName =\n options?.name || WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;\n\n const Wrapped: React.FC<P> = (props: P) => (\n <Profiler {...options} name={componentDisplayName} updateProps={props}>\n <WrappedComponent {...props} />\n </Profiler>\n );\n\n Wrapped.displayName = `profiler(${componentDisplayName})`;\n\n // Copy over static methods from Wrapped component to Profiler HOC\n // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over\n hoistNonReactStatics(Wrapped, WrappedComponent);\n return Wrapped;\n}\n\n/**\n *\n * `useProfiler` is a React hook that profiles a React component.\n *\n * Requires React 16.8 or above.\n * @param name displayName of component being profiled\n */\nfunction useProfiler(\n name: string,\n options: { disabled?: boolean; hasRenderSpan?: boolean } = {\n disabled: false,\n hasRenderSpan: true,\n },\n): void {\n const [mountSpan] = React.useState(() => {\n if (options?.disabled) {\n return undefined;\n }\n\n return startInactiveSpan({\n name: `<${name}>`,\n onlyIfParent: true,\n op: REACT_MOUNT_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n });\n\n React.useEffect(() => {\n if (mountSpan) {\n mountSpan.end();\n }\n\n return (): void => {\n if (mountSpan && options.hasRenderSpan) {\n const startTime = spanToJSON(mountSpan).timestamp;\n const endTimestamp = timestampInSeconds();\n\n const renderSpan = startInactiveSpan({\n name: `<${name}>`,\n onlyIfParent: true,\n op: REACT_RENDER_OP,\n startTime,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n if (renderSpan) {\n // Have to cast to Span because the type of _mountSpan is Span | undefined\n // and not getting narrowed properly\n renderSpan.end(endTimestamp);\n }\n }\n };\n // We only want this to run once.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n\nexport { Profiler, useProfiler, withProfiler };\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,iBAAA,GAAoB;;AAkBjC;AACA;AACA;AACA;AACA,MAAM,QAAA,SAAiB,KAAK,CAAC,SAAS,CAAgB;AACtD;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA,GAAS,WAAW,CAAC,KAAK,EAAiB;AAC3C,IAAI,KAAK,CAAC,KAAK,CAAC;AAChB,IAAI,MAAM,EAAE,IAAI,EAAE,QAAA,GAAW,KAAA,EAAM,GAAI,IAAI,CAAC,KAAK;;AAEjD,IAAI,IAAI,QAAQ,EAAE;AAClB,MAAM;AACN;;AAEA,IAAI,IAAI,CAAC,UAAA,GAAa,iBAAiB,CAAC;AACxC,MAAM,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvB,MAAM,YAAY,EAAE,IAAI;AACxB,MAAM,EAAE,EAAE,cAAc;AACxB,MAAM,UAAU,EAAE;AAClB,QAAQ,CAAC,gCAAgC,GAAG,wBAAwB;AACpE,QAAQ,mBAAmB,EAAE,IAAI;AACjC,O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AI;AACjC,OAAO;AACP,KAAK,CAAC;AACN,GAAG,CAAC;;AAEJ,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;AACxB,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,SAAS,CAAC,GAAG,EAAE;AACrB;;AAEA,IAAI,OAAO,MAAY;AACvB,MAAM,IAAI,SAAA,IAAa,OAAO,CAAC,aAAa,EAAE;AAC9C,QAAQ,MAAM,YAAY,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS;AACzD,QAAQ,MAAM,YAAA,GAAe,kBAAkB,EAAE;;AAEjD,QAAQ,MAAM,UAAA,GAAa,iBAAiB,CAAC;AAC7C,UAAU,IAAI,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC3B,UAAU,YAAY,EAAE,IAAI;AAC5B,UAAU,EAAE,EAAE,eAAe;AAC7B,UAAU,SAAS;AACnB,UAAU,UAAU,EAAE;AACtB,YAAY,CAAC,gCAAgC,GAAG,wBAAwB;AACxE,YAAY,mBAAmB,EAAE,IAAI;AACrC,WAAW;AACX,SAAS,CAAC;AACV,QAAQ,IAAI,UAAU,EAAE;AACxB;AACA;AACA,UAAU,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;AACtC;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG,EAAE,EAAE,CAAC;AACR;;;;"}
1
+ {"version":3,"file":"profiler.js","sources":["../../src/profiler.tsx"],"sourcesContent":["import { startInactiveSpan } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON, timestampInSeconds, withActiveSpan } from '@sentry/core';\nimport * as React from 'react';\nimport { REACT_MOUNT_OP, REACT_RENDER_OP, REACT_UPDATE_OP } from './constants';\nimport { hoistNonReactStatics } from './hoist-non-react-statics';\n\nexport const UNKNOWN_COMPONENT = 'unknown';\n\nexport type ProfilerProps = {\n // The name of the component being profiled.\n name: string;\n // If the Profiler is disabled. False by default. This is useful if you want to disable profilers\n // in certain environments.\n disabled?: boolean;\n // If time component is on page should be displayed as spans. True by default.\n includeRender?: boolean;\n // If component updates should be displayed as spans. True by default.\n includeUpdates?: boolean;\n // Component that is being profiled.\n children?: React.ReactNode;\n // props given to component being profiled.\n updateProps: { [key: string]: unknown };\n};\n\n/**\n * The Profiler component leverages Sentry's Tracing integration to generate\n * spans based on component lifecycles.\n */\nclass Profiler extends React.Component<ProfilerProps> {\n /**\n * The span of the mount activity\n * Made protected for the React Native SDK to access\n */\n protected _mountSpan: Span | undefined;\n /**\n * The span that represents the duration of time between shouldComponentUpdate and componentDidUpdate\n */\n protected _updateSpan: Span | undefined;\n\n public constructor(props: ProfilerProps) {\n super(props);\n const { name, disabled = false } = this.props;\n\n if (disabled) {\n return;\n }\n\n this._mountSpan = startInactiveSpan({\n name: `<${name}>`,\n onlyIfParent: true,\n op: REACT_MOUNT_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n }\n\n // If a component mounted, we can finish the mount activity.\n public componentDidMount(): void {\n if (this._mountSpan) {\n this._mountSpan.end();\n }\n }\n\n public shouldComponentUpdate({ updateProps, includeUpdates = true }: ProfilerProps): boolean {\n // Only generate an update span if includeUpdates is true, if there is a valid mountSpan,\n // and if the updateProps have changed. It is ok to not do a deep equality check here as it is expensive.\n // We are just trying to give baseline clues for further investigation.\n if (includeUpdates && this._mountSpan && updateProps !== this.props.updateProps) {\n // See what props have changed between the previous props, and the current props. This is\n // set as data on the span. We just store the prop keys as the values could be potentially very large.\n const changedProps = Object.keys(updateProps).filter(k => updateProps[k] !== this.props.updateProps[k]);\n if (changedProps.length > 0) {\n const now = timestampInSeconds();\n this._updateSpan = withActiveSpan(this._mountSpan, () => {\n return startInactiveSpan({\n name: `<${this.props.name}>`,\n onlyIfParent: true,\n op: REACT_UPDATE_OP,\n startTime: now,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': this.props.name,\n 'ui.react.changed_props': changedProps,\n },\n });\n });\n }\n }\n\n return true;\n }\n\n public componentDidUpdate(): void {\n if (this._updateSpan) {\n this._updateSpan.end();\n this._updateSpan = undefined;\n }\n }\n\n // If a component is unmounted, we can say it is no longer on the screen.\n // This means we can finish the span representing the component render.\n public componentWillUnmount(): void {\n const endTimestamp = timestampInSeconds();\n const { name, includeRender = true } = this.props;\n\n if (this._mountSpan && includeRender) {\n const startTime = spanToJSON(this._mountSpan).timestamp;\n withActiveSpan(this._mountSpan, () => {\n const renderSpan = startInactiveSpan({\n onlyIfParent: true,\n name: `<${name}>`,\n op: REACT_RENDER_OP,\n startTime,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n if (renderSpan) {\n // Have to cast to Span because the type of _mountSpan is Span | undefined\n // and not getting narrowed properly\n renderSpan.end(endTimestamp);\n }\n });\n }\n }\n\n public render(): React.ReactNode {\n return this.props.children;\n }\n}\n\n// React.Component default props are defined as static property on the class\nObject.assign(Profiler, {\n defaultProps: {\n disabled: false,\n includeRender: true,\n includeUpdates: true,\n },\n});\n\n/**\n * withProfiler is a higher order component that wraps a\n * component in a {@link Profiler} component. It is recommended that\n * the higher order component be used over the regular {@link Profiler} component.\n *\n * @param WrappedComponent component that is wrapped by Profiler\n * @param options the {@link ProfilerProps} you can pass into the Profiler\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withProfiler<P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n // We do not want to have `updateProps` given in options, it is instead filled through the HOC.\n options?: Pick<Partial<ProfilerProps>, Exclude<keyof ProfilerProps, 'updateProps' | 'children'>>,\n): React.FC<P> {\n const componentDisplayName =\n options?.name || WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;\n\n const Wrapped: React.FC<P> = (props: P) => (\n <Profiler {...options} name={componentDisplayName} updateProps={props}>\n <WrappedComponent {...props} />\n </Profiler>\n );\n\n Wrapped.displayName = `profiler(${componentDisplayName})`;\n\n // Copy over static methods from Wrapped component to Profiler HOC\n // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over\n hoistNonReactStatics(Wrapped, WrappedComponent);\n return Wrapped;\n}\n\n/**\n *\n * `useProfiler` is a React hook that profiles a React component.\n *\n * Requires React 16.8 or above.\n * @param name displayName of component being profiled\n */\nfunction useProfiler(\n name: string,\n options: { disabled?: boolean; hasRenderSpan?: boolean } = {\n disabled: false,\n hasRenderSpan: true,\n },\n): void {\n const [mountSpan] = React.useState(() => {\n if (options?.disabled) {\n return undefined;\n }\n\n return startInactiveSpan({\n name: `<${name}>`,\n onlyIfParent: true,\n op: REACT_MOUNT_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n });\n\n React.useEffect(() => {\n if (mountSpan) {\n mountSpan.end();\n }\n\n return (): void => {\n if (mountSpan && options.hasRenderSpan) {\n const startTime = spanToJSON(mountSpan).timestamp;\n const endTimestamp = timestampInSeconds();\n\n const renderSpan = startInactiveSpan({\n name: `<${name}>`,\n onlyIfParent: true,\n op: REACT_RENDER_OP,\n startTime,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler',\n 'ui.component_name': name,\n },\n });\n if (renderSpan) {\n // Have to cast to Span because the type of _mountSpan is Span | undefined\n // and not getting narrowed properly\n renderSpan.end(endTimestamp);\n }\n }\n };\n // We only want this to run once.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n}\n\nexport { Profiler, useProfiler, withProfiler };\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,iBAAA,GAAoB;;AAkBjC;AACA;AACA;AACA;AACA,MAAM,QAAA,SAAiB,KAAK,CAAC,SAAS,CAAgB;AACtD;AACA;AACA;AACA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C,GAAG,wBAAwB;AACxE,YAAY,mBAAmB,EAAE,IAAI;AACrC,WAAW;AACX,SAAS,CAAC;AACV,QAAQ,IAAI,UAAU,EAAE;AACxB;AACA;AACA,UAAU,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;AACtC,QAAQ;AACR,MAAM;AACN,IAAI,CAAC;AACL;AACA;AACA,EAAE,CAAC,EAAE,EAAE,CAAC;AACR;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../src/reactrouter-compat-utils/instrumentation.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n// Inspired from Donnie McNeal's solution:\n// https://gist.github.com/wontondon/e8c4bdf2888875e4c755712e99279536\n\nimport {\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Client, Integration, Span } from '@sentry/core';\nimport {\n addNonEnumerableProperty,\n debug,\n getActiveSpan,\n getClient,\n getCurrentScope,\n getRootSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n spanToJSON,\n} from '@sentry/core';\nimport * as React from 'react';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { hoistNonReactStatics } from '../hoist-non-react-statics';\nimport type {\n Action,\n AgnosticDataRouteMatch,\n CreateRouterFunction,\n CreateRoutesFromChildren,\n Location,\n MatchRoutes,\n RouteMatch,\n RouteObject,\n Router,\n RouterState,\n UseEffect,\n UseLocation,\n UseNavigationType,\n UseRoutes,\n} from '../types';\nimport { checkRouteForAsyncHandler } from './lazy-routes';\nimport { initializeRouterUtils, resolveRouteNameAndSource } from './utils';\n\nlet _useEffect: UseEffect;\nlet _useLocation: UseLocation;\nlet _useNavigationType: UseNavigationType;\nlet _createRoutesFromChildren: CreateRoutesFromChildren;\nlet _matchRoutes: MatchRoutes;\nlet _enableAsyncRouteHandlers: boolean = false;\n\nconst CLIENTS_WITH_INSTRUMENT_NAVIGATION = new WeakSet<Client>();\n\n/**\n * Adds resolved routes as children to the parent route.\n * Prevents duplicate routes by checking if they already exist.\n */\nexport function addResolvedRoutesToParent(resolvedRoutes: RouteObject[], parentRoute: RouteObject): void {\n const existingChildren = parentRoute.children || [];\n\n const newRoutes = resolvedRoutes.filter(\n newRoute =>\n !existingChildren.some(\n existing =>\n existing === newRoute ||\n (newRoute.path && existing.path === newRoute.path) ||\n (newRoute.id && existing.id === newRoute.id),\n ),\n );\n\n if (newRoutes.length > 0) {\n parentRoute.children = [...existingChildren, ...newRoutes];\n }\n}\n\nexport interface ReactRouterOptions {\n useEffect: UseEffect;\n useLocation: UseLocation;\n useNavigationType: UseNavigationType;\n createRoutesFromChildren: CreateRoutesFromChildren;\n matchRoutes: MatchRoutes;\n /**\n * Whether to strip the basename from the pathname when creating transactions.\n *\n * This is useful for applications that use a basename in their routing setup.\n * @default false\n */\n stripBasename?: boolean;\n /**\n * Enables support for async route handlers.\n *\n * This allows Sentry to track and instrument routes dynamically resolved from async handlers.\n * @default false\n */\n enableAsyncRouteHandlers?: boolean;\n}\n\ntype V6CompatibleVersion = '6' | '7';\n\n// Keeping as a global variable for cross-usage in multiple functions\n// only exported for testing purposes\nexport const allRoutes = new Set<RouteObject>();\n\n/**\n * Processes resolved routes by adding them to allRoutes and checking for nested async handlers.\n */\nexport function processResolvedRoutes(\n resolvedRoutes: RouteObject[],\n parentRoute?: RouteObject,\n currentLocation: Location | null = null,\n): void {\n resolvedRoutes.forEach(child => {\n allRoutes.add(child);\n // Only check for async handlers if the feature is enabled\n if (_enableAsyncRouteHandlers) {\n checkRouteForAsyncHandler(child, processResolvedRoutes);\n }\n });\n\n if (parentRoute) {\n // If a parent route is provided, add the resolved routes as children to the parent route\n addResolvedRoutesToParent(resolvedRoutes, parentRoute);\n }\n\n // After processing lazy routes, check if we need to update an active transaction\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan) {\n const spanOp = spanToJSON(activeRootSpan).op;\n\n // Try to use the provided location first, then fall back to global window location if needed\n let location = currentLocation;\n if (!location) {\n if (typeof WINDOW !== 'undefined') {\n const globalLocation = WINDOW.location;\n if (globalLocation) {\n location = { pathname: globalLocation.pathname };\n }\n }\n }\n\n if (location) {\n if (spanOp === 'pageload') {\n // Re-run the pageload transaction update with the newly loaded routes\n updatePageloadTransaction({\n activeRootSpan,\n location: { pathname: location.pathname },\n routes: Array.from(allRoutes),\n allRoutes: Array.from(allRoutes),\n });\n } else if (spanOp === 'navigation') {\n // For navigation spans, update the name with the newly loaded routes\n updateNavigationSpan(activeRootSpan, location, Array.from(allRoutes), false, _matchRoutes);\n }\n }\n }\n}\n\n/**\n * Updates a navigation span with the correct route name after lazy routes have been loaded.\n */\nexport function updateNavigationSpan(\n activeRootSpan: Span,\n location: Location,\n allRoutes: RouteObject[],\n forceUpdate = false,\n matchRoutes: MatchRoutes,\n): void {\n // Check if this span has already been named to avoid multiple updates\n // But allow updates if this is a forced update (e.g., when lazy routes are loaded)\n const hasBeenNamed =\n !forceUpdate && (activeRootSpan as { __sentry_navigation_name_set__?: boolean })?.__sentry_navigation_name_set__;\n\n if (!hasBeenNamed) {\n // Get fresh branches for the current location with all loaded routes\n const currentBranches = matchRoutes(allRoutes, location);\n const [name, source] = resolveRouteNameAndSource(\n location,\n allRoutes,\n allRoutes,\n (currentBranches as RouteMatch[]) || [],\n '',\n );\n\n // Only update if we have a valid name and the span hasn't finished\n const spanJson = spanToJSON(activeRootSpan);\n if (name && !spanJson.timestamp) {\n activeRootSpan.updateName(name);\n activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n\n // Mark this span as having its name set to prevent future updates\n addNonEnumerableProperty(\n activeRootSpan as { __sentry_navigation_name_set__?: boolean },\n '__sentry_navigation_name_set__',\n true,\n );\n }\n }\n}\n\n/**\n * Creates a wrapCreateBrowserRouter function that can be used with all React Router v6 compatible versions.\n */\nexport function createV6CompatibleWrapCreateBrowserRouter<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(\n createRouterFunction: CreateRouterFunction<TState, TRouter>,\n version: V6CompatibleVersion,\n): CreateRouterFunction<TState, TRouter> {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(\n `reactRouterV${version}Instrumentation was unable to wrap the \\`createRouter\\` function because of one or more missing parameters.`,\n );\n\n return createRouterFunction;\n }\n\n return function (routes: RouteObject[], opts?: Record<string, unknown> & { basename?: string }): TRouter {\n addRoutesToAllRoutes(routes);\n\n // Check for async handlers that might contain sub-route declarations (only if enabled)\n if (_enableAsyncRouteHandlers) {\n for (const route of routes) {\n checkRouteForAsyncHandler(route, processResolvedRoutes);\n }\n }\n\n // Wrap patchRoutesOnNavigation to detect when lazy routes are loaded\n const wrappedOpts = wrapPatchRoutesOnNavigation(opts);\n\n const router = createRouterFunction(routes, wrappedOpts);\n const basename = opts?.basename;\n\n const activeRootSpan = getActiveRootSpan();\n\n // Track whether we've completed the initial pageload to properly distinguish\n // between POPs that occur during pageload vs. legitimate back/forward navigation.\n let isInitialPageloadComplete = false;\n let hasSeenPageloadSpan = !!activeRootSpan && spanToJSON(activeRootSpan).op === 'pageload';\n let hasSeenPopAfterPageload = false;\n\n // The initial load ends when `createBrowserRouter` is called.\n // This is the earliest convenient time to update the transaction name.\n // Callbacks to `router.subscribe` are not called for the initial load.\n if (router.state.historyAction === 'POP' && activeRootSpan) {\n updatePageloadTransaction({\n activeRootSpan,\n location: router.state.location,\n routes,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n }\n\n router.subscribe((state: RouterState) => {\n // Track pageload completion to distinguish POPs during pageload from legitimate back/forward navigation\n if (!isInitialPageloadComplete) {\n const currentRootSpan = getActiveRootSpan();\n const isCurrentlyInPageload = currentRootSpan && spanToJSON(currentRootSpan).op === 'pageload';\n\n if (isCurrentlyInPageload) {\n hasSeenPageloadSpan = true;\n } else if (hasSeenPageloadSpan) {\n // Pageload span was active but is now gone - pageload has completed\n if (state.historyAction === 'POP' && !hasSeenPopAfterPageload) {\n // Pageload ended: ignore the first POP after pageload\n hasSeenPopAfterPageload = true;\n } else {\n // Pageload ended: either non-POP action or subsequent POP\n isInitialPageloadComplete = true;\n }\n }\n // If we haven't seen a pageload span yet, keep waiting (don't mark as complete)\n }\n\n const shouldHandleNavigation =\n state.historyAction === 'PUSH' || (state.historyAction === 'POP' && isInitialPageloadComplete);\n\n if (shouldHandleNavigation) {\n const navigationHandler = (): void => {\n handleNavigation({\n location: state.location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n };\n\n // Wait for the next render if loading an unsettled route\n if (state.navigation.state !== 'idle') {\n requestAnimationFrame(navigationHandler);\n } else {\n navigationHandler();\n }\n }\n });\n\n return router;\n };\n}\n\n/**\n * Creates a wrapCreateMemoryRouter function that can be used with all React Router v6 compatible versions.\n */\nexport function createV6CompatibleWrapCreateMemoryRouter<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(\n createRouterFunction: CreateRouterFunction<TState, TRouter>,\n version: V6CompatibleVersion,\n): CreateRouterFunction<TState, TRouter> {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(\n `reactRouterV${version}Instrumentation was unable to wrap the \\`createMemoryRouter\\` function because of one or more missing parameters.`,\n );\n\n return createRouterFunction;\n }\n\n return function (\n routes: RouteObject[],\n opts?: Record<string, unknown> & {\n basename?: string;\n initialEntries?: (string | { pathname: string })[];\n initialIndex?: number;\n },\n ): TRouter {\n addRoutesToAllRoutes(routes);\n\n // Check for async handlers that might contain sub-route declarations (only if enabled)\n if (_enableAsyncRouteHandlers) {\n for (const route of routes) {\n checkRouteForAsyncHandler(route, processResolvedRoutes);\n }\n }\n\n // Wrap patchRoutesOnNavigation to detect when lazy routes are loaded\n const wrappedOpts = wrapPatchRoutesOnNavigation(opts, true);\n\n const router = createRouterFunction(routes, wrappedOpts);\n const basename = opts?.basename;\n\n let initialEntry = undefined;\n\n const initialEntries = opts?.initialEntries;\n const initialIndex = opts?.initialIndex;\n\n const hasOnlyOneInitialEntry = initialEntries && initialEntries.length === 1;\n const hasIndexedEntry = initialIndex !== undefined && initialEntries && initialEntries[initialIndex];\n\n initialEntry = hasOnlyOneInitialEntry\n ? initialEntries[0]\n : hasIndexedEntry\n ? initialEntries[initialIndex]\n : undefined;\n\n const location = initialEntry\n ? typeof initialEntry === 'string'\n ? { pathname: initialEntry }\n : initialEntry\n : router.state.location;\n\n const memoryActiveRootSpan = getActiveRootSpan();\n\n if (router.state.historyAction === 'POP' && memoryActiveRootSpan) {\n updatePageloadTransaction({\n activeRootSpan: memoryActiveRootSpan,\n location,\n routes,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n }\n\n // Track whether we've completed the initial pageload to properly distinguish\n // between POPs that occur during pageload vs. legitimate back/forward navigation.\n let isInitialPageloadComplete = false;\n let hasSeenPageloadSpan = !!memoryActiveRootSpan && spanToJSON(memoryActiveRootSpan).op === 'pageload';\n let hasSeenPopAfterPageload = false;\n\n router.subscribe((state: RouterState) => {\n // Track pageload completion to distinguish POPs during pageload from legitimate back/forward navigation\n if (!isInitialPageloadComplete) {\n const currentRootSpan = getActiveRootSpan();\n const isCurrentlyInPageload = currentRootSpan && spanToJSON(currentRootSpan).op === 'pageload';\n\n if (isCurrentlyInPageload) {\n hasSeenPageloadSpan = true;\n } else if (hasSeenPageloadSpan) {\n // Pageload span was active but is now gone - pageload has completed\n if (state.historyAction === 'POP' && !hasSeenPopAfterPageload) {\n // Pageload ended: ignore the first POP after pageload\n hasSeenPopAfterPageload = true;\n } else {\n // Pageload ended: either non-POP action or subsequent POP\n isInitialPageloadComplete = true;\n }\n }\n // If we haven't seen a pageload span yet, keep waiting (don't mark as complete)\n }\n\n const location = state.location;\n\n const shouldHandleNavigation =\n state.historyAction === 'PUSH' || (state.historyAction === 'POP' && isInitialPageloadComplete);\n\n if (shouldHandleNavigation) {\n const navigationHandler = (): void => {\n handleNavigation({\n location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n };\n\n // Wait for the next render if loading an unsettled route\n if (state.navigation.state !== 'idle') {\n requestAnimationFrame(navigationHandler);\n } else {\n navigationHandler();\n }\n }\n });\n\n return router;\n };\n}\n\n/**\n * Creates a browser tracing integration that can be used with all React Router v6 compatible versions.\n */\nexport function createReactRouterV6CompatibleTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n version: V6CompatibleVersion,\n): Integration {\n const integration = browserTracingIntegration({ ...options, instrumentPageLoad: false, instrumentNavigation: false });\n\n const {\n useEffect,\n useLocation,\n useNavigationType,\n createRoutesFromChildren,\n matchRoutes,\n stripBasename,\n enableAsyncRouteHandlers = false,\n instrumentPageLoad = true,\n instrumentNavigation = true,\n } = options;\n\n return {\n ...integration,\n setup(client) {\n integration.setup(client);\n\n _useEffect = useEffect;\n _useLocation = useLocation;\n _useNavigationType = useNavigationType;\n _matchRoutes = matchRoutes;\n _createRoutesFromChildren = createRoutesFromChildren;\n _enableAsyncRouteHandlers = enableAsyncRouteHandlers;\n\n // Initialize the router utils with the required dependencies\n initializeRouterUtils(matchRoutes, stripBasename || false);\n },\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n const initPathName = WINDOW.location?.pathname;\n if (instrumentPageLoad && initPathName) {\n startBrowserTracingPageLoadSpan(client, {\n name: initPathName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.pageload.react.reactrouter_v${version}`,\n },\n });\n }\n\n if (instrumentNavigation) {\n CLIENTS_WITH_INSTRUMENT_NAVIGATION.add(client);\n }\n },\n };\n}\n\nexport function createV6CompatibleWrapUseRoutes(origUseRoutes: UseRoutes, version: V6CompatibleVersion): UseRoutes {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(\n 'reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.',\n );\n\n return origUseRoutes;\n }\n\n const SentryRoutes: React.FC<{\n children?: React.ReactNode;\n routes: RouteObject[];\n locationArg?: Partial<Location> | string;\n }> = (props: { children?: React.ReactNode; routes: RouteObject[]; locationArg?: Partial<Location> | string }) => {\n const isMountRenderPass = React.useRef(true);\n const { routes, locationArg } = props;\n\n const Routes = origUseRoutes(routes, locationArg);\n\n const location = _useLocation();\n const navigationType = _useNavigationType();\n\n // A value with stable identity to either pick `locationArg` if available or `location` if not\n const stableLocationParam =\n typeof locationArg === 'string' || locationArg?.pathname ? (locationArg as { pathname: string }) : location;\n\n _useEffect(() => {\n const normalizedLocation =\n typeof stableLocationParam === 'string' ? { pathname: stableLocationParam } : stableLocationParam;\n\n if (isMountRenderPass.current) {\n addRoutesToAllRoutes(routes);\n\n updatePageloadTransaction({\n activeRootSpan: getActiveRootSpan(),\n location: normalizedLocation,\n routes,\n allRoutes: Array.from(allRoutes),\n });\n isMountRenderPass.current = false;\n } else {\n handleNavigation({\n location: normalizedLocation,\n routes,\n navigationType,\n version,\n allRoutes: Array.from(allRoutes),\n });\n }\n }, [navigationType, stableLocationParam]);\n\n return Routes;\n };\n\n // eslint-disable-next-line react/display-name\n return (routes: RouteObject[], locationArg?: Partial<Location> | string): React.ReactElement | null => {\n return <SentryRoutes routes={routes} locationArg={locationArg} />;\n };\n}\n\nfunction wrapPatchRoutesOnNavigation(\n opts: Record<string, unknown> | undefined,\n isMemoryRouter = false,\n): Record<string, unknown> {\n if (!opts || !('patchRoutesOnNavigation' in opts) || typeof opts.patchRoutesOnNavigation !== 'function') {\n return opts || {};\n }\n\n const originalPatchRoutes = opts.patchRoutesOnNavigation;\n return {\n ...opts,\n patchRoutesOnNavigation: async (args: unknown) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const targetPath = (args as any)?.path;\n\n // For browser router, wrap the patch function to update span during patching\n if (!isMemoryRouter) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const originalPatch = (args as any)?.patch;\n if (originalPatch) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n (args as any).patch = (routeId: string, children: RouteObject[]) => {\n addRoutesToAllRoutes(children);\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan && (spanToJSON(activeRootSpan) as { op?: string }).op === 'navigation') {\n updateNavigationSpan(\n activeRootSpan,\n { pathname: targetPath, search: '', hash: '', state: null, key: 'default' },\n Array.from(allRoutes),\n true, // forceUpdate = true since we're loading lazy routes\n _matchRoutes,\n );\n }\n return originalPatch(routeId, children);\n };\n }\n }\n\n const result = await originalPatchRoutes(args);\n\n // Update navigation span after routes are patched\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan && (spanToJSON(activeRootSpan) as { op?: string }).op === 'navigation') {\n // Determine pathname based on router type\n let pathname: string | undefined;\n if (isMemoryRouter) {\n // For memory routers, only use targetPath\n pathname = targetPath;\n } else {\n // For browser routers, use targetPath or fall back to window.location\n pathname = targetPath || WINDOW.location?.pathname;\n }\n\n if (pathname) {\n updateNavigationSpan(\n activeRootSpan,\n { pathname, search: '', hash: '', state: null, key: 'default' },\n Array.from(allRoutes),\n false, // forceUpdate = false since this is after lazy routes are loaded\n _matchRoutes,\n );\n }\n }\n\n return result;\n },\n };\n}\n\nexport function handleNavigation(opts: {\n location: Location;\n routes: RouteObject[];\n navigationType: Action;\n version: V6CompatibleVersion;\n matches?: AgnosticDataRouteMatch;\n basename?: string;\n allRoutes?: RouteObject[];\n}): void {\n const { location, routes, navigationType, version, matches, basename, allRoutes } = opts;\n const branches = Array.isArray(matches) ? matches : _matchRoutes(routes, location, basename);\n\n const client = getClient();\n if (!client || !CLIENTS_WITH_INSTRUMENT_NAVIGATION.has(client)) {\n return;\n }\n\n // Avoid starting a navigation span on initial load when a pageload root span is active.\n // This commonly happens when lazy routes resolve during the first render and React Router emits a POP.\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan && spanToJSON(activeRootSpan).op === 'pageload' && navigationType === 'POP') {\n return;\n }\n\n if ((navigationType === 'PUSH' || navigationType === 'POP') && branches) {\n const [name, source] = resolveRouteNameAndSource(\n location,\n routes,\n allRoutes || routes,\n branches as RouteMatch[],\n basename,\n );\n\n const activeSpan = getActiveSpan();\n const spanJson = activeSpan && spanToJSON(activeSpan);\n const isAlreadyInNavigationSpan = spanJson?.op === 'navigation';\n\n // Cross usage can result in multiple navigation spans being created without this check\n if (!isAlreadyInNavigationSpan) {\n const navigationSpan = startBrowserTracingNavigationSpan(client, {\n name,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.navigation.react.reactrouter_v${version}`,\n },\n });\n\n // Patch navigation span to handle early cancellation (e.g., document.hidden)\n if (navigationSpan) {\n patchNavigationSpanEnd(navigationSpan, location, routes, basename, allRoutes);\n }\n }\n }\n}\n\n/* Only exported for testing purposes */\nexport function addRoutesToAllRoutes(routes: RouteObject[]): void {\n routes.forEach(route => {\n const extractedChildRoutes = getChildRoutesRecursively(route);\n\n extractedChildRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n}\n\nfunction getChildRoutesRecursively(route: RouteObject, allRoutes: Set<RouteObject> = new Set()): Set<RouteObject> {\n if (!allRoutes.has(route)) {\n allRoutes.add(route);\n\n if (route.children && !route.index) {\n route.children.forEach(child => {\n const childRoutes = getChildRoutesRecursively(child, allRoutes);\n\n childRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n }\n }\n\n return allRoutes;\n}\n\nfunction updatePageloadTransaction({\n activeRootSpan,\n location,\n routes,\n matches,\n basename,\n allRoutes,\n}: {\n activeRootSpan: Span | undefined;\n location: Location;\n routes: RouteObject[];\n matches?: AgnosticDataRouteMatch;\n basename?: string;\n allRoutes?: RouteObject[];\n}): void {\n const branches = Array.isArray(matches)\n ? matches\n : (_matchRoutes(allRoutes || routes, location, basename) as unknown as RouteMatch[]);\n\n if (branches) {\n const [name, source] = resolveRouteNameAndSource(location, routes, allRoutes || routes, branches, basename);\n\n getCurrentScope().setTransactionName(name || '/');\n\n if (activeRootSpan) {\n activeRootSpan.updateName(name);\n activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n\n // Patch span.end() to ensure we update the name one last time before the span is sent\n patchPageloadSpanEnd(activeRootSpan, location, routes, basename, allRoutes);\n }\n }\n}\n\n/**\n * Patches the span.end() method to update the transaction name one last time before the span is sent.\n * This handles cases where the span is cancelled early (e.g., document.hidden) before lazy routes have finished loading.\n */\nfunction patchSpanEnd(\n span: Span,\n location: Location,\n routes: RouteObject[],\n basename: string | undefined,\n _allRoutes: RouteObject[] | undefined,\n spanType: 'pageload' | 'navigation',\n): void {\n const patchedPropertyName = `__sentry_${spanType}_end_patched__` as const;\n const hasEndBeenPatched = (span as unknown as Record<string, boolean | undefined>)?.[patchedPropertyName];\n\n if (hasEndBeenPatched || !span.end) {\n return;\n }\n\n const originalEnd = span.end.bind(span);\n\n span.end = function patchedEnd(...args) {\n try {\n // Only update if the span source is not already 'route' (i.e., it hasn't been parameterized yet)\n const spanJson = spanToJSON(span);\n const currentSource = spanJson.data?.[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (currentSource !== 'route') {\n // Last chance to update the transaction name with the latest route info\n // Use the live global allRoutes Set to include any lazy routes loaded after patching\n const currentAllRoutes = Array.from(allRoutes);\n const branches = _matchRoutes(\n currentAllRoutes.length > 0 ? currentAllRoutes : routes,\n location,\n basename,\n ) as unknown as RouteMatch[];\n\n if (branches) {\n const [name, source] = resolveRouteNameAndSource(\n location,\n routes,\n currentAllRoutes.length > 0 ? currentAllRoutes : routes,\n branches,\n basename,\n );\n\n // Only update if we have a valid name\n if (name && (spanType === 'pageload' || !spanJson.timestamp)) {\n span.updateName(name);\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n }\n }\n } catch (error) {\n // Silently catch errors to ensure span.end() is always called\n DEBUG_BUILD && debug.warn(`Error updating span details before ending: ${error}`);\n }\n\n return originalEnd(...args);\n };\n\n // Mark this span as having its end() method patched to prevent duplicate patching\n addNonEnumerableProperty(span as unknown as Record<string, boolean>, patchedPropertyName, true);\n}\n\nfunction patchPageloadSpanEnd(\n span: Span,\n location: Location,\n routes: RouteObject[],\n basename: string | undefined,\n _allRoutes: RouteObject[] | undefined,\n): void {\n patchSpanEnd(span, location, routes, basename, _allRoutes, 'pageload');\n}\n\nfunction patchNavigationSpanEnd(\n span: Span,\n location: Location,\n routes: RouteObject[],\n basename: string | undefined,\n _allRoutes: RouteObject[] | undefined,\n): void {\n patchSpanEnd(span, location, routes, basename, _allRoutes, 'navigation');\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createV6CompatibleWithSentryReactRouterRouting<P extends Record<string, any>, R extends React.FC<P>>(\n Routes: R,\n version: V6CompatibleVersion,\n): R {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_createRoutesFromChildren || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.\n useEffect: ${_useEffect}. useLocation: ${_useLocation}. useNavigationType: ${_useNavigationType}.\n createRoutesFromChildren: ${_createRoutesFromChildren}. matchRoutes: ${_matchRoutes}.`);\n\n return Routes;\n }\n\n const SentryRoutes: React.FC<P> = (props: P) => {\n const isMountRenderPass = React.useRef(true);\n\n const location = _useLocation();\n const navigationType = _useNavigationType();\n\n _useEffect(\n () => {\n const routes = _createRoutesFromChildren(props.children) as RouteObject[];\n\n if (isMountRenderPass.current) {\n addRoutesToAllRoutes(routes);\n\n updatePageloadTransaction({\n activeRootSpan: getActiveRootSpan(),\n location,\n routes,\n allRoutes: Array.from(allRoutes),\n });\n isMountRenderPass.current = false;\n } else {\n handleNavigation({ location, routes, navigationType, version, allRoutes: Array.from(allRoutes) });\n }\n },\n // `props.children` is purposely not included in the dependency array, because we do not want to re-run this effect\n // when the children change. We only want to start transactions when the location or navigation type change.\n [location, navigationType],\n );\n\n // @ts-expect-error 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-expect-error 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\nfunction getActiveRootSpan(): Span | undefined {\n const span = getActiveSpan();\n const rootSpan = span ? getRootSpan(span) : undefined;\n\n if (!rootSpan) {\n return undefined;\n }\n\n const op = spanToJSON(rootSpan).op;\n\n // Only use this root span if it is a pageload or navigation span\n return op === 'navigation' || op === 'pageload' ? rootSpan : undefined;\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;;;AA2CA,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,kBAAkB;AACtB,IAAI,yBAAyB;AAC7B,IAAI,YAAY;AAChB,IAAI,yBAAyB,GAAY,KAAK;;AAE9C,MAAM,kCAAA,GAAqC,IAAI,OAAO,EAAU;;AAEhE;AACA;AACA;AACA;AACO,SAAS,yBAAyB,CAAC,cAAc,EAAiB,WAAW,EAAqB;AACzG,EAAE,MAAM,mBAAmB,WAAW,CAAC,QAAA,IAAY,EAAE;;AAErD,EAAE,MAAM,SAAA,GAAY,cAAc,CAAC,MAAM;AACzC,IAAI,QAAA;AACJ,MAAM,CAAC,gBAAgB,CAAC,IAAI;AAC5B,QAAQ,QAAA;AACR,UAAU,QAAA,KAAa,QAAA;AACvB,WAAW,QAAQ,CAAC,IAAA,IAAQ,QAAQ,CAAC,IAA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A,GAAA;;AAEA,EAAA,oBAAA,CAAA,YAAA,EAAA,MAAA,CAAA;;AAEA;AACA;AACA,EAAA,OAAA,YAAA;AACA;;AAEA,SAAA,iBAAA,GAAA;AACA,EAAA,MAAA,IAAA,GAAA,aAAA,EAAA;AACA,EAAA,MAAA,QAAA,GAAA,IAAA,GAAA,WAAA,CAAA,IAAA,CAAA,GAAA,SAAA;;AAEA,EAAA,IAAA,CAAA,QAAA,EAAA;AACA,IAAA,OAAA,SAAA;AACA;;AAEA,EAAA,MAAA,EAAA,GAAA,UAAA,CAAA,QAAA,CAAA,CAAA,EAAA;;AAEA;AACA,EAAA,OAAA,EAAA,KAAA,YAAA,IAAA,EAAA,KAAA,UAAA,GAAA,QAAA,GAAA,SAAA;AACA;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../src/reactrouter-compat-utils/instrumentation.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n// Inspired from Donnie McNeal's solution:\n// https://gist.github.com/wontondon/e8c4bdf2888875e4c755712e99279536\n\nimport {\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Client, Integration, Span } from '@sentry/core';\nimport {\n addNonEnumerableProperty,\n debug,\n getActiveSpan,\n getClient,\n getCurrentScope,\n getRootSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n spanToJSON,\n} from '@sentry/core';\nimport * as React from 'react';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { hoistNonReactStatics } from '../hoist-non-react-statics';\nimport type {\n Action,\n AgnosticDataRouteMatch,\n CreateRouterFunction,\n CreateRoutesFromChildren,\n Location,\n MatchRoutes,\n RouteMatch,\n RouteObject,\n Router,\n RouterState,\n UseEffect,\n UseLocation,\n UseNavigationType,\n UseRoutes,\n} from '../types';\nimport { checkRouteForAsyncHandler } from './lazy-routes';\nimport { initializeRouterUtils, resolveRouteNameAndSource } from './utils';\n\nlet _useEffect: UseEffect;\nlet _useLocation: UseLocation;\nlet _useNavigationType: UseNavigationType;\nlet _createRoutesFromChildren: CreateRoutesFromChildren;\nlet _matchRoutes: MatchRoutes;\nlet _enableAsyncRouteHandlers: boolean = false;\n\nconst CLIENTS_WITH_INSTRUMENT_NAVIGATION = new WeakSet<Client>();\n\n/**\n * Adds resolved routes as children to the parent route.\n * Prevents duplicate routes by checking if they already exist.\n */\nexport function addResolvedRoutesToParent(resolvedRoutes: RouteObject[], parentRoute: RouteObject): void {\n const existingChildren = parentRoute.children || [];\n\n const newRoutes = resolvedRoutes.filter(\n newRoute =>\n !existingChildren.some(\n existing =>\n existing === newRoute ||\n (newRoute.path && existing.path === newRoute.path) ||\n (newRoute.id && existing.id === newRoute.id),\n ),\n );\n\n if (newRoutes.length > 0) {\n parentRoute.children = [...existingChildren, ...newRoutes];\n }\n}\n\nexport interface ReactRouterOptions {\n useEffect: UseEffect;\n useLocation: UseLocation;\n useNavigationType: UseNavigationType;\n createRoutesFromChildren: CreateRoutesFromChildren;\n matchRoutes: MatchRoutes;\n /**\n * Whether to strip the basename from the pathname when creating transactions.\n *\n * This is useful for applications that use a basename in their routing setup.\n * @default false\n */\n stripBasename?: boolean;\n /**\n * Enables support for async route handlers.\n *\n * This allows Sentry to track and instrument routes dynamically resolved from async handlers.\n * @default false\n */\n enableAsyncRouteHandlers?: boolean;\n}\n\ntype V6CompatibleVersion = '6' | '7';\n\n// Keeping as a global variable for cross-usage in multiple functions\n// only exported for testing purposes\nexport const allRoutes = new Set<RouteObject>();\n\n/**\n * Processes resolved routes by adding them to allRoutes and checking for nested async handlers.\n */\nexport function processResolvedRoutes(\n resolvedRoutes: RouteObject[],\n parentRoute?: RouteObject,\n currentLocation: Location | null = null,\n): void {\n resolvedRoutes.forEach(child => {\n allRoutes.add(child);\n // Only check for async handlers if the feature is enabled\n if (_enableAsyncRouteHandlers) {\n checkRouteForAsyncHandler(child, processResolvedRoutes);\n }\n });\n\n if (parentRoute) {\n // If a parent route is provided, add the resolved routes as children to the parent route\n addResolvedRoutesToParent(resolvedRoutes, parentRoute);\n }\n\n // After processing lazy routes, check if we need to update an active transaction\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan) {\n const spanOp = spanToJSON(activeRootSpan).op;\n\n // Try to use the provided location first, then fall back to global window location if needed\n let location = currentLocation;\n if (!location) {\n if (typeof WINDOW !== 'undefined') {\n const globalLocation = WINDOW.location;\n if (globalLocation) {\n location = { pathname: globalLocation.pathname };\n }\n }\n }\n\n if (location) {\n if (spanOp === 'pageload') {\n // Re-run the pageload transaction update with the newly loaded routes\n updatePageloadTransaction({\n activeRootSpan,\n location: { pathname: location.pathname },\n routes: Array.from(allRoutes),\n allRoutes: Array.from(allRoutes),\n });\n } else if (spanOp === 'navigation') {\n // For navigation spans, update the name with the newly loaded routes\n updateNavigationSpan(activeRootSpan, location, Array.from(allRoutes), false, _matchRoutes);\n }\n }\n }\n}\n\n/**\n * Updates a navigation span with the correct route name after lazy routes have been loaded.\n */\nexport function updateNavigationSpan(\n activeRootSpan: Span,\n location: Location,\n allRoutes: RouteObject[],\n forceUpdate = false,\n matchRoutes: MatchRoutes,\n): void {\n // Check if this span has already been named to avoid multiple updates\n // But allow updates if this is a forced update (e.g., when lazy routes are loaded)\n const hasBeenNamed =\n !forceUpdate && (activeRootSpan as { __sentry_navigation_name_set__?: boolean })?.__sentry_navigation_name_set__;\n\n if (!hasBeenNamed) {\n // Get fresh branches for the current location with all loaded routes\n const currentBranches = matchRoutes(allRoutes, location);\n const [name, source] = resolveRouteNameAndSource(\n location,\n allRoutes,\n allRoutes,\n (currentBranches as RouteMatch[]) || [],\n '',\n );\n\n // Only update if we have a valid name and the span hasn't finished\n const spanJson = spanToJSON(activeRootSpan);\n if (name && !spanJson.timestamp) {\n activeRootSpan.updateName(name);\n activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n\n // Mark this span as having its name set to prevent future updates\n addNonEnumerableProperty(\n activeRootSpan as { __sentry_navigation_name_set__?: boolean },\n '__sentry_navigation_name_set__',\n true,\n );\n }\n }\n}\n\n/**\n * Creates a wrapCreateBrowserRouter function that can be used with all React Router v6 compatible versions.\n */\nexport function createV6CompatibleWrapCreateBrowserRouter<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(\n createRouterFunction: CreateRouterFunction<TState, TRouter>,\n version: V6CompatibleVersion,\n): CreateRouterFunction<TState, TRouter> {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(\n `reactRouterV${version}Instrumentation was unable to wrap the \\`createRouter\\` function because of one or more missing parameters.`,\n );\n\n return createRouterFunction;\n }\n\n return function (routes: RouteObject[], opts?: Record<string, unknown> & { basename?: string }): TRouter {\n addRoutesToAllRoutes(routes);\n\n // Check for async handlers that might contain sub-route declarations (only if enabled)\n if (_enableAsyncRouteHandlers) {\n for (const route of routes) {\n checkRouteForAsyncHandler(route, processResolvedRoutes);\n }\n }\n\n // Wrap patchRoutesOnNavigation to detect when lazy routes are loaded\n const wrappedOpts = wrapPatchRoutesOnNavigation(opts);\n\n const router = createRouterFunction(routes, wrappedOpts);\n const basename = opts?.basename;\n\n const activeRootSpan = getActiveRootSpan();\n\n // Track whether we've completed the initial pageload to properly distinguish\n // between POPs that occur during pageload vs. legitimate back/forward navigation.\n let isInitialPageloadComplete = false;\n let hasSeenPageloadSpan = !!activeRootSpan && spanToJSON(activeRootSpan).op === 'pageload';\n let hasSeenPopAfterPageload = false;\n\n // The initial load ends when `createBrowserRouter` is called.\n // This is the earliest convenient time to update the transaction name.\n // Callbacks to `router.subscribe` are not called for the initial load.\n if (router.state.historyAction === 'POP' && activeRootSpan) {\n updatePageloadTransaction({\n activeRootSpan,\n location: router.state.location,\n routes,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n }\n\n router.subscribe((state: RouterState) => {\n // Track pageload completion to distinguish POPs during pageload from legitimate back/forward navigation\n if (!isInitialPageloadComplete) {\n const currentRootSpan = getActiveRootSpan();\n const isCurrentlyInPageload = currentRootSpan && spanToJSON(currentRootSpan).op === 'pageload';\n\n if (isCurrentlyInPageload) {\n hasSeenPageloadSpan = true;\n } else if (hasSeenPageloadSpan) {\n // Pageload span was active but is now gone - pageload has completed\n if (state.historyAction === 'POP' && !hasSeenPopAfterPageload) {\n // Pageload ended: ignore the first POP after pageload\n hasSeenPopAfterPageload = true;\n } else {\n // Pageload ended: either non-POP action or subsequent POP\n isInitialPageloadComplete = true;\n }\n }\n // If we haven't seen a pageload span yet, keep waiting (don't mark as complete)\n }\n\n const shouldHandleNavigation =\n state.historyAction === 'PUSH' || (state.historyAction === 'POP' && isInitialPageloadComplete);\n\n if (shouldHandleNavigation) {\n const navigationHandler = (): void => {\n handleNavigation({\n location: state.location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n };\n\n // Wait for the next render if loading an unsettled route\n if (state.navigation.state !== 'idle') {\n requestAnimationFrame(navigationHandler);\n } else {\n navigationHandler();\n }\n }\n });\n\n return router;\n };\n}\n\n/**\n * Creates a wrapCreateMemoryRouter function that can be used with all React Router v6 compatible versions.\n */\nexport function createV6CompatibleWrapCreateMemoryRouter<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(\n createRouterFunction: CreateRouterFunction<TState, TRouter>,\n version: V6CompatibleVersion,\n): CreateRouterFunction<TState, TRouter> {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(\n `reactRouterV${version}Instrumentation was unable to wrap the \\`createMemoryRouter\\` function because of one or more missing parameters.`,\n );\n\n return createRouterFunction;\n }\n\n return function (\n routes: RouteObject[],\n opts?: Record<string, unknown> & {\n basename?: string;\n initialEntries?: (string | { pathname: string })[];\n initialIndex?: number;\n },\n ): TRouter {\n addRoutesToAllRoutes(routes);\n\n // Check for async handlers that might contain sub-route declarations (only if enabled)\n if (_enableAsyncRouteHandlers) {\n for (const route of routes) {\n checkRouteForAsyncHandler(route, processResolvedRoutes);\n }\n }\n\n // Wrap patchRoutesOnNavigation to detect when lazy routes are loaded\n const wrappedOpts = wrapPatchRoutesOnNavigation(opts, true);\n\n const router = createRouterFunction(routes, wrappedOpts);\n const basename = opts?.basename;\n\n let initialEntry = undefined;\n\n const initialEntries = opts?.initialEntries;\n const initialIndex = opts?.initialIndex;\n\n const hasOnlyOneInitialEntry = initialEntries && initialEntries.length === 1;\n const hasIndexedEntry = initialIndex !== undefined && initialEntries && initialEntries[initialIndex];\n\n initialEntry = hasOnlyOneInitialEntry\n ? initialEntries[0]\n : hasIndexedEntry\n ? initialEntries[initialIndex]\n : undefined;\n\n const location = initialEntry\n ? typeof initialEntry === 'string'\n ? { pathname: initialEntry }\n : initialEntry\n : router.state.location;\n\n const memoryActiveRootSpan = getActiveRootSpan();\n\n if (router.state.historyAction === 'POP' && memoryActiveRootSpan) {\n updatePageloadTransaction({\n activeRootSpan: memoryActiveRootSpan,\n location,\n routes,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n }\n\n // Track whether we've completed the initial pageload to properly distinguish\n // between POPs that occur during pageload vs. legitimate back/forward navigation.\n let isInitialPageloadComplete = false;\n let hasSeenPageloadSpan = !!memoryActiveRootSpan && spanToJSON(memoryActiveRootSpan).op === 'pageload';\n let hasSeenPopAfterPageload = false;\n\n router.subscribe((state: RouterState) => {\n // Track pageload completion to distinguish POPs during pageload from legitimate back/forward navigation\n if (!isInitialPageloadComplete) {\n const currentRootSpan = getActiveRootSpan();\n const isCurrentlyInPageload = currentRootSpan && spanToJSON(currentRootSpan).op === 'pageload';\n\n if (isCurrentlyInPageload) {\n hasSeenPageloadSpan = true;\n } else if (hasSeenPageloadSpan) {\n // Pageload span was active but is now gone - pageload has completed\n if (state.historyAction === 'POP' && !hasSeenPopAfterPageload) {\n // Pageload ended: ignore the first POP after pageload\n hasSeenPopAfterPageload = true;\n } else {\n // Pageload ended: either non-POP action or subsequent POP\n isInitialPageloadComplete = true;\n }\n }\n // If we haven't seen a pageload span yet, keep waiting (don't mark as complete)\n }\n\n const location = state.location;\n\n const shouldHandleNavigation =\n state.historyAction === 'PUSH' || (state.historyAction === 'POP' && isInitialPageloadComplete);\n\n if (shouldHandleNavigation) {\n const navigationHandler = (): void => {\n handleNavigation({\n location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\n allRoutes: Array.from(allRoutes),\n });\n };\n\n // Wait for the next render if loading an unsettled route\n if (state.navigation.state !== 'idle') {\n requestAnimationFrame(navigationHandler);\n } else {\n navigationHandler();\n }\n }\n });\n\n return router;\n };\n}\n\n/**\n * Creates a browser tracing integration that can be used with all React Router v6 compatible versions.\n */\nexport function createReactRouterV6CompatibleTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n version: V6CompatibleVersion,\n): Integration {\n const integration = browserTracingIntegration({ ...options, instrumentPageLoad: false, instrumentNavigation: false });\n\n const {\n useEffect,\n useLocation,\n useNavigationType,\n createRoutesFromChildren,\n matchRoutes,\n stripBasename,\n enableAsyncRouteHandlers = false,\n instrumentPageLoad = true,\n instrumentNavigation = true,\n } = options;\n\n return {\n ...integration,\n setup(client) {\n integration.setup(client);\n\n _useEffect = useEffect;\n _useLocation = useLocation;\n _useNavigationType = useNavigationType;\n _matchRoutes = matchRoutes;\n _createRoutesFromChildren = createRoutesFromChildren;\n _enableAsyncRouteHandlers = enableAsyncRouteHandlers;\n\n // Initialize the router utils with the required dependencies\n initializeRouterUtils(matchRoutes, stripBasename || false);\n },\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n const initPathName = WINDOW.location?.pathname;\n if (instrumentPageLoad && initPathName) {\n startBrowserTracingPageLoadSpan(client, {\n name: initPathName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.pageload.react.reactrouter_v${version}`,\n },\n });\n }\n\n if (instrumentNavigation) {\n CLIENTS_WITH_INSTRUMENT_NAVIGATION.add(client);\n }\n },\n };\n}\n\nexport function createV6CompatibleWrapUseRoutes(origUseRoutes: UseRoutes, version: V6CompatibleVersion): UseRoutes {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(\n 'reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.',\n );\n\n return origUseRoutes;\n }\n\n const SentryRoutes: React.FC<{\n children?: React.ReactNode;\n routes: RouteObject[];\n locationArg?: Partial<Location> | string;\n }> = (props: { children?: React.ReactNode; routes: RouteObject[]; locationArg?: Partial<Location> | string }) => {\n const isMountRenderPass = React.useRef(true);\n const { routes, locationArg } = props;\n\n const Routes = origUseRoutes(routes, locationArg);\n\n const location = _useLocation();\n const navigationType = _useNavigationType();\n\n // A value with stable identity to either pick `locationArg` if available or `location` if not\n const stableLocationParam =\n typeof locationArg === 'string' || locationArg?.pathname ? (locationArg as { pathname: string }) : location;\n\n _useEffect(() => {\n const normalizedLocation =\n typeof stableLocationParam === 'string' ? { pathname: stableLocationParam } : stableLocationParam;\n\n if (isMountRenderPass.current) {\n addRoutesToAllRoutes(routes);\n\n updatePageloadTransaction({\n activeRootSpan: getActiveRootSpan(),\n location: normalizedLocation,\n routes,\n allRoutes: Array.from(allRoutes),\n });\n isMountRenderPass.current = false;\n } else {\n handleNavigation({\n location: normalizedLocation,\n routes,\n navigationType,\n version,\n allRoutes: Array.from(allRoutes),\n });\n }\n }, [navigationType, stableLocationParam]);\n\n return Routes;\n };\n\n // eslint-disable-next-line react/display-name\n return (routes: RouteObject[], locationArg?: Partial<Location> | string): React.ReactElement | null => {\n return <SentryRoutes routes={routes} locationArg={locationArg} />;\n };\n}\n\nfunction wrapPatchRoutesOnNavigation(\n opts: Record<string, unknown> | undefined,\n isMemoryRouter = false,\n): Record<string, unknown> {\n if (!opts || !('patchRoutesOnNavigation' in opts) || typeof opts.patchRoutesOnNavigation !== 'function') {\n return opts || {};\n }\n\n const originalPatchRoutes = opts.patchRoutesOnNavigation;\n return {\n ...opts,\n patchRoutesOnNavigation: async (args: unknown) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const targetPath = (args as any)?.path;\n\n // For browser router, wrap the patch function to update span during patching\n if (!isMemoryRouter) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const originalPatch = (args as any)?.patch;\n if (originalPatch) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n (args as any).patch = (routeId: string, children: RouteObject[]) => {\n addRoutesToAllRoutes(children);\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan && (spanToJSON(activeRootSpan) as { op?: string }).op === 'navigation') {\n updateNavigationSpan(\n activeRootSpan,\n { pathname: targetPath, search: '', hash: '', state: null, key: 'default' },\n Array.from(allRoutes),\n true, // forceUpdate = true since we're loading lazy routes\n _matchRoutes,\n );\n }\n return originalPatch(routeId, children);\n };\n }\n }\n\n const result = await originalPatchRoutes(args);\n\n // Update navigation span after routes are patched\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan && (spanToJSON(activeRootSpan) as { op?: string }).op === 'navigation') {\n // Determine pathname based on router type\n let pathname: string | undefined;\n if (isMemoryRouter) {\n // For memory routers, only use targetPath\n pathname = targetPath;\n } else {\n // For browser routers, use targetPath or fall back to window.location\n pathname = targetPath || WINDOW.location?.pathname;\n }\n\n if (pathname) {\n updateNavigationSpan(\n activeRootSpan,\n { pathname, search: '', hash: '', state: null, key: 'default' },\n Array.from(allRoutes),\n false, // forceUpdate = false since this is after lazy routes are loaded\n _matchRoutes,\n );\n }\n }\n\n return result;\n },\n };\n}\n\nexport function handleNavigation(opts: {\n location: Location;\n routes: RouteObject[];\n navigationType: Action;\n version: V6CompatibleVersion;\n matches?: AgnosticDataRouteMatch;\n basename?: string;\n allRoutes?: RouteObject[];\n}): void {\n const { location, routes, navigationType, version, matches, basename, allRoutes } = opts;\n const branches = Array.isArray(matches) ? matches : _matchRoutes(routes, location, basename);\n\n const client = getClient();\n if (!client || !CLIENTS_WITH_INSTRUMENT_NAVIGATION.has(client)) {\n return;\n }\n\n // Avoid starting a navigation span on initial load when a pageload root span is active.\n // This commonly happens when lazy routes resolve during the first render and React Router emits a POP.\n const activeRootSpan = getActiveRootSpan();\n if (activeRootSpan && spanToJSON(activeRootSpan).op === 'pageload' && navigationType === 'POP') {\n return;\n }\n\n if ((navigationType === 'PUSH' || navigationType === 'POP') && branches) {\n const [name, source] = resolveRouteNameAndSource(\n location,\n routes,\n allRoutes || routes,\n branches as RouteMatch[],\n basename,\n );\n\n const activeSpan = getActiveSpan();\n const spanJson = activeSpan && spanToJSON(activeSpan);\n const isAlreadyInNavigationSpan = spanJson?.op === 'navigation';\n\n // Cross usage can result in multiple navigation spans being created without this check\n if (!isAlreadyInNavigationSpan) {\n const navigationSpan = startBrowserTracingNavigationSpan(client, {\n name,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: `auto.navigation.react.reactrouter_v${version}`,\n },\n });\n\n // Patch navigation span to handle early cancellation (e.g., document.hidden)\n if (navigationSpan) {\n patchNavigationSpanEnd(navigationSpan, location, routes, basename, allRoutes);\n }\n }\n }\n}\n\n/* Only exported for testing purposes */\nexport function addRoutesToAllRoutes(routes: RouteObject[]): void {\n routes.forEach(route => {\n const extractedChildRoutes = getChildRoutesRecursively(route);\n\n extractedChildRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n}\n\nfunction getChildRoutesRecursively(route: RouteObject, allRoutes: Set<RouteObject> = new Set()): Set<RouteObject> {\n if (!allRoutes.has(route)) {\n allRoutes.add(route);\n\n if (route.children && !route.index) {\n route.children.forEach(child => {\n const childRoutes = getChildRoutesRecursively(child, allRoutes);\n\n childRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n }\n }\n\n return allRoutes;\n}\n\nfunction updatePageloadTransaction({\n activeRootSpan,\n location,\n routes,\n matches,\n basename,\n allRoutes,\n}: {\n activeRootSpan: Span | undefined;\n location: Location;\n routes: RouteObject[];\n matches?: AgnosticDataRouteMatch;\n basename?: string;\n allRoutes?: RouteObject[];\n}): void {\n const branches = Array.isArray(matches)\n ? matches\n : (_matchRoutes(allRoutes || routes, location, basename) as unknown as RouteMatch[]);\n\n if (branches) {\n const [name, source] = resolveRouteNameAndSource(location, routes, allRoutes || routes, branches, basename);\n\n getCurrentScope().setTransactionName(name || '/');\n\n if (activeRootSpan) {\n activeRootSpan.updateName(name);\n activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n\n // Patch span.end() to ensure we update the name one last time before the span is sent\n patchPageloadSpanEnd(activeRootSpan, location, routes, basename, allRoutes);\n }\n }\n}\n\n/**\n * Patches the span.end() method to update the transaction name one last time before the span is sent.\n * This handles cases where the span is cancelled early (e.g., document.hidden) before lazy routes have finished loading.\n */\nfunction patchSpanEnd(\n span: Span,\n location: Location,\n routes: RouteObject[],\n basename: string | undefined,\n _allRoutes: RouteObject[] | undefined,\n spanType: 'pageload' | 'navigation',\n): void {\n const patchedPropertyName = `__sentry_${spanType}_end_patched__` as const;\n const hasEndBeenPatched = (span as unknown as Record<string, boolean | undefined>)?.[patchedPropertyName];\n\n if (hasEndBeenPatched || !span.end) {\n return;\n }\n\n const originalEnd = span.end.bind(span);\n\n span.end = function patchedEnd(...args) {\n try {\n // Only update if the span source is not already 'route' (i.e., it hasn't been parameterized yet)\n const spanJson = spanToJSON(span);\n const currentSource = spanJson.data?.[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (currentSource !== 'route') {\n // Last chance to update the transaction name with the latest route info\n // Use the live global allRoutes Set to include any lazy routes loaded after patching\n const currentAllRoutes = Array.from(allRoutes);\n const branches = _matchRoutes(\n currentAllRoutes.length > 0 ? currentAllRoutes : routes,\n location,\n basename,\n ) as unknown as RouteMatch[];\n\n if (branches) {\n const [name, source] = resolveRouteNameAndSource(\n location,\n routes,\n currentAllRoutes.length > 0 ? currentAllRoutes : routes,\n branches,\n basename,\n );\n\n // Only update if we have a valid name\n if (name && (spanType === 'pageload' || !spanJson.timestamp)) {\n span.updateName(name);\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n }\n }\n } catch (error) {\n // Silently catch errors to ensure span.end() is always called\n DEBUG_BUILD && debug.warn(`Error updating span details before ending: ${error}`);\n }\n\n return originalEnd(...args);\n };\n\n // Mark this span as having its end() method patched to prevent duplicate patching\n addNonEnumerableProperty(span as unknown as Record<string, boolean>, patchedPropertyName, true);\n}\n\nfunction patchPageloadSpanEnd(\n span: Span,\n location: Location,\n routes: RouteObject[],\n basename: string | undefined,\n _allRoutes: RouteObject[] | undefined,\n): void {\n patchSpanEnd(span, location, routes, basename, _allRoutes, 'pageload');\n}\n\nfunction patchNavigationSpanEnd(\n span: Span,\n location: Location,\n routes: RouteObject[],\n basename: string | undefined,\n _allRoutes: RouteObject[] | undefined,\n): void {\n patchSpanEnd(span, location, routes, basename, _allRoutes, 'navigation');\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createV6CompatibleWithSentryReactRouterRouting<P extends Record<string, any>, R extends React.FC<P>>(\n Routes: R,\n version: V6CompatibleVersion,\n): R {\n if (!_useEffect || !_useLocation || !_useNavigationType || !_createRoutesFromChildren || !_matchRoutes) {\n DEBUG_BUILD &&\n debug.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.\n useEffect: ${_useEffect}. useLocation: ${_useLocation}. useNavigationType: ${_useNavigationType}.\n createRoutesFromChildren: ${_createRoutesFromChildren}. matchRoutes: ${_matchRoutes}.`);\n\n return Routes;\n }\n\n const SentryRoutes: React.FC<P> = (props: P) => {\n const isMountRenderPass = React.useRef(true);\n\n const location = _useLocation();\n const navigationType = _useNavigationType();\n\n _useEffect(\n () => {\n const routes = _createRoutesFromChildren(props.children) as RouteObject[];\n\n if (isMountRenderPass.current) {\n addRoutesToAllRoutes(routes);\n\n updatePageloadTransaction({\n activeRootSpan: getActiveRootSpan(),\n location,\n routes,\n allRoutes: Array.from(allRoutes),\n });\n isMountRenderPass.current = false;\n } else {\n handleNavigation({ location, routes, navigationType, version, allRoutes: Array.from(allRoutes) });\n }\n },\n // `props.children` is purposely not included in the dependency array, because we do not want to re-run this effect\n // when the children change. We only want to start transactions when the location or navigation type change.\n [location, navigationType],\n );\n\n // @ts-expect-error 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-expect-error 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\nfunction getActiveRootSpan(): Span | undefined {\n const span = getActiveSpan();\n const rootSpan = span ? getRootSpan(span) : undefined;\n\n if (!rootSpan) {\n return undefined;\n }\n\n const op = spanToJSON(rootSpan).op;\n\n // Only use this root span if it is a pageload or navigation span\n return op === 'navigation' || op === 'pageload' ? rootSpan : undefined;\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;;;AA2CA,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,kBAAkB;AACtB,IAAI,yBAAyB;AAC7B,IAAI,YAAY;AAChB,IAAI,yBAAyB,GAAY,KAAK;;AAE9C,MAAM,kCAAA,GAAqC,IAAI,OAAO,EAAU;;AAEhE;AACA;AACA;AACA;AACO,SAAS,yBAAyB,CAAC,cAAc,EAAiB,WAAW,EAAqB;AACzG,EAAE,MAAM,mBAAmB,WAAW,CAAC,QAAA,IAAY,EAAE;;AAErD,EA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 -1 +1 @@
1
- {"version":3,"file":"lazy-routes.js","sources":["../../../src/reactrouter-compat-utils/lazy-routes.tsx"],"sourcesContent":["import { addNonEnumerableProperty, debug, isThenable } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Location, RouteObject } from '../types';\n\n/**\n * Creates a proxy wrapper for an async handler function.\n */\nexport function createAsyncHandlerProxy(\n originalFunction: (...args: unknown[]) => unknown,\n route: RouteObject,\n handlerKey: string,\n processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location) => void,\n): (...args: unknown[]) => unknown {\n const proxy = new Proxy(originalFunction, {\n apply(target: (...args: unknown[]) => unknown, thisArg, argArray) {\n const result = target.apply(thisArg, argArray);\n handleAsyncHandlerResult(result, route, handlerKey, processResolvedRoutes);\n return result;\n },\n });\n\n addNonEnumerableProperty(proxy, '__sentry_proxied__', true);\n\n return proxy;\n}\n\n/**\n * Handles the result of an async handler function call.\n */\nexport function handleAsyncHandlerResult(\n result: unknown,\n route: RouteObject,\n handlerKey: string,\n processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location) => void,\n): void {\n if (isThenable(result)) {\n (result as Promise<unknown>)\n .then((resolvedRoutes: unknown) => {\n if (Array.isArray(resolvedRoutes)) {\n processResolvedRoutes(resolvedRoutes, route);\n }\n })\n .catch((e: unknown) => {\n DEBUG_BUILD && debug.warn(`Error resolving async handler '${handlerKey}' for route`, route, e);\n });\n } else if (Array.isArray(result)) {\n processResolvedRoutes(result, route);\n }\n}\n\n/**\n * Recursively checks a route for async handlers and sets up Proxies to add discovered child routes to allRoutes when called.\n */\nexport function checkRouteForAsyncHandler(\n route: RouteObject,\n processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location) => void,\n): void {\n // Set up proxies for any functions in the route's handle\n if (route.handle && typeof route.handle === 'object') {\n for (const key of Object.keys(route.handle)) {\n const maybeFn = route.handle[key];\n if (typeof maybeFn === 'function' && !(maybeFn as { __sentry_proxied__?: boolean }).__sentry_proxied__) {\n route.handle[key] = createAsyncHandlerProxy(maybeFn, route, key, processResolvedRoutes);\n }\n }\n }\n\n // Recursively check child routes\n if (Array.isArray(route.children)) {\n for (const child of route.children) {\n checkRouteForAsyncHandler(child, processResolvedRoutes);\n }\n }\n}\n"],"names":[],"mappings":";;;AAIA;AACA;AACA;AACO,SAAS,uBAAuB;AACvC,EAAE,gBAAgB;AAClB,EAAE,KAAK;AACP,EAAE,UAAU;AACZ,EAAE,qBAAqB;AACvB,EAAmC;AACnC,EAAE,MAAM,KAAA,GAAQ,IAAI,KAAK,CAAC,gBAAgB,EAAE;AAC5C,IAAI,KAAK,CAAC,MAAM,EAAmC,OAAO,EAAE,QAAQ,EAAE;AACtE,MAAM,MAAM,MAAA,GAAS,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC;AACpD,MAAM,wBAAwB,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,qBAAqB,CAAC;AAChF,MAAM,OAAO,MAAM;AACnB,KAAK;AACL,GAAG,CAAC;;AAEJ,EAAE,wBAAwB,CAAC,KAAK,EAAE,oBAAoB,EAAE,IAAI,CAAC;;AAE7D,EAAE,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACO,SAAS,wBAAwB;AACxC,EAAE,MAAM;AACR,EAAE,KAAK;AACP,EAAE,UAAU;AACZ,EAAE,qBAAqB;AACvB,EAAQ;AACR,EAAE,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE;AAC1B,IAAI,CAAC,MAAA;AACL,OAAO,IAAI,CAAC,CAAC,cAAc,KAAc;AACzC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;AAC3C,UAAU,qBAAqB,CAAC,cAAc,EAAE,KAAK,CAAC;AACtD;AACA,OAAO;AACP,OAAO,KAAK,CAAC,CAAC,CAAC,KAAc;AAC7B,QAAQ,eAAe,KAAK,CAAC,IAAI,CAAC,CAAC,+BAA+B,EAAE,UAAU,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACtG,OAAO,CAAC;AACR,GAAE,MAAO,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACpC,IAAI,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC;AACxC;AACA;;AAEA;AACA;AACA;AACO,SAAS,yBAAyB;AACzC,EAAE,KAAK;AACP,EAAE,qBAAqB;AACvB,EAAQ;AACR;AACA,EAAE,IAAI,KAAK,CAAC,MAAA,IAAU,OAAO,KAAK,CAAC,MAAA,KAAW,QAAQ,EAAE;AACxD,IAAI,KAAK,MAAM,GAAA,IAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AACjD,MAAM,MAAM,UAAU,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AACvC,MAAM,IAAI,OAAO,OAAA,KAAY,UAAA,IAAc,CAAC,CAAC,OAAA,GAA6C,kBAAkB,EAAE;AAC9G,QAAQ,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,uBAAuB,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,qBAAqB,CAAC;AAC/F;AACA;AACA;;AAEA;AACA,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;AACrC,IAAI,KAAK,MAAM,KAAA,IAAS,KAAK,CAAC,QAAQ,EAAE;AACxC,MAAM,yBAAyB,CAAC,KAAK,EAAE,qBAAqB,CAAC;AAC7D;AACA;AACA;;;;"}
1
+ {"version":3,"file":"lazy-routes.js","sources":["../../../src/reactrouter-compat-utils/lazy-routes.tsx"],"sourcesContent":["import { addNonEnumerableProperty, debug, isThenable } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { Location, RouteObject } from '../types';\n\n/**\n * Creates a proxy wrapper for an async handler function.\n */\nexport function createAsyncHandlerProxy(\n originalFunction: (...args: unknown[]) => unknown,\n route: RouteObject,\n handlerKey: string,\n processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location) => void,\n): (...args: unknown[]) => unknown {\n const proxy = new Proxy(originalFunction, {\n apply(target: (...args: unknown[]) => unknown, thisArg, argArray) {\n const result = target.apply(thisArg, argArray);\n handleAsyncHandlerResult(result, route, handlerKey, processResolvedRoutes);\n return result;\n },\n });\n\n addNonEnumerableProperty(proxy, '__sentry_proxied__', true);\n\n return proxy;\n}\n\n/**\n * Handles the result of an async handler function call.\n */\nexport function handleAsyncHandlerResult(\n result: unknown,\n route: RouteObject,\n handlerKey: string,\n processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location) => void,\n): void {\n if (isThenable(result)) {\n (result as Promise<unknown>)\n .then((resolvedRoutes: unknown) => {\n if (Array.isArray(resolvedRoutes)) {\n processResolvedRoutes(resolvedRoutes, route);\n }\n })\n .catch((e: unknown) => {\n DEBUG_BUILD && debug.warn(`Error resolving async handler '${handlerKey}' for route`, route, e);\n });\n } else if (Array.isArray(result)) {\n processResolvedRoutes(result, route);\n }\n}\n\n/**\n * Recursively checks a route for async handlers and sets up Proxies to add discovered child routes to allRoutes when called.\n */\nexport function checkRouteForAsyncHandler(\n route: RouteObject,\n processResolvedRoutes: (resolvedRoutes: RouteObject[], parentRoute?: RouteObject, currentLocation?: Location) => void,\n): void {\n // Set up proxies for any functions in the route's handle\n if (route.handle && typeof route.handle === 'object') {\n for (const key of Object.keys(route.handle)) {\n const maybeFn = route.handle[key];\n if (typeof maybeFn === 'function' && !(maybeFn as { __sentry_proxied__?: boolean }).__sentry_proxied__) {\n route.handle[key] = createAsyncHandlerProxy(maybeFn, route, key, processResolvedRoutes);\n }\n }\n }\n\n // Recursively check child routes\n if (Array.isArray(route.children)) {\n for (const child of route.children) {\n checkRouteForAsyncHandler(child, processResolvedRoutes);\n }\n }\n}\n"],"names":[],"mappings":";;;AAI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