@sentry/react 10.25.0 → 10.27.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,5 +1,5 @@
1
1
  export { ReactRouterOptions } from './instrumentation';
2
2
  export { createReactRouterV6CompatibleTracingIntegration, createV6CompatibleWithSentryReactRouterRouting, createV6CompatibleWrapCreateBrowserRouter, createV6CompatibleWrapCreateMemoryRouter, createV6CompatibleWrapUseRoutes, handleNavigation, addResolvedRoutesToParent, processResolvedRoutes, updateNavigationSpan, } from './instrumentation';
3
- export { resolveRouteNameAndSource, getNormalizedName, initializeRouterUtils, locationIsInsideDescendantRoute, prefixWithSlash, rebuildRoutePathFromAllRoutes, pathEndsWithWildcard, pathIsWildcardAndHasChildren, getNumberOfUrlSegments, } from './utils';
3
+ export { resolveRouteNameAndSource, getNormalizedName, initializeRouterUtils, locationIsInsideDescendantRoute, prefixWithSlash, rebuildRoutePathFromAllRoutes, pathEndsWithWildcard, pathIsWildcardAndHasChildren, getNumberOfUrlSegments, transactionNameHasWildcard, } from './utils';
4
4
  export { createAsyncHandlerProxy, handleAsyncHandlerResult, checkRouteForAsyncHandler } from './lazy-routes';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -2,11 +2,30 @@ import { browserTracingIntegration } from '@sentry/browser';
2
2
  import { Integration, Span } from '@sentry/core';
3
3
  import * as React from 'react';
4
4
  import { Action, AgnosticDataRouteMatch, CreateRouterFunction, CreateRoutesFromChildren, Location, MatchRoutes, RouteObject, Router, RouterState, UseEffect, UseLocation, UseNavigationType, UseRoutes } from '../types';
5
+ export declare const allRoutes: Set<RouteObject>;
5
6
  /**
6
- * Adds resolved routes as children to the parent route.
7
- * Prevents duplicate routes by checking if they already exist.
7
+ * Computes location key for duplicate detection. Normalizes undefined/null to empty strings.
8
+ * Exported for testing.
8
9
  */
9
- export declare function addResolvedRoutesToParent(resolvedRoutes: RouteObject[], parentRoute: RouteObject): void;
10
+ export declare function computeLocationKey(location: Location): string;
11
+ /**
12
+ * Determines if a navigation should be skipped as a duplicate, and if an existing span should be updated.
13
+ * Exported for testing.
14
+ *
15
+ * @returns An object with:
16
+ * - skip: boolean - Whether to skip creating a new span
17
+ * - shouldUpdate: boolean - Whether to update the existing span name (wildcard upgrade)
18
+ */
19
+ export declare function shouldSkipNavigation(trackedNav: {
20
+ span: Span;
21
+ routeName: string;
22
+ pathname: string;
23
+ locationKey: string;
24
+ isPlaceholder?: boolean;
25
+ } | undefined, locationKey: string, proposedName: string, spanHasEnded: boolean): {
26
+ skip: boolean;
27
+ shouldUpdate: boolean;
28
+ };
10
29
  export interface ReactRouterOptions {
11
30
  useEffect: UseEffect;
12
31
  useLocation: UseLocation;
@@ -27,9 +46,21 @@ export interface ReactRouterOptions {
27
46
  * @default false
28
47
  */
29
48
  enableAsyncRouteHandlers?: boolean;
49
+ /**
50
+ * Maximum time (in milliseconds) to wait for lazy routes to load before finalizing span names.
51
+ *
52
+ * - Set to `0` to not wait at all (immediate finalization)
53
+ * - Set to `Infinity` to wait as long as possible (capped at `finalTimeout` to prevent indefinite hangs)
54
+ * - Negative values will fall back to the default
55
+ *
56
+ * Defaults to 3× the configured `idleTimeout` (default: 3000ms).
57
+ *
58
+ * @default idleTimeout * 3
59
+ */
60
+ lazyRouteTimeout?: number;
30
61
  }
31
62
  type V6CompatibleVersion = '6' | '7';
32
- export declare const allRoutes: Set<RouteObject>;
63
+ export declare function addResolvedRoutesToParent(resolvedRoutes: RouteObject[], parentRoute: RouteObject): void;
33
64
  /**
34
65
  * Processes resolved routes by adding them to allRoutes and checking for nested async handlers.
35
66
  */
@@ -9,6 +9,8 @@ export declare function initializeRouterUtils(matchRoutes: MatchRoutes, stripBas
9
9
  * Checks if a path ends with a wildcard character (*).
10
10
  */
11
11
  export declare function pathEndsWithWildcard(path: string): boolean;
12
+ /** Checks if transaction name has wildcard (/* or ends with *). */
13
+ export declare function transactionNameHasWildcard(name: string): boolean;
12
14
  /**
13
15
  * Checks if a path is a wildcard and has child routes.
14
16
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/react",
3
- "version": "10.25.0",
3
+ "version": "10.27.0",
4
4
  "description": "Official Sentry SDK for React.js",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/react",
@@ -39,8 +39,8 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@sentry/browser": "10.25.0",
43
- "@sentry/core": "10.25.0",
42
+ "@sentry/browser": "10.27.0",
43
+ "@sentry/core": "10.27.0",
44
44
  "hoist-non-react-statics": "^3.3.2"
45
45
  },
46
46
  "peerDependencies": {
@@ -52,7 +52,6 @@
52
52
  "@types/history-4": "npm:@types/history@4.7.8",
53
53
  "@types/history-5": "npm:@types/history@4.7.8",
54
54
  "@types/hoist-non-react-statics": "^3.3.5",
55
- "@types/node-fetch": "^2.6.11",
56
55
  "@types/react": "17.0.3",
57
56
  "@types/react-router-4": "npm:@types/react-router@4.0.25",
58
57
  "@types/react-router-5": "npm:@types/react-router@5.1.20",
@@ -60,7 +59,6 @@
60
59
  "eslint-plugin-react-hooks": "^4.0.8",
61
60
  "history-4": "npm:history@4.6.0",
62
61
  "history-5": "npm:history@4.9.0",
63
- "node-fetch": "^2.6.7",
64
62
  "react": "^18.3.1",
65
63
  "react-dom": "^18.3.1",
66
64
  "react-router-3": "npm:react-router@3.2.0",