@sentry/react 10.7.0 → 10.8.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/{reactrouterv6-compat-utils.js → reactrouter-compat-utils/instrumentation.js} +271 -310
- package/build/cjs/reactrouter-compat-utils/instrumentation.js.map +1 -0
- package/build/cjs/reactrouter-compat-utils/lazy-routes.js +80 -0
- package/build/cjs/reactrouter-compat-utils/lazy-routes.js.map +1 -0
- package/build/cjs/reactrouter-compat-utils/utils.js +297 -0
- package/build/cjs/reactrouter-compat-utils/utils.js.map +1 -0
- package/build/cjs/reactrouterv6.js +7 -6
- package/build/cjs/reactrouterv6.js.map +1 -1
- package/build/cjs/reactrouterv7.js +7 -6
- package/build/cjs/reactrouterv7.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/{reactrouterv6-compat-utils.js → reactrouter-compat-utils/instrumentation.js} +265 -307
- package/build/esm/reactrouter-compat-utils/instrumentation.js.map +1 -0
- package/build/esm/reactrouter-compat-utils/lazy-routes.js +76 -0
- package/build/esm/reactrouter-compat-utils/lazy-routes.js.map +1 -0
- package/build/esm/reactrouter-compat-utils/utils.js +286 -0
- package/build/esm/reactrouter-compat-utils/utils.js.map +1 -0
- package/build/esm/reactrouterv6.js +2 -1
- package/build/esm/reactrouterv6.js.map +1 -1
- package/build/esm/reactrouterv7.js +2 -1
- package/build/esm/reactrouterv7.js.map +1 -1
- package/build/types/reactrouter-compat-utils/index.d.ts +5 -0
- package/build/types/reactrouter-compat-utils/index.d.ts.map +1 -0
- package/build/types/{reactrouterv6-compat-utils.d.ts → reactrouter-compat-utils/instrumentation.d.ts} +21 -7
- package/build/types/reactrouter-compat-utils/instrumentation.d.ts.map +1 -0
- package/build/types/reactrouter-compat-utils/lazy-routes.d.ts +14 -0
- package/build/types/reactrouter-compat-utils/lazy-routes.d.ts.map +1 -0
- package/build/types/reactrouter-compat-utils/utils.d.ts +50 -0
- package/build/types/reactrouter-compat-utils/utils.d.ts.map +1 -0
- package/build/types/reactrouterv6.d.ts +1 -1
- package/build/types/reactrouterv6.d.ts.map +1 -1
- package/build/types/reactrouterv7.d.ts +1 -1
- package/build/types/reactrouterv7.d.ts.map +1 -1
- package/build/types-ts3.8/reactrouter-compat-utils/index.d.ts +5 -0
- package/build/types-ts3.8/{reactrouterv6-compat-utils.d.ts → reactrouter-compat-utils/instrumentation.d.ts} +21 -7
- package/build/types-ts3.8/reactrouter-compat-utils/lazy-routes.d.ts +14 -0
- package/build/types-ts3.8/reactrouter-compat-utils/utils.d.ts +56 -0
- package/build/types-ts3.8/reactrouterv6.d.ts +1 -1
- package/build/types-ts3.8/reactrouterv7.d.ts +1 -1
- package/package.json +3 -3
- package/build/cjs/reactrouterv6-compat-utils.js.map +0 -1
- package/build/esm/reactrouterv6-compat-utils.js.map +0 -1
- package/build/types/reactrouterv6-compat-utils.d.ts.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const instrumentation = require('./reactrouter-compat-utils/instrumentation.js');
|
|
4
|
+
require('@sentry/core');
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A browser tracing integration that uses React Router v7 to instrument navigations.
|
|
@@ -9,7 +10,7 @@ const reactrouterv6CompatUtils = require('./reactrouterv6-compat-utils.js');
|
|
|
9
10
|
function reactRouterV7BrowserTracingIntegration(
|
|
10
11
|
options,
|
|
11
12
|
) {
|
|
12
|
-
return
|
|
13
|
+
return instrumentation.createReactRouterV6CompatibleTracingIntegration(options, '7');
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/**
|
|
@@ -18,7 +19,7 @@ function reactRouterV7BrowserTracingIntegration(
|
|
|
18
19
|
*/
|
|
19
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
21
|
function withSentryReactRouterV7Routing(routes) {
|
|
21
|
-
return
|
|
22
|
+
return instrumentation.createV6CompatibleWithSentryReactRouterRouting(routes, '7');
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
/**
|
|
@@ -28,7 +29,7 @@ function withSentryReactRouterV7Routing(routes) {
|
|
|
28
29
|
function wrapCreateBrowserRouterV7
|
|
29
30
|
|
|
30
31
|
(createRouterFunction) {
|
|
31
|
-
return
|
|
32
|
+
return instrumentation.createV6CompatibleWrapCreateBrowserRouter(createRouterFunction, '7');
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -40,7 +41,7 @@ function wrapCreateBrowserRouterV7
|
|
|
40
41
|
function wrapCreateMemoryRouterV7
|
|
41
42
|
|
|
42
43
|
(createMemoryRouterFunction) {
|
|
43
|
-
return
|
|
44
|
+
return instrumentation.createV6CompatibleWrapCreateMemoryRouter(createMemoryRouterFunction, '7');
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -48,7 +49,7 @@ function wrapCreateMemoryRouterV7
|
|
|
48
49
|
* This is used to automatically capture route changes as transactions when using the useRoutes hook.
|
|
49
50
|
*/
|
|
50
51
|
function wrapUseRoutesV7(origUseRoutes) {
|
|
51
|
-
return
|
|
52
|
+
return instrumentation.createV6CompatibleWrapUseRoutes(origUseRoutes, '7');
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
exports.reactRouterV7BrowserTracingIntegration = reactRouterV7BrowserTracingIntegration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactrouterv7.js","sources":["../../src/reactrouterv7.tsx"],"sourcesContent":["// React Router v7 uses the same integration as v6\nimport type { browserTracingIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactRouterOptions } from './
|
|
1
|
+
{"version":3,"file":"reactrouterv7.js","sources":["../../src/reactrouterv7.tsx"],"sourcesContent":["// React Router v7 uses the same integration as v6\nimport type { browserTracingIntegration } from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport type { ReactRouterOptions } from './reactrouter-compat-utils';\nimport {\n createReactRouterV6CompatibleTracingIntegration,\n createV6CompatibleWithSentryReactRouterRouting,\n createV6CompatibleWrapCreateBrowserRouter,\n createV6CompatibleWrapCreateMemoryRouter,\n createV6CompatibleWrapUseRoutes,\n} from './reactrouter-compat-utils';\nimport type { CreateRouterFunction, Router, RouterState, UseRoutes } from './types';\n\n/**\n * A browser tracing integration that uses React Router v7 to instrument navigations.\n * Expects `useEffect`, `useLocation`, `useNavigationType`, `createRoutesFromChildren` and `matchRoutes` to be passed as options.\n */\nexport function reactRouterV7BrowserTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n): Integration {\n return createReactRouterV6CompatibleTracingIntegration(options, '7');\n}\n\n/**\n * A higher-order component that adds Sentry routing instrumentation to a React Router v7 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 withSentryReactRouterV7Routing<P extends Record<string, any>, R extends React.FC<P>>(routes: R): R {\n return createV6CompatibleWithSentryReactRouterRouting<P, R>(routes, '7');\n}\n\n/**\n * A wrapper function that adds Sentry routing instrumentation to a React Router v7 createBrowserRouter function.\n * This is used to automatically capture route changes as transactions when using the createBrowserRouter API.\n */\nexport function wrapCreateBrowserRouterV7<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(createRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter> {\n return createV6CompatibleWrapCreateBrowserRouter(createRouterFunction, '7');\n}\n\n/**\n * A wrapper function that adds Sentry routing instrumentation to a React Router v7 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 wrapCreateMemoryRouterV7<\n TState extends RouterState = RouterState,\n TRouter extends Router<TState> = Router<TState>,\n>(createMemoryRouterFunction: CreateRouterFunction<TState, TRouter>): CreateRouterFunction<TState, TRouter> {\n return createV6CompatibleWrapCreateMemoryRouter(createMemoryRouterFunction, '7');\n}\n\n/**\n * A wrapper function that adds Sentry routing instrumentation to a React Router v7 useRoutes hook.\n * This is used to automatically capture route changes as transactions when using the useRoutes hook.\n */\nexport function wrapUseRoutesV7(origUseRoutes: UseRoutes): UseRoutes {\n return createV6CompatibleWrapUseRoutes(origUseRoutes, '7');\n}\n"],"names":["createReactRouterV6CompatibleTracingIntegration","createV6CompatibleWithSentryReactRouterRouting","createV6CompatibleWrapCreateBrowserRouter","createV6CompatibleWrapCreateMemoryRouter","createV6CompatibleWrapUseRoutes"],"mappings":";;;;;AAaA;AACA;AACA;AACA;AACO,SAAS,sCAAsC;AACtD,EAAE,OAAO;AACT,EAAe;AACf,EAAE,OAAOA,+DAA+C,CAAC,OAAO,EAAE,GAAG,CAAC;AACtE;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,CAAuD,MAAM,EAAQ;AACnH,EAAE,OAAOC,8DAA8C,CAAO,MAAM,EAAE,GAAG,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACO,SAAS;;AAGhB,CAAE,oBAAoB,EAAgF;AACtG,EAAE,OAAOC,yDAAyC,CAAC,oBAAoB,EAAE,GAAG,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS;;AAGhB,CAAE,0BAA0B,EAAgF;AAC5G,EAAE,OAAOC,wDAAwC,CAAC,0BAA0B,EAAE,GAAG,CAAC;AAClF;;AAEA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,aAAa,EAAwB;AACrE,EAAE,OAAOC,+CAA+B,CAAC,aAAa,EAAE,GAAG,CAAC;AAC5D;;;;;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.8.0","sideEffects":false}
|