@sentry/react 8.54.0 → 9.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/constants.js +1 -1
- package/build/cjs/debug-build.js +1 -1
- package/build/cjs/error.js +1 -1
- package/build/cjs/errorboundary.js +46 -56
- package/build/cjs/errorboundary.js.map +1 -1
- package/build/cjs/index.js +1 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/profiler.js +19 -34
- package/build/cjs/profiler.js.map +1 -1
- package/build/cjs/reactrouter.js +6 -23
- package/build/cjs/reactrouter.js.map +1 -1
- package/build/cjs/reactrouterv3.js +3 -3
- package/build/cjs/reactrouterv3.js.map +1 -1
- package/build/cjs/reactrouterv6-compat-utils.js +24 -36
- package/build/cjs/reactrouterv6-compat-utils.js.map +1 -1
- package/build/cjs/reactrouterv6.js +1 -15
- package/build/cjs/reactrouterv6.js.map +1 -1
- package/build/cjs/reactrouterv7.js +1 -1
- package/build/cjs/redux.js +3 -3
- package/build/cjs/redux.js.map +1 -1
- package/build/cjs/sdk.js +1 -1
- package/build/cjs/tanstackrouter.js +3 -4
- package/build/cjs/tanstackrouter.js.map +1 -1
- package/build/esm/errorboundary.js +41 -34
- package/build/esm/errorboundary.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/profiler.js +12 -10
- package/build/esm/profiler.js.map +1 -1
- package/build/esm/reactrouter.js +3 -3
- package/build/esm/reactrouter.js.map +1 -1
- package/build/esm/reactrouterv3.js +2 -2
- package/build/esm/reactrouterv3.js.map +1 -1
- package/build/esm/reactrouterv6-compat-utils.js +18 -14
- package/build/esm/reactrouterv6-compat-utils.js.map +1 -1
- package/build/esm/reactrouterv6.js +1 -13
- package/build/esm/reactrouterv6.js.map +1 -1
- package/build/esm/redux.js +2 -2
- package/build/esm/redux.js.map +1 -1
- package/build/esm/tanstackrouter.js +2 -3
- package/build/esm/tanstackrouter.js.map +1 -1
- package/build/types/errorboundary.d.ts +19 -7
- package/build/types/errorboundary.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/profiler.d.ts +0 -1
- package/build/types/profiler.d.ts.map +1 -1
- package/build/types/reactrouterv6-compat-utils.d.ts +4 -0
- package/build/types/reactrouterv6-compat-utils.d.ts.map +1 -1
- package/build/types/reactrouterv6.d.ts +0 -10
- package/build/types/reactrouterv6.d.ts.map +1 -1
- package/build/types/tanstackrouter.d.ts +1 -1
- package/build/types/tanstackrouter.d.ts.map +1 -1
- package/build/types/vendor/tanstackrouter-types.d.ts +1 -1
- package/build/types/vendor/tanstackrouter-types.d.ts.map +1 -1
- package/build/types-ts3.8/errorboundary.d.ts +19 -7
- package/build/types-ts3.8/index.d.ts +1 -1
- package/build/types-ts3.8/profiler.d.ts +0 -1
- package/build/types-ts3.8/reactrouterv6-compat-utils.d.ts +4 -0
- package/build/types-ts3.8/reactrouterv6.d.ts +0 -10
- package/build/types-ts3.8/tanstackrouter.d.ts +1 -1
- package/build/types-ts3.8/vendor/tanstackrouter-types.d.ts +1 -1
- package/package.json +7 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactrouterv6-compat-utils.js","sources":["../../src/reactrouterv6-compat-utils.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n// Inspired from Donnie McNeal's solution:\n// https://gist.github.com/wontondon/e8c4bdf2888875e4c755712e99279536\n\nimport {\n WINDOW,\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n} from '@sentry/browser';\nimport type { Client, Integration, Span, TransactionSource } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n getActiveSpan,\n getClient,\n getCurrentScope,\n getNumberOfUrlSegments,\n getRootSpan,\n logger,\n spanToJSON,\n} from '@sentry/core';\nimport * as React from 'react';\n\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { DEBUG_BUILD } from './debug-build';\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';\n\nlet _useEffect: UseEffect;\nlet _useLocation: UseLocation;\nlet _useNavigationType: UseNavigationType;\nlet _createRoutesFromChildren: CreateRoutesFromChildren;\nlet _matchRoutes: MatchRoutes;\nlet _stripBasename: boolean = false;\n\nconst CLIENTS_WITH_INSTRUMENT_NAVIGATION = new WeakSet<Client>();\n\nexport interface ReactRouterOptions {\n useEffect: UseEffect;\n useLocation: UseLocation;\n useNavigationType: UseNavigationType;\n createRoutesFromChildren: CreateRoutesFromChildren;\n matchRoutes: MatchRoutes;\n stripBasename?: boolean;\n}\n\ntype V6CompatibleVersion = '6' | '7';\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 logger.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 const router = createRouterFunction(routes, opts);\n const basename = opts && opts.basename;\n\n const activeRootSpan = getActiveRootSpan();\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(activeRootSpan, router.state.location, routes, undefined, basename);\n }\n\n router.subscribe((state: RouterState) => {\n const location = state.location;\n if (state.historyAction === 'PUSH' || state.historyAction === 'POP') {\n handleNavigation({\n location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\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 logger.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 const router = createRouterFunction(routes, opts);\n const basename = opts ? opts.basename : undefined;\n\n const activeRootSpan = getActiveRootSpan();\n let initialEntry = undefined;\n\n const initialEntries = opts ? opts.initialEntries : undefined;\n const initialIndex = opts ? opts.initialIndex : undefined;\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 if (router.state.historyAction === 'POP' && activeRootSpan) {\n updatePageloadTransaction(activeRootSpan, location, routes, undefined, basename);\n }\n\n router.subscribe((state: RouterState) => {\n const location = state.location;\n if (state.historyAction === 'PUSH' || state.historyAction === 'POP') {\n handleNavigation({\n location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\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({\n ...options,\n instrumentPageLoad: false,\n instrumentNavigation: false,\n });\n\n const {\n useEffect,\n useLocation,\n useNavigationType,\n createRoutesFromChildren,\n matchRoutes,\n stripBasename,\n instrumentPageLoad = true,\n instrumentNavigation = true,\n } = options;\n\n return {\n ...integration,\n setup() {\n _useEffect = useEffect;\n _useLocation = useLocation;\n _useNavigationType = useNavigationType;\n _matchRoutes = matchRoutes;\n _createRoutesFromChildren = createRoutesFromChildren;\n _stripBasename = stripBasename || false;\n },\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n const initPathName = WINDOW && WINDOW.location && 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 logger.warn(\n 'reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.',\n );\n\n return origUseRoutes;\n }\n\n const allRoutes: Set<RouteObject> = new Set();\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 && locationArg.pathname)\n ? (locationArg as { pathname: string })\n : location;\n\n _useEffect(() => {\n const normalizedLocation =\n typeof stableLocationParam === 'string' ? { pathname: stableLocationParam } : stableLocationParam;\n\n if (isMountRenderPass.current) {\n routes.forEach(route => {\n const extractedChildRoutes = getChildRoutesRecursively(route);\n\n extractedChildRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n\n updatePageloadTransaction(\n getActiveRootSpan(),\n normalizedLocation,\n routes,\n undefined,\n undefined,\n 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\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\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 if ((navigationType === 'PUSH' || navigationType === 'POP') && branches) {\n let name,\n source: TransactionSource = 'url';\n const isInDescendantRoute = locationIsInsideDescendantRoute(location, allRoutes || routes);\n\n if (isInDescendantRoute) {\n name = prefixWithSlash(rebuildRoutePathFromAllRoutes(allRoutes || routes, location));\n source = 'route';\n }\n\n if (!isInDescendantRoute || !name) {\n [name, source] = getNormalizedName(routes, location, branches, basename);\n }\n\n 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}\n\n/**\n * Strip the basename from a pathname if exists.\n *\n * Vendored and modified from `react-router`\n * https://github.com/remix-run/react-router/blob/462bb712156a3f739d6139a0f14810b76b002df6/packages/router/utils.ts#L1038\n */\nfunction stripBasenameFromPathname(pathname: string, basename: string): string {\n if (!basename || basename === '/') {\n return pathname;\n }\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return pathname;\n }\n\n // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n const startIndex = basename.endsWith('/') ? basename.length - 1 : basename.length;\n const nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== '/') {\n // pathname does not start with basename/\n return pathname;\n }\n\n return pathname.slice(startIndex) || '/';\n}\n\nfunction sendIndexPath(pathBuilder: string, pathname: string, basename: string): [string, TransactionSource] {\n const reconstructedPath = pathBuilder || _stripBasename ? stripBasenameFromPathname(pathname, basename) : pathname;\n\n const formattedPath =\n // If the path ends with a slash, remove it\n reconstructedPath[reconstructedPath.length - 1] === '/'\n ? reconstructedPath.slice(0, -1)\n : // If the path ends with a wildcard, remove it\n reconstructedPath.slice(-2) === '/*'\n ? reconstructedPath.slice(0, -1)\n : reconstructedPath;\n\n return [formattedPath, 'route'];\n}\n\nfunction pathEndsWithWildcard(path: string): boolean {\n return path.endsWith('*');\n}\n\nfunction pathIsWildcardAndHasChildren(path: string, branch: RouteMatch<string>): boolean {\n return (pathEndsWithWildcard(path) && branch.route.children && branch.route.children.length > 0) || false;\n}\n\nfunction routeIsDescendant(route: RouteObject): boolean {\n return !!(!route.children && route.element && route.path && route.path.endsWith('/*'));\n}\n\nfunction locationIsInsideDescendantRoute(location: Location, routes: RouteObject[]): boolean {\n const matchedRoutes = _matchRoutes(routes, location) as RouteMatch[];\n\n if (matchedRoutes) {\n for (const match of matchedRoutes) {\n if (routeIsDescendant(match.route) && pickSplat(match)) {\n return true;\n }\n }\n }\n\n return false;\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 => allRoutes.add(r));\n });\n }\n }\n\n return allRoutes;\n}\n\nfunction pickPath(match: RouteMatch): string {\n return trimWildcard(match.route.path || '');\n}\n\nfunction pickSplat(match: RouteMatch): string {\n return match.params['*'] || '';\n}\n\nfunction trimWildcard(path: string): string {\n return path[path.length - 1] === '*' ? path.slice(0, -1) : path;\n}\n\nfunction trimSlash(path: string): string {\n return path[path.length - 1] === '/' ? path.slice(0, -1) : path;\n}\n\nfunction prefixWithSlash(path: string): string {\n return path[0] === '/' ? path : `/${path}`;\n}\n\nfunction rebuildRoutePathFromAllRoutes(allRoutes: RouteObject[], location: Location): string {\n const matchedRoutes = _matchRoutes(allRoutes, location) as RouteMatch[];\n\n if (!matchedRoutes || matchedRoutes.length === 0) {\n return '';\n }\n\n for (const match of matchedRoutes) {\n if (match.route.path && match.route.path !== '*') {\n const path = pickPath(match);\n const strippedPath = stripBasenameFromPathname(location.pathname, prefixWithSlash(match.pathnameBase));\n\n return trimSlash(\n trimSlash(path || '') +\n prefixWithSlash(\n rebuildRoutePathFromAllRoutes(\n allRoutes.filter(route => route !== match.route),\n {\n pathname: strippedPath,\n },\n ),\n ),\n );\n }\n }\n\n return '';\n}\n\nfunction getNormalizedName(\n routes: RouteObject[],\n location: Location,\n branches: RouteMatch[],\n basename: string = '',\n): [string, TransactionSource] {\n if (!routes || routes.length === 0) {\n return [_stripBasename ? stripBasenameFromPathname(location.pathname, basename) : location.pathname, 'url'];\n }\n\n let pathBuilder = '';\n if (branches) {\n for (const branch of branches) {\n const route = branch.route;\n if (route) {\n // Early return if index route\n if (route.index) {\n return sendIndexPath(pathBuilder, branch.pathname, basename);\n }\n const path = route.path;\n\n // If path is not a wildcard and has no child routes, append the path\n if (path && !pathIsWildcardAndHasChildren(path, branch)) {\n const newPath = path[0] === '/' || pathBuilder[pathBuilder.length - 1] === '/' ? path : `/${path}`;\n pathBuilder = trimSlash(pathBuilder) + prefixWithSlash(newPath);\n\n // If the path matches the current location, return the path\n if (trimSlash(location.pathname) === trimSlash(basename + branch.pathname)) {\n if (\n // If the route defined on the element is something like\n // <Route path=\"/stores/:storeId/products/:productId\" element={<div>Product</div>} />\n // We should check against the branch.pathname for the number of / separators\n // TODO(v9): Put the implementation of `getNumberOfUrlSegments` in this file\n // eslint-disable-next-line deprecation/deprecation\n getNumberOfUrlSegments(pathBuilder) !== getNumberOfUrlSegments(branch.pathname) &&\n // We should not count wildcard operators in the url segments calculation\n !pathEndsWithWildcard(pathBuilder)\n ) {\n return [(_stripBasename ? '' : basename) + newPath, 'route'];\n }\n\n // if the last character of the pathbuilder is a wildcard and there are children, remove the wildcard\n if (pathIsWildcardAndHasChildren(pathBuilder, branch)) {\n pathBuilder = pathBuilder.slice(0, -1);\n }\n\n return [(_stripBasename ? '' : basename) + pathBuilder, 'route'];\n }\n }\n }\n }\n }\n\n const fallbackTransactionName = _stripBasename\n ? stripBasenameFromPathname(location.pathname, basename)\n : location.pathname || '/';\n\n return [fallbackTransactionName, 'url'];\n}\n\nfunction updatePageloadTransaction(\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(routes, location, basename) as unknown as RouteMatch[]);\n\n if (branches) {\n let name,\n source: TransactionSource = 'url';\n const isInDescendantRoute = locationIsInsideDescendantRoute(location, allRoutes || routes);\n\n if (isInDescendantRoute) {\n name = prefixWithSlash(rebuildRoutePathFromAllRoutes(allRoutes || routes, location));\n source = 'route';\n }\n\n if (!isInDescendantRoute || !name) {\n [name, source] = getNormalizedName(routes, location, branches, basename);\n }\n\n getCurrentScope().setTransactionName(name);\n\n if (activeRootSpan) {\n activeRootSpan.updateName(name);\n activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n }\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 logger.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.\n useEffect: ${_useEffect}. useLocation: ${_useLocation}. useNavigationType: ${_useNavigationType}.\n createRoutesFromChildren: ${_createRoutesFromChildren}. matchRoutes: ${_matchRoutes}.`);\n\n return Routes;\n }\n\n const allRoutes: Set<RouteObject> = new Set();\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 routes.forEach(route => {\n const extractedChildRoutes = getChildRoutesRecursively(route);\n\n extractedChildRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n\n updatePageloadTransaction(getActiveRootSpan(), location, routes, undefined, undefined, Array.from(allRoutes));\n isMountRenderPass.current = false;\n } else {\n handleNavigation({\n location,\n routes,\n navigationType,\n version,\n allRoutes: Array.from(allRoutes),\n });\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;;;AA0CA,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,kBAAkB;AACtB,IAAI,yBAAyB;AAC7B,IAAI,YAAY;AAChB,IAAI,cAAc,GAAY,KAAK;;AAEnC,MAAM,kCAAmC,GAAE,IAAI,OAAO,EAAU;;AAahE;AACA;AACA;AACO,SAAS;;AAGhB;AACA,EAAE,oBAAoB;AACtB,EAAE,OAAO;AACT,EAAyC;AACzC,EAAE,IAAI,CAAC,UAAA,IAAc,CAAC,YAAa,IAAG,CAAC,kBAAA,IAAsB,CAAC,YAAY,EAAE;AAC5E,IAAI,WAAY;AAChB,MAAM,MAAM,CAAC,IAAI;AACjB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,2GAA2G,CAAC;AAC3I,OAAO;;AAEP,IAAI,OAAO,oBAAoB;AAC/B;;AAEA,EAAE,OAAO,UAAU,MAAM,EAAiB,IAAI,EAA6D;AAC3G,IAAI,MAAM,SAAS,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC;AACrD,IAAI,MAAM,QAAS,GA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
|
1
|
+
{"version":3,"file":"reactrouterv6-compat-utils.js","sources":["../../src/reactrouterv6-compat-utils.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n// Inspired from Donnie McNeal's solution:\n// https://gist.github.com/wontondon/e8c4bdf2888875e4c755712e99279536\n\nimport {\n WINDOW,\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n} from '@sentry/browser';\nimport type { Client, Integration, Span, TransactionSource } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n getActiveSpan,\n getClient,\n getCurrentScope,\n getRootSpan,\n logger,\n spanToJSON,\n} from '@sentry/core';\nimport * as React from 'react';\n\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { DEBUG_BUILD } from './debug-build';\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';\n\nlet _useEffect: UseEffect;\nlet _useLocation: UseLocation;\nlet _useNavigationType: UseNavigationType;\nlet _createRoutesFromChildren: CreateRoutesFromChildren;\nlet _matchRoutes: MatchRoutes;\nlet _stripBasename: boolean = false;\n\nconst CLIENTS_WITH_INSTRUMENT_NAVIGATION = new WeakSet<Client>();\n\nexport interface ReactRouterOptions {\n useEffect: UseEffect;\n useLocation: UseLocation;\n useNavigationType: UseNavigationType;\n createRoutesFromChildren: CreateRoutesFromChildren;\n matchRoutes: MatchRoutes;\n stripBasename?: boolean;\n}\n\ntype V6CompatibleVersion = '6' | '7';\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 logger.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 const router = createRouterFunction(routes, opts);\n const basename = opts?.basename;\n\n const activeRootSpan = getActiveRootSpan();\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(activeRootSpan, router.state.location, routes, undefined, basename);\n }\n\n router.subscribe((state: RouterState) => {\n const location = state.location;\n if (state.historyAction === 'PUSH' || state.historyAction === 'POP') {\n handleNavigation({\n location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\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 logger.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 const router = createRouterFunction(routes, opts);\n const basename = opts?.basename;\n\n const activeRootSpan = getActiveRootSpan();\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 if (router.state.historyAction === 'POP' && activeRootSpan) {\n updatePageloadTransaction(activeRootSpan, location, routes, undefined, basename);\n }\n\n router.subscribe((state: RouterState) => {\n const location = state.location;\n if (state.historyAction === 'PUSH' || state.historyAction === 'POP') {\n handleNavigation({\n location,\n routes,\n navigationType: state.historyAction,\n version,\n basename,\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({\n ...options,\n instrumentPageLoad: false,\n instrumentNavigation: false,\n });\n\n const {\n useEffect,\n useLocation,\n useNavigationType,\n createRoutesFromChildren,\n matchRoutes,\n stripBasename,\n instrumentPageLoad = true,\n instrumentNavigation = true,\n } = options;\n\n return {\n ...integration,\n setup() {\n _useEffect = useEffect;\n _useLocation = useLocation;\n _useNavigationType = useNavigationType;\n _matchRoutes = matchRoutes;\n _createRoutesFromChildren = createRoutesFromChildren;\n _stripBasename = 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 logger.warn(\n 'reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters.',\n );\n\n return origUseRoutes;\n }\n\n const allRoutes: Set<RouteObject> = new Set();\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 routes.forEach(route => {\n const extractedChildRoutes = getChildRoutesRecursively(route);\n\n extractedChildRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n\n updatePageloadTransaction(\n getActiveRootSpan(),\n normalizedLocation,\n routes,\n undefined,\n undefined,\n 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\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\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 if ((navigationType === 'PUSH' || navigationType === 'POP') && branches) {\n let name,\n source: TransactionSource = 'url';\n const isInDescendantRoute = locationIsInsideDescendantRoute(location, allRoutes || routes);\n\n if (isInDescendantRoute) {\n name = prefixWithSlash(rebuildRoutePathFromAllRoutes(allRoutes || routes, location));\n source = 'route';\n }\n\n if (!isInDescendantRoute || !name) {\n [name, source] = getNormalizedName(routes, location, branches, basename);\n }\n\n 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}\n\n/**\n * Strip the basename from a pathname if exists.\n *\n * Vendored and modified from `react-router`\n * https://github.com/remix-run/react-router/blob/462bb712156a3f739d6139a0f14810b76b002df6/packages/router/utils.ts#L1038\n */\nfunction stripBasenameFromPathname(pathname: string, basename: string): string {\n if (!basename || basename === '/') {\n return pathname;\n }\n\n if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) {\n return pathname;\n }\n\n // We want to leave trailing slash behavior in the user's control, so if they\n // specify a basename with a trailing slash, we should support it\n const startIndex = basename.endsWith('/') ? basename.length - 1 : basename.length;\n const nextChar = pathname.charAt(startIndex);\n if (nextChar && nextChar !== '/') {\n // pathname does not start with basename/\n return pathname;\n }\n\n return pathname.slice(startIndex) || '/';\n}\n\nfunction sendIndexPath(pathBuilder: string, pathname: string, basename: string): [string, TransactionSource] {\n const reconstructedPath = pathBuilder || _stripBasename ? stripBasenameFromPathname(pathname, basename) : pathname;\n\n const formattedPath =\n // If the path ends with a slash, remove it\n reconstructedPath[reconstructedPath.length - 1] === '/'\n ? reconstructedPath.slice(0, -1)\n : // If the path ends with a wildcard, remove it\n reconstructedPath.slice(-2) === '/*'\n ? reconstructedPath.slice(0, -1)\n : reconstructedPath;\n\n return [formattedPath, 'route'];\n}\n\nfunction pathEndsWithWildcard(path: string): boolean {\n return path.endsWith('*');\n}\n\nfunction pathIsWildcardAndHasChildren(path: string, branch: RouteMatch<string>): boolean {\n return (pathEndsWithWildcard(path) && !!branch.route.children?.length) || false;\n}\n\nfunction routeIsDescendant(route: RouteObject): boolean {\n return !!(!route.children && route.element && route.path?.endsWith('/*'));\n}\n\nfunction locationIsInsideDescendantRoute(location: Location, routes: RouteObject[]): boolean {\n const matchedRoutes = _matchRoutes(routes, location) as RouteMatch[];\n\n if (matchedRoutes) {\n for (const match of matchedRoutes) {\n if (routeIsDescendant(match.route) && pickSplat(match)) {\n return true;\n }\n }\n }\n\n return false;\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 => allRoutes.add(r));\n });\n }\n }\n\n return allRoutes;\n}\n\nfunction pickPath(match: RouteMatch): string {\n return trimWildcard(match.route.path || '');\n}\n\nfunction pickSplat(match: RouteMatch): string {\n return match.params['*'] || '';\n}\n\nfunction trimWildcard(path: string): string {\n return path[path.length - 1] === '*' ? path.slice(0, -1) : path;\n}\n\nfunction trimSlash(path: string): string {\n return path[path.length - 1] === '/' ? path.slice(0, -1) : path;\n}\n\nfunction prefixWithSlash(path: string): string {\n return path[0] === '/' ? path : `/${path}`;\n}\n\nfunction rebuildRoutePathFromAllRoutes(allRoutes: RouteObject[], location: Location): string {\n const matchedRoutes = _matchRoutes(allRoutes, location) as RouteMatch[];\n\n if (!matchedRoutes || matchedRoutes.length === 0) {\n return '';\n }\n\n for (const match of matchedRoutes) {\n if (match.route.path && match.route.path !== '*') {\n const path = pickPath(match);\n const strippedPath = stripBasenameFromPathname(location.pathname, prefixWithSlash(match.pathnameBase));\n\n return trimSlash(\n trimSlash(path || '') +\n prefixWithSlash(\n rebuildRoutePathFromAllRoutes(\n allRoutes.filter(route => route !== match.route),\n {\n pathname: strippedPath,\n },\n ),\n ),\n );\n }\n }\n\n return '';\n}\n\nfunction getNormalizedName(\n routes: RouteObject[],\n location: Location,\n branches: RouteMatch[],\n basename: string = '',\n): [string, TransactionSource] {\n if (!routes || routes.length === 0) {\n return [_stripBasename ? stripBasenameFromPathname(location.pathname, basename) : location.pathname, 'url'];\n }\n\n let pathBuilder = '';\n if (branches) {\n for (const branch of branches) {\n const route = branch.route;\n if (route) {\n // Early return if index route\n if (route.index) {\n return sendIndexPath(pathBuilder, branch.pathname, basename);\n }\n const path = route.path;\n\n // If path is not a wildcard and has no child routes, append the path\n if (path && !pathIsWildcardAndHasChildren(path, branch)) {\n const newPath = path[0] === '/' || pathBuilder[pathBuilder.length - 1] === '/' ? path : `/${path}`;\n pathBuilder = trimSlash(pathBuilder) + prefixWithSlash(newPath);\n\n // If the path matches the current location, return the path\n if (trimSlash(location.pathname) === trimSlash(basename + branch.pathname)) {\n if (\n // If the route defined on the element is something like\n // <Route path=\"/stores/:storeId/products/:productId\" element={<div>Product</div>} />\n // We should check against the branch.pathname for the number of / separators\n getNumberOfUrlSegments(pathBuilder) !== getNumberOfUrlSegments(branch.pathname) &&\n // We should not count wildcard operators in the url segments calculation\n !pathEndsWithWildcard(pathBuilder)\n ) {\n return [(_stripBasename ? '' : basename) + newPath, 'route'];\n }\n\n // if the last character of the pathbuilder is a wildcard and there are children, remove the wildcard\n if (pathIsWildcardAndHasChildren(pathBuilder, branch)) {\n pathBuilder = pathBuilder.slice(0, -1);\n }\n\n return [(_stripBasename ? '' : basename) + pathBuilder, 'route'];\n }\n }\n }\n }\n }\n\n const fallbackTransactionName = _stripBasename\n ? stripBasenameFromPathname(location.pathname, basename)\n : location.pathname || '/';\n\n return [fallbackTransactionName, 'url'];\n}\n\nfunction updatePageloadTransaction(\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(routes, location, basename) as unknown as RouteMatch[]);\n\n if (branches) {\n let name,\n source: TransactionSource = 'url';\n const isInDescendantRoute = locationIsInsideDescendantRoute(location, allRoutes || routes);\n\n if (isInDescendantRoute) {\n name = prefixWithSlash(rebuildRoutePathFromAllRoutes(allRoutes || routes, location));\n source = 'route';\n }\n\n if (!isInDescendantRoute || !name) {\n [name, source] = getNormalizedName(routes, location, branches, basename);\n }\n\n getCurrentScope().setTransactionName(name);\n\n if (activeRootSpan) {\n activeRootSpan.updateName(name);\n activeRootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, source);\n }\n }\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 logger.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.\n useEffect: ${_useEffect}. useLocation: ${_useLocation}. useNavigationType: ${_useNavigationType}.\n createRoutesFromChildren: ${_createRoutesFromChildren}. matchRoutes: ${_matchRoutes}.`);\n\n return Routes;\n }\n\n const allRoutes: Set<RouteObject> = new Set();\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 routes.forEach(route => {\n const extractedChildRoutes = getChildRoutesRecursively(route);\n\n extractedChildRoutes.forEach(r => {\n allRoutes.add(r);\n });\n });\n\n updatePageloadTransaction(getActiveRootSpan(), location, routes, undefined, undefined, Array.from(allRoutes));\n isMountRenderPass.current = false;\n } else {\n handleNavigation({\n location,\n routes,\n navigationType,\n version,\n allRoutes: Array.from(allRoutes),\n });\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\n/**\n * Returns number of URL segments of a passed string URL.\n */\nexport function getNumberOfUrlSegments(url: string): number {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;;;AAyCA,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,kBAAkB;AACtB,IAAI,yBAAyB;AAC7B,IAAI,YAAY;AAChB,IAAI,cAAc,GAAY,KAAK;;AAEnC,MAAM,kCAAmC,GAAE,IAAI,O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AA,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;;AAEA;AACA;AACA;AACA,SAAA,sBAAA,CAAA,GAAA,EAAA;AACA;AACA,EAAA,OAAA,GAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA,MAAA,CAAA,CAAA,IAAA,CAAA,CAAA,MAAA,GAAA,CAAA,IAAA,CAAA,KAAA,GAAA,CAAA,CAAA,MAAA;AACA;;;;"}
|
|
@@ -18,12 +18,6 @@ function wrapUseRoutesV6(origUseRoutes) {
|
|
|
18
18
|
return createV6CompatibleWrapUseRoutes(origUseRoutes, '6');
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Alias for backwards compatibility
|
|
23
|
-
* @deprecated Use `wrapUseRoutesV6` or `wrapUseRoutesV7` instead.
|
|
24
|
-
*/
|
|
25
|
-
const wrapUseRoutes = wrapUseRoutesV6;
|
|
26
|
-
|
|
27
21
|
/**
|
|
28
22
|
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createBrowserRouter function.
|
|
29
23
|
* This is used to automatically capture route changes as transactions when using the createBrowserRouter API.
|
|
@@ -34,12 +28,6 @@ function wrapCreateBrowserRouterV6
|
|
|
34
28
|
return createV6CompatibleWrapCreateBrowserRouter(createRouterFunction, '6');
|
|
35
29
|
}
|
|
36
30
|
|
|
37
|
-
/**
|
|
38
|
-
* Alias for backwards compatibility
|
|
39
|
-
* @deprecated Use `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` instead.
|
|
40
|
-
*/
|
|
41
|
-
const wrapCreateBrowserRouter = wrapCreateBrowserRouterV6;
|
|
42
|
-
|
|
43
31
|
/**
|
|
44
32
|
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createMemoryRouter function.
|
|
45
33
|
* This is used to automatically capture route changes as transactions when using the createMemoryRouter API.
|
|
@@ -61,5 +49,5 @@ function withSentryReactRouterV6Routing(routes) {
|
|
|
61
49
|
return createV6CompatibleWithSentryReactRouterRouting(routes, '6');
|
|
62
50
|
}
|
|
63
51
|
|
|
64
|
-
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing,
|
|
52
|
+
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapCreateBrowserRouterV6, wrapCreateMemoryRouterV6, wrapUseRoutesV6 };
|
|
65
53
|
//# sourceMappingURL=reactrouterv6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactrouterv6.js","sources":["../../src/reactrouterv6.tsx"],"sourcesContent":["import type { browserTracingIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactRouterOptions } from './reactrouterv6-compat-utils';\nimport {\n createReactRouterV6CompatibleTracingIntegration,\n createV6CompatibleWithSentryReactRouterRouting,\n createV6CompatibleWrapCreateBrowserRouter,\n createV6CompatibleWrapCreateMemoryRouter,\n createV6CompatibleWrapUseRoutes,\n} from './reactrouterv6-compat-utils';\nimport type { CreateRouterFunction, Router, RouterState, UseRoutes } from './types';\n\n/**\n * A browser tracing integration that uses React Router v6 to instrument navigations.\n * Expects `useEffect`, `useLocation`, `useNavigationType`, `createRoutesFromChildren` and `matchRoutes` to be passed as options.\n */\nexport function reactRouterV6BrowserTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n): Integration {\n return createReactRouterV6CompatibleTracingIntegration(options, '6');\n}\n\n/**\n * A wrapper function that adds Sentry routing instrumentation to a React Router v6 useRoutes hook.\n * This is used to automatically capture route changes as transactions when using the useRoutes hook.\n */\nexport function wrapUseRoutesV6(origUseRoutes: UseRoutes): UseRoutes {\n return createV6CompatibleWrapUseRoutes(origUseRoutes, '6');\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"reactrouterv6.js","sources":["../../src/reactrouterv6.tsx"],"sourcesContent":["import type { browserTracingIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactRouterOptions } from './reactrouterv6-compat-utils';\nimport {\n createReactRouterV6CompatibleTracingIntegration,\n createV6CompatibleWithSentryReactRouterRouting,\n createV6CompatibleWrapCreateBrowserRouter,\n createV6CompatibleWrapCreateMemoryRouter,\n createV6CompatibleWrapUseRoutes,\n} from './reactrouterv6-compat-utils';\nimport type { CreateRouterFunction, Router, RouterState, UseRoutes } from './types';\n\n/**\n * A browser tracing integration that uses React Router v6 to instrument navigations.\n * Expects `useEffect`, `useLocation`, `useNavigationType`, `createRoutesFromChildren` and `matchRoutes` to be passed as options.\n */\nexport function reactRouterV6BrowserTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n): Integration {\n return createReactRouterV6CompatibleTracingIntegration(options, '6');\n}\n\n/**\n * A wrapper function that adds Sentry routing instrumentation to a React Router v6 useRoutes hook.\n * This is used to automatically capture route changes as transactions when using the useRoutes hook.\n */\nexport function wrapUseRoutesV6(origUseRoutes: UseRoutes): UseRoutes {\n return createV6CompatibleWrapUseRoutes(origUseRoutes, '6');\n}\n\n/**\n * A wrapper function that adds Sentry routing instrumentation to a React Router v6 createBrowserRouter function.\n * This is used to automatically capture route changes as transactions when using the createBrowserRouter API.\n */\nexport function wrapCreateBrowserRouterV6<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(createRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter> {\n return createV6CompatibleWrapCreateBrowserRouter(createRouterFunction, '6');\n}\n\n/**\n * A wrapper function that adds Sentry routing instrumentation to a React Router v6 createMemoryRouter function.\n * This is used to automatically capture route changes as transactions when using the createMemoryRouter API.\n * The difference between createBrowserRouter and createMemoryRouter is that with createMemoryRouter,\n * optional `initialEntries` are also taken into account.\n */\nexport function wrapCreateMemoryRouterV6<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(createMemoryRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter> {\n return createV6CompatibleWrapCreateMemoryRouter(createMemoryRouterFunction, '6');\n}\n\n/**\n * A higher-order component that adds Sentry routing instrumentation to a React Router v6 Route component.\n * This is used to automatically capture route changes as transactions.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withSentryReactRouterV6Routing<P extends Record<string, any>, R extends React.FC<P>>(routes: R): R {\n return createV6CompatibleWithSentryReactRouterRouting<P, R>(routes, '6');\n}\n"],"names":[],"mappings":";;AAYA;AACA;AACA;AACA;AACO,SAAS,sCAAsC;AACtD,EAAE,OAAO;AACT,EAAe;AACf,EAAE,OAAO,+CAA+C,CAAC,OAAO,EAAE,GAAG,CAAC;AACtE;;AAEA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,aAAa,EAAwB;AACrE,EAAE,OAAO,+BAA+B,CAAC,aAAa,EAAE,GAAG,CAAC;AAC5D;;AAEA;AACA;AACA;AACA;AACO,SAAS;;AAGhB,CAAE,oBAAoB,EAAgF;AACtG,EAAE,OAAO,yCAAyC,CAAC,oBAAoB,EAAE,GAAG,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS;;AAGhB,CAAE,0BAA0B,EAAgF;AAC5G,EAAE,OAAO,wCAAwC,CAAC,0BAA0B,EAAE,GAAG,CAAC;AAClF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,CAAuD,MAAM,EAAQ;AACnH,EAAE,OAAO,8CAA8C,CAAO,MAAM,EAAE,GAAG,CAAC;AAC1E;;;;"}
|
package/build/esm/redux.js
CHANGED
|
@@ -59,8 +59,8 @@ function createReduxEnhancer(enhancerOptions) {
|
|
|
59
59
|
const transformedState = options.stateTransformer(newState);
|
|
60
60
|
if (typeof transformedState !== 'undefined' && transformedState !== null) {
|
|
61
61
|
const client = getClient();
|
|
62
|
-
const options = client
|
|
63
|
-
const normalizationDepth =
|
|
62
|
+
const options = client?.getOptions();
|
|
63
|
+
const normalizationDepth = options?.normalizeDepth || 3; // default state normalization depth to 3
|
|
64
64
|
|
|
65
65
|
// Set the normalization depth of the redux state to the configured `normalizeDepth` option or a sane number as a fallback
|
|
66
66
|
const newStateContext = { state: { type: 'redux', value: transformedState } };
|
package/build/esm/redux.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redux.js","sources":["../../src/redux.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport 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> = 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 const sentryReducer: Reducer<S, A> = (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
|
|
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> = 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 const sentryReducer: Reducer<S, A> = (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 return next(sentryReducer, initialState);\n };\n}\n\nexport { createReduxEnhancer };\n"],"names":[],"mappings":";;AA0EA,MAAM,0BAAA,GAA6B,cAAc;AACjD,MAAM,sBAAA,GAAyB,MAAM;;AAErC,MAAM,cAAc,GAA0B;AAC9C,EAAE,gBAAgB,EAAE,IAAI;AACxB,EAAE,iBAAiB,EAAE,MAAO,IAAG,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,EAA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Q,MAAM,mBAAmB,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AACnE,QAAQ,IAAI,OAAO,gBAAiB,KAAI,eAAe,gBAAA,KAAqB,IAAI,EAAE;AAClF,UAAU,MAAM,MAAA,GAAS,SAAS,EAAE;AACpC,UAAU,MAAM,OAAQ,GAAE,MAAM,EAAE,UAAU,EAAE;AAC9C,UAAU,MAAM,kBAAmB,GAAE,OAAO,EAAE,cAAA,IAAkB,CAAC,CAAA;;AAEjE;AACA,UAAU,MAAM,eAAA,GAAkB,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,gBAAA,IAAoB;AACvF,UAAU,wBAAwB;AAClC,YAAY,eAAe;AAC3B,YAAY,yCAAyC;AACrD,YAAY,CAAE;AACd,cAAc,kBAAkB;AAChC,WAAW;;AAEX,UAAU,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,eAAe,CAAC;AACpD,eAAe;AACf,UAAU,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC;;AAEA;AACA,QAAQ,MAAM,EAAE,uBAAwB,EAAA,GAAI,OAAO;AACnD,QAAQ,IAAI,OAAO,uBAAwB,KAAI,UAAU,EAAE;AAC3D,UAAU,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC;AAClD;;AAEA,QAAQ,OAAO,QAAQ;AACvB,OAAO;;AAEP,MAAM,OAAO,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC;AAC9C,KAAK;AACL;;;;"}
|
|
@@ -4,7 +4,7 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTI
|
|
|
4
4
|
/**
|
|
5
5
|
* A custom browser tracing integration for TanStack Router.
|
|
6
6
|
*
|
|
7
|
-
* The minimum compatible version of `@tanstack/router` is `1.
|
|
7
|
+
* The minimum compatible version of `@tanstack/react-router` is `1.64.0`.
|
|
8
8
|
*
|
|
9
9
|
* @param router A TanStack Router `Router` instance that should be used for routing instrumentation.
|
|
10
10
|
* @param options Sentry browser tracing configuration.
|
|
@@ -53,9 +53,8 @@ function tanstackRouterBrowserTracingIntegration(
|
|
|
53
53
|
if (instrumentNavigation) {
|
|
54
54
|
// 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
|
|
55
55
|
castRouterInstance.subscribe('onBeforeNavigate', onBeforeNavigateArgs => {
|
|
56
|
-
const fromLocationState = onBeforeNavigateArgs.fromLocation && onBeforeNavigateArgs.fromLocation.state;
|
|
57
56
|
// onBeforeNavigate is called during pageloads. We can avoid creating navigation spans by comparing the states of the to and from arguments.
|
|
58
|
-
if (onBeforeNavigateArgs.toLocation.state ===
|
|
57
|
+
if (onBeforeNavigateArgs.toLocation.state === onBeforeNavigateArgs.fromLocation.state) {
|
|
59
58
|
return;
|
|
60
59
|
}
|
|
61
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstackrouter.js","sources":["../../src/tanstackrouter.ts"],"sourcesContent":["import {\n WINDOW,\n browserTracingIntegration as originalBrowserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\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/router` is `1.
|
|
1
|
+
{"version":3,"file":"tanstackrouter.js","sources":["../../src/tanstackrouter.ts"],"sourcesContent":["import {\n WINDOW,\n browserTracingIntegration as originalBrowserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\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;\n });\n\n return paramAttributes;\n}\n"],"names":["originalBrowserTracingIntegration"],"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,yBAAiC,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,EAAO,GAAE,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,GAAwB,MAAM,CAAC,QAAQ;AACnD,MAAM,IAAI,kBAAmB,IAAG,qBAAqB,EAAE;AACvD,QAAQ,MAAM,aAAA,GAAgB,kBAAkB,CAAC,WAAW;AAC5D,UAAU,qBAAqB,CAAC,QAAQ;AACxC,UAAU,kBAAkB,CAAC,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,MAAM,CAAC;AAC9E,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO;AACjD,SAAS;;AAET,QAAQ,MAAM,SAAU,GAAE,aAAa,CAAC,aAAa,CAAC,MAAA,GAAS,CAAC,CAAC;;AAEjE,QAAQ,+BAA+B,CAAC,MAAM,EAAE;AAChD,UAAU,IAAI,EA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resetError(): void;
|
|
10
10
|
}) => React.ReactElement;
|
|
11
|
+
type OnUnmountType = {
|
|
12
|
+
(error: null, componentStack: null, eventId: null): void;
|
|
13
|
+
(error: unknown, componentStack: string, eventId: string): void;
|
|
14
|
+
};
|
|
11
15
|
export type ErrorBoundaryProps = {
|
|
12
16
|
children?: React.ReactNode | (() => React.ReactNode);
|
|
13
17
|
/** If a Sentry report dialog should be rendered on error */
|
|
@@ -33,15 +37,23 @@ export type ErrorBoundaryProps = {
|
|
|
33
37
|
*/
|
|
34
38
|
handled?: boolean | undefined;
|
|
35
39
|
/** Called when the error boundary encounters an error */
|
|
36
|
-
onError?: ((error: unknown, componentStack: string
|
|
40
|
+
onError?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;
|
|
37
41
|
/** Called on componentDidMount() */
|
|
38
42
|
onMount?: (() => void) | undefined;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Called when the error boundary resets due to a reset call from the
|
|
45
|
+
* fallback render props function.
|
|
46
|
+
*/
|
|
47
|
+
onReset?: ((error: unknown, componentStack: string, eventId: string) => void) | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Called on componentWillUnmount() with the error, componentStack, and eventId.
|
|
50
|
+
*
|
|
51
|
+
* If the error boundary never encountered an error, the error
|
|
52
|
+
* componentStack, and eventId will be null.
|
|
53
|
+
*/
|
|
54
|
+
onUnmount?: OnUnmountType | undefined;
|
|
43
55
|
/** Called before the error is captured by Sentry, allows for you to add tags or context using the scope */
|
|
44
|
-
beforeCapture?: ((scope: Scope, error: unknown, componentStack: string
|
|
56
|
+
beforeCapture?: ((scope: Scope, error: unknown, componentStack: string) => void) | undefined;
|
|
45
57
|
};
|
|
46
58
|
type ErrorBoundaryState = {
|
|
47
59
|
componentStack: null;
|
|
@@ -67,7 +79,7 @@ declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBou
|
|
|
67
79
|
componentDidCatch(error: unknown, errorInfo: React.ErrorInfo): void;
|
|
68
80
|
componentDidMount(): void;
|
|
69
81
|
componentWillUnmount(): void;
|
|
70
|
-
resetErrorBoundary
|
|
82
|
+
resetErrorBoundary(): void;
|
|
71
83
|
render(): React.ReactNode;
|
|
72
84
|
}
|
|
73
85
|
declare function withErrorBoundary<P extends Record<string, any>>(WrappedComponent: React.ComponentType<P>, errorBoundaryOptions: ErrorBoundaryProps): React.FC<P>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorboundary.d.ts","sourceRoot":"","sources":["../../src/errorboundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,IAAI,IAAI,CAAC;CACpB,KAAK,KAAK,CAAC,YAAY,CAAC;AAEzB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;IACrD,4DAA4D;IAC5D,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAChD;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,cAAc,GAAG,SAAS,CAAC;IAC3D;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,yDAAyD;IACzD,OAAO,CAAC,EA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AAoB,IAAI,IAAI;IAqB5B,kBAAkB,IAAI,IAAI;IAY1B,MAAM,IAAI,KAAK,CAAC,SAAS;CAgCjC;AAGD,iBAAS,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtD,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACxC,oBAAoB,EAAE,kBAAkB,GACvC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAeb;AAED,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export { createReduxEnhancer } from './redux';
|
|
|
8
8
|
export { reactRouterV3BrowserTracingIntegration } from './reactrouterv3';
|
|
9
9
|
export { tanstackRouterBrowserTracingIntegration } from './tanstackrouter';
|
|
10
10
|
export { withSentryRouting, reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, } from './reactrouter';
|
|
11
|
-
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing,
|
|
11
|
+
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapUseRoutesV6, wrapCreateBrowserRouterV6, wrapCreateMemoryRouterV6, } from './reactrouterv6';
|
|
12
12
|
export { reactRouterV7BrowserTracingIntegration, withSentryReactRouterV7Routing, wrapCreateBrowserRouterV7, wrapCreateMemoryRouterV7, wrapUseRoutesV7, } from './reactrouterv7';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,Y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wBAAwB,EACxB,eAAe,GAChB,MAAM,iBAAiB,CAAC"}
|
|
@@ -25,7 +25,6 @@ declare class Profiler extends React.Component<ProfilerProps> {
|
|
|
25
25
|
* The span that represents the duration of time between shouldComponentUpdate and componentDidUpdate
|
|
26
26
|
*/
|
|
27
27
|
protected _updateSpan: Span | undefined;
|
|
28
|
-
static defaultProps: Partial<ProfilerProps>;
|
|
29
28
|
constructor(props: ProfilerProps);
|
|
30
29
|
componentDidMount(): void;
|
|
31
30
|
shouldComponentUpdate({ updateProps, includeUpdates }: ProfilerProps): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG;IAE1B,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B,WAAW,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACzC,CAAC;AAEF;;;GAGG;AACH,cAAM,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,UAAU,EAAE,IAAI,GAAG,SAAS,CAAC;IACvC;;OAEG;IACH,SAAS,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"profiler.d.ts","sourceRoot":"","sources":["../../src/profiler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MA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E,MAAM,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAGrD,GACA,IAAI,CA+CN;AAED,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -34,5 +34,9 @@ export declare function handleNavigation(opts: {
|
|
|
34
34
|
allRoutes?: RouteObject[];
|
|
35
35
|
}): void;
|
|
36
36
|
export declare function createV6CompatibleWithSentryReactRouterRouting<P extends Record<string, any>, R extends React.FC<P>>(Routes: R, version: V6CompatibleVersion): R;
|
|
37
|
+
/**
|
|
38
|
+
* Returns number of URL segments of a passed string URL.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getNumberOfUrlSegments(url: string): number;
|
|
37
41
|
export {};
|
|
38
42
|
//# sourceMappingURL=reactrouterv6-compat-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactrouterv6-compat-utils.d.ts","sourceRoot":"","sources":["../../src/reactrouterv6-compat-utils.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,yBAAyB,EAG1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAU,WAAW,EAA2B,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"reactrouterv6-compat-utils.d.ts","sourceRoot":"","sources":["../../src/reactrouterv6-compat-utils.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,yBAAyB,EAG1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAU,WAAW,EAA2B,MAAM,cAAc,CAAC;AAYjF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EACV,MAAM,EACN,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,QAAQ,EACR,WAAW,EAEX,WAAW,EACX,MAAM,EACN,WAAW,EACX,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,SAAS,EACV,MAAM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B,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;CAC3B,GAAG,IAAI,CAiCP;AAqOD,wBAAgB,8CAA8C,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EACjH,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,mBAAmB,GAC3B,CAAC,CA0DH;AAgBD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG1D"}
|
|
@@ -13,21 +13,11 @@ export declare function reactRouterV6BrowserTracingIntegration(options: Paramete
|
|
|
13
13
|
* This is used to automatically capture route changes as transactions when using the useRoutes hook.
|
|
14
14
|
*/
|
|
15
15
|
export declare function wrapUseRoutesV6(origUseRoutes: UseRoutes): UseRoutes;
|
|
16
|
-
/**
|
|
17
|
-
* Alias for backwards compatibility
|
|
18
|
-
* @deprecated Use `wrapUseRoutesV6` or `wrapUseRoutesV7` instead.
|
|
19
|
-
*/
|
|
20
|
-
export declare const wrapUseRoutes: typeof wrapUseRoutesV6;
|
|
21
16
|
/**
|
|
22
17
|
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createBrowserRouter function.
|
|
23
18
|
* This is used to automatically capture route changes as transactions when using the createBrowserRouter API.
|
|
24
19
|
*/
|
|
25
20
|
export declare function wrapCreateBrowserRouterV6<TState extends RouterState = RouterState, TRouter extends Router<TState> = Router<TState>>(createRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter>;
|
|
26
|
-
/**
|
|
27
|
-
* Alias for backwards compatibility
|
|
28
|
-
* @deprecated Use `wrapCreateBrowserRouterV6` or `wrapCreateBrowserRouterV7` instead.
|
|
29
|
-
*/
|
|
30
|
-
export declare const wrapCreateBrowserRouter: typeof wrapCreateBrowserRouterV6;
|
|
31
21
|
/**
|
|
32
22
|
* A wrapper function that adds Sentry routing instrumentation to a React Router v6 createMemoryRouter function.
|
|
33
23
|
* This is used to automatically capture route changes as transactions when using the createMemoryRouter API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactrouterv6.d.ts","sourceRoot":"","sources":["../../src/reactrouterv6.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAQvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAEb;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,CAEnE;AAED;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"reactrouterv6.d.ts","sourceRoot":"","sources":["../../src/reactrouterv6.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAQvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpF;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAEb;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,CAEnE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,OAAO,SAAS,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAC/C,oBAAoB,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAEpG;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,OAAO,SAAS,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAC/C,0BAA0B,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1G;AAED;;;GAGG;AAEH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAEjH"}
|
|
@@ -3,7 +3,7 @@ import type { Integration } from '@sentry/core';
|
|
|
3
3
|
/**
|
|
4
4
|
* A custom browser tracing integration for TanStack Router.
|
|
5
5
|
*
|
|
6
|
-
* The minimum compatible version of `@tanstack/router` is `1.
|
|
6
|
+
* The minimum compatible version of `@tanstack/react-router` is `1.64.0`.
|
|
7
7
|
*
|
|
8
8
|
* @param router A TanStack Router `Router` instance that should be used for routing instrumentation.
|
|
9
9
|
* @param options Sentry browser tracing configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstackrouter.d.ts","sourceRoot":"","sources":["../../src/tanstackrouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,IAAI,iCAAiC,EAG/D,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAQhD;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CAErD,MAAM,EAAE,GAAG,EAAE,iGAAiG;AAC9G,OAAO,GAAE,UAAU,CAAC,OAAO,iCAAiC,CAAC,CAAC,CAAC,CAAM,GACpE,WAAW,
|
|
1
|
+
{"version":3,"file":"tanstackrouter.d.ts","sourceRoot":"","sources":["../../src/tanstackrouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,IAAI,iCAAiC,EAG/D,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAQhD;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CAErD,MAAM,EAAE,GAAG,EAAE,iGAAiG;AAC9G,OAAO,GAAE,UAAU,CAAC,OAAO,iCAAiC,CAAC,CAAC,CAAC,CAAM,GACpE,WAAW,CAsFb"}
|
|
@@ -10,7 +10,7 @@ export interface VendoredTanstackRouter {
|
|
|
10
10
|
}) => Array<VendoredTanstackRouterRouteMatch>;
|
|
11
11
|
subscribe(eventType: 'onResolved' | 'onBeforeNavigate', callback: (stateUpdate: {
|
|
12
12
|
toLocation: VendoredTanstackRouterLocation;
|
|
13
|
-
fromLocation
|
|
13
|
+
fromLocation: VendoredTanstackRouterLocation;
|
|
14
14
|
}) => void): () => void;
|
|
15
15
|
}
|
|
16
16
|
interface VendoredTanstackRouterLocation {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstackrouter-types.d.ts","sourceRoot":"","sources":["../../../src/vendor/tanstackrouter-types.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,6BAA6B,CAAC;IACvC,KAAK,EAAE,2BAA2B,CAAC;IACnC,OA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