@depup/sentry__react 10.44.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/build/cjs/constants.js +12 -0
  4. package/build/cjs/constants.js.map +1 -0
  5. package/build/cjs/debug-build.js +11 -0
  6. package/build/cjs/debug-build.js.map +1 -0
  7. package/build/cjs/error.js +113 -0
  8. package/build/cjs/error.js.map +1 -0
  9. package/build/cjs/errorboundary.js +170 -0
  10. package/build/cjs/errorboundary.js.map +1 -0
  11. package/build/cjs/hoist-non-react-statics.js +159 -0
  12. package/build/cjs/hoist-non-react-statics.js.map +1 -0
  13. package/build/cjs/index.js +51 -0
  14. package/build/cjs/index.js.map +1 -0
  15. package/build/cjs/profiler.js +226 -0
  16. package/build/cjs/profiler.js.map +1 -0
  17. package/build/cjs/reactrouter-compat-utils/instrumentation.js +1295 -0
  18. package/build/cjs/reactrouter-compat-utils/instrumentation.js.map +1 -0
  19. package/build/cjs/reactrouter-compat-utils/lazy-routes.js +160 -0
  20. package/build/cjs/reactrouter-compat-utils/lazy-routes.js.map +1 -0
  21. package/build/cjs/reactrouter-compat-utils/route-manifest.js +194 -0
  22. package/build/cjs/reactrouter-compat-utils/route-manifest.js.map +1 -0
  23. package/build/cjs/reactrouter-compat-utils/utils.js +336 -0
  24. package/build/cjs/reactrouter-compat-utils/utils.js.map +1 -0
  25. package/build/cjs/reactrouter.js +236 -0
  26. package/build/cjs/reactrouter.js.map +1 -0
  27. package/build/cjs/reactrouterv3.js +130 -0
  28. package/build/cjs/reactrouterv3.js.map +1 -0
  29. package/build/cjs/reactrouterv6.js +61 -0
  30. package/build/cjs/reactrouterv6.js.map +1 -0
  31. package/build/cjs/reactrouterv7.js +61 -0
  32. package/build/cjs/reactrouterv7.js.map +1 -0
  33. package/build/cjs/redux.js +106 -0
  34. package/build/cjs/redux.js.map +1 -0
  35. package/build/cjs/sdk.js +21 -0
  36. package/build/cjs/sdk.js.map +1 -0
  37. package/build/cjs/tanstackrouter.js +134 -0
  38. package/build/cjs/tanstackrouter.js.map +1 -0
  39. package/build/esm/constants.js +8 -0
  40. package/build/esm/constants.js.map +1 -0
  41. package/build/esm/debug-build.js +9 -0
  42. package/build/esm/debug-build.js.map +1 -0
  43. package/build/esm/error.js +108 -0
  44. package/build/esm/error.js.map +1 -0
  45. package/build/esm/errorboundary.js +166 -0
  46. package/build/esm/errorboundary.js.map +1 -0
  47. package/build/esm/hoist-non-react-statics.js +157 -0
  48. package/build/esm/hoist-non-react-statics.js.map +1 -0
  49. package/build/esm/index.js +12 -0
  50. package/build/esm/index.js.map +1 -0
  51. package/build/esm/package.json +1 -0
  52. package/build/esm/profiler.js +221 -0
  53. package/build/esm/profiler.js.map +1 -0
  54. package/build/esm/reactrouter-compat-utils/instrumentation.js +1281 -0
  55. package/build/esm/reactrouter-compat-utils/instrumentation.js.map +1 -0
  56. package/build/esm/reactrouter-compat-utils/lazy-routes.js +156 -0
  57. package/build/esm/reactrouter-compat-utils/lazy-routes.js.map +1 -0
  58. package/build/esm/reactrouter-compat-utils/route-manifest.js +191 -0
  59. package/build/esm/reactrouter-compat-utils/route-manifest.js.map +1 -0
  60. package/build/esm/reactrouter-compat-utils/utils.js +320 -0
  61. package/build/esm/reactrouter-compat-utils/utils.js.map +1 -0
  62. package/build/esm/reactrouter.js +232 -0
  63. package/build/esm/reactrouter.js.map +1 -0
  64. package/build/esm/reactrouterv3.js +128 -0
  65. package/build/esm/reactrouterv3.js.map +1 -0
  66. package/build/esm/reactrouterv6.js +55 -0
  67. package/build/esm/reactrouterv6.js.map +1 -0
  68. package/build/esm/reactrouterv7.js +55 -0
  69. package/build/esm/reactrouterv7.js.map +1 -0
  70. package/build/esm/redux.js +104 -0
  71. package/build/esm/redux.js.map +1 -0
  72. package/build/esm/sdk.js +19 -0
  73. package/build/esm/sdk.js.map +1 -0
  74. package/build/esm/tanstackrouter.js +132 -0
  75. package/build/esm/tanstackrouter.js.map +1 -0
  76. package/build/types/constants.d.ts +4 -0
  77. package/build/types/constants.d.ts.map +1 -0
  78. package/build/types/debug-build.d.ts +7 -0
  79. package/build/types/debug-build.d.ts.map +1 -0
  80. package/build/types/error.d.ts +41 -0
  81. package/build/types/error.d.ts.map +1 -0
  82. package/build/types/errorboundary.d.ts +87 -0
  83. package/build/types/errorboundary.d.ts.map +1 -0
  84. package/build/types/hoist-non-react-statics.d.ts +21 -0
  85. package/build/types/hoist-non-react-statics.d.ts.map +1 -0
  86. package/build/types/index.d.ts +13 -0
  87. package/build/types/index.d.ts.map +1 -0
  88. package/build/types/profiler.d.ts +56 -0
  89. package/build/types/profiler.d.ts.map +1 -0
  90. package/build/types/reactrouter-compat-utils/index.d.ts +5 -0
  91. package/build/types/reactrouter-compat-utils/index.d.ts.map +1 -0
  92. package/build/types/reactrouter-compat-utils/instrumentation.d.ts +117 -0
  93. package/build/types/reactrouter-compat-utils/instrumentation.d.ts.map +1 -0
  94. package/build/types/reactrouter-compat-utils/lazy-routes.d.ts +18 -0
  95. package/build/types/reactrouter-compat-utils/lazy-routes.d.ts.map +1 -0
  96. package/build/types/reactrouter-compat-utils/route-manifest.d.ts +13 -0
  97. package/build/types/reactrouter-compat-utils/route-manifest.d.ts.map +1 -0
  98. package/build/types/reactrouter-compat-utils/utils.d.ts +71 -0
  99. package/build/types/reactrouter-compat-utils/utils.d.ts.map +1 -0
  100. package/build/types/reactrouter.d.ts +41 -0
  101. package/build/types/reactrouter.d.ts.map +1 -0
  102. package/build/types/reactrouterv3.d.ts +29 -0
  103. package/build/types/reactrouterv3.d.ts.map +1 -0
  104. package/build/types/reactrouterv6.d.ts +32 -0
  105. package/build/types/reactrouterv6.d.ts.map +1 -0
  106. package/build/types/reactrouterv7.d.ts +32 -0
  107. package/build/types/reactrouterv7.d.ts.map +1 -0
  108. package/build/types/redux.d.ts +38 -0
  109. package/build/types/redux.d.ts.map +1 -0
  110. package/build/types/sdk.d.ts +7 -0
  111. package/build/types/sdk.d.ts.map +1 -0
  112. package/build/types/tanstackrouter.d.ts +13 -0
  113. package/build/types/tanstackrouter.d.ts.map +1 -0
  114. package/build/types/types.d.ts +163 -0
  115. package/build/types/types.d.ts.map +1 -0
  116. package/build/types/vendor/tanstackrouter-types.d.ts +36 -0
  117. package/build/types/vendor/tanstackrouter-types.d.ts.map +1 -0
  118. package/build/types-ts3.8/constants.d.ts +4 -0
  119. package/build/types-ts3.8/debug-build.d.ts +7 -0
  120. package/build/types-ts3.8/error.d.ts +41 -0
  121. package/build/types-ts3.8/errorboundary.d.ts +87 -0
  122. package/build/types-ts3.8/hoist-non-react-statics.d.ts +21 -0
  123. package/build/types-ts3.8/index.d.ts +13 -0
  124. package/build/types-ts3.8/profiler.d.ts +56 -0
  125. package/build/types-ts3.8/reactrouter-compat-utils/index.d.ts +5 -0
  126. package/build/types-ts3.8/reactrouter-compat-utils/instrumentation.d.ts +117 -0
  127. package/build/types-ts3.8/reactrouter-compat-utils/lazy-routes.d.ts +18 -0
  128. package/build/types-ts3.8/reactrouter-compat-utils/route-manifest.d.ts +13 -0
  129. package/build/types-ts3.8/reactrouter-compat-utils/utils.d.ts +77 -0
  130. package/build/types-ts3.8/reactrouter.d.ts +41 -0
  131. package/build/types-ts3.8/reactrouterv3.d.ts +29 -0
  132. package/build/types-ts3.8/reactrouterv6.d.ts +32 -0
  133. package/build/types-ts3.8/reactrouterv7.d.ts +32 -0
  134. package/build/types-ts3.8/redux.d.ts +38 -0
  135. package/build/types-ts3.8/sdk.d.ts +7 -0
  136. package/build/types-ts3.8/tanstackrouter.d.ts +13 -0
  137. package/build/types-ts3.8/types.d.ts +163 -0
  138. package/build/types-ts3.8/vendor/tanstackrouter-types.d.ts +36 -0
  139. package/changes.json +5 -0
  140. package/package.json +108 -0
@@ -0,0 +1,130 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const browser = require('@sentry/browser');
4
+ const core = require('@sentry/core');
5
+
6
+ // Many of the types below had to be mocked out to prevent typescript issues
7
+ // these types are required for correct functionality.
8
+
9
+ /**
10
+ * A browser tracing integration that uses React Router v3 to instrument navigations.
11
+ * Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.
12
+ */
13
+ function reactRouterV3BrowserTracingIntegration(
14
+ options,
15
+ ) {
16
+ const integration = browser.browserTracingIntegration({
17
+ ...options,
18
+ instrumentPageLoad: false,
19
+ instrumentNavigation: false,
20
+ });
21
+
22
+ const { history, routes, match, instrumentPageLoad = true, instrumentNavigation = true } = options;
23
+
24
+ return {
25
+ ...integration,
26
+ afterAllSetup(client) {
27
+ integration.afterAllSetup(client);
28
+
29
+ if (instrumentPageLoad && browser.WINDOW.location) {
30
+ normalizeTransactionName(
31
+ routes,
32
+ browser.WINDOW.location ,
33
+ match,
34
+ (localName, source = 'url') => {
35
+ browser.startBrowserTracingPageLoadSpan(client, {
36
+ name: localName,
37
+ attributes: {
38
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
39
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.reactrouter_v3',
40
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,
41
+ },
42
+ });
43
+ },
44
+ );
45
+ }
46
+
47
+ if (instrumentNavigation && history.listen) {
48
+ history.listen(location => {
49
+ if (location.action === 'PUSH' || location.action === 'POP') {
50
+ normalizeTransactionName(
51
+ routes,
52
+ location,
53
+ match,
54
+ (localName, source = 'url') => {
55
+ browser.startBrowserTracingNavigationSpan(client, {
56
+ name: localName,
57
+ attributes: {
58
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
59
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.reactrouter_v3',
60
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,
61
+ },
62
+ });
63
+ },
64
+ );
65
+ }
66
+ });
67
+ }
68
+ },
69
+ };
70
+ }
71
+
72
+ /**
73
+ * Normalize transaction names using `Router.match`
74
+ */
75
+ function normalizeTransactionName(
76
+ appRoutes,
77
+ location,
78
+ match,
79
+ callback,
80
+ ) {
81
+ let name = location.pathname;
82
+ match(
83
+ {
84
+ location,
85
+ routes: appRoutes,
86
+ },
87
+ (error, _redirectLocation, renderProps) => {
88
+ if (error || !renderProps) {
89
+ return callback(name);
90
+ }
91
+
92
+ const routePath = getRouteStringFromRoutes(renderProps.routes || []);
93
+ if (routePath.length === 0 || routePath === '/*') {
94
+ return callback(name);
95
+ }
96
+
97
+ name = routePath;
98
+ return callback(name, 'route');
99
+ },
100
+ );
101
+ }
102
+
103
+ /**
104
+ * Generate route name from array of routes
105
+ */
106
+ function getRouteStringFromRoutes(routes) {
107
+ if (!Array.isArray(routes) || routes.length === 0) {
108
+ return '';
109
+ }
110
+
111
+ const routesWithPaths = routes.filter((route) => !!route.path);
112
+
113
+ let index = -1;
114
+ for (let x = routesWithPaths.length - 1; x >= 0; x--) {
115
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
116
+ const route = routesWithPaths[x];
117
+ if (route.path?.startsWith('/')) {
118
+ index = x;
119
+ break;
120
+ }
121
+ }
122
+
123
+ return routesWithPaths.slice(index).reduce((acc, { path }) => {
124
+ const pathSegment = acc === '/' || acc === '' ? path : `/${path}`;
125
+ return `${acc}${pathSegment}`;
126
+ }, '');
127
+ }
128
+
129
+ exports.reactRouterV3BrowserTracingIntegration = reactRouterV3BrowserTracingIntegration;
130
+ //# sourceMappingURL=reactrouterv3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactrouterv3.js","sources":["../../src/reactrouterv3.ts"],"sourcesContent":["import {\n browserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Integration, TransactionSource } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport type { Location } from './types';\n\n// Many of the types below had to be mocked out to prevent typescript issues\n// these types are required for correct functionality.\n\ntype HistoryV3 = {\n location?: Location;\n listen?(cb: (location: Location) => void): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n} & Record<string, any>;\n\nexport type Route = { path?: string; childRoutes?: Route[] };\n\nexport type Match = (\n props: { location: Location; routes: Route[] },\n cb: (error?: Error, _redirectLocation?: Location, renderProps?: { routes?: Route[] }) => void,\n) => void;\n\ntype ReactRouterV3TransactionSource = Extract<TransactionSource, 'url' | 'route'>;\n\ninterface ReactRouterOptions {\n history: HistoryV3;\n routes: Route[];\n match: Match;\n}\n\n/**\n * A browser tracing integration that uses React Router v3 to instrument navigations.\n * Expects `history` (and optionally `routes` and `matchPath`) to be passed as options.\n */\nexport function reactRouterV3BrowserTracingIntegration(\n options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions,\n): Integration {\n const integration = browserTracingIntegration({\n ...options,\n instrumentPageLoad: false,\n instrumentNavigation: false,\n });\n\n const { history, routes, match, instrumentPageLoad = true, instrumentNavigation = true } = options;\n\n return {\n ...integration,\n afterAllSetup(client) {\n integration.afterAllSetup(client);\n\n if (instrumentPageLoad && WINDOW.location) {\n normalizeTransactionName(\n routes,\n WINDOW.location as unknown as Location,\n match,\n (localName: string, source: ReactRouterV3TransactionSource = 'url') => {\n startBrowserTracingPageLoadSpan(client, {\n name: localName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.reactrouter_v3',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n },\n });\n },\n );\n }\n\n if (instrumentNavigation && history.listen) {\n history.listen(location => {\n if (location.action === 'PUSH' || location.action === 'POP') {\n normalizeTransactionName(\n routes,\n location,\n match,\n (localName: string, source: TransactionSource = 'url') => {\n startBrowserTracingNavigationSpan(client, {\n name: localName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.reactrouter_v3',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: source,\n },\n });\n },\n );\n }\n });\n }\n },\n };\n}\n\n/**\n * Normalize transaction names using `Router.match`\n */\nfunction normalizeTransactionName(\n appRoutes: Route[],\n location: Location,\n match: Match,\n callback: (pathname: string, source?: ReactRouterV3TransactionSource) => void,\n): void {\n let name = location.pathname;\n match(\n {\n location,\n routes: appRoutes,\n },\n (error, _redirectLocation, renderProps) => {\n if (error || !renderProps) {\n return callback(name);\n }\n\n const routePath = getRouteStringFromRoutes(renderProps.routes || []);\n if (routePath.length === 0 || routePath === '/*') {\n return callback(name);\n }\n\n name = routePath;\n return callback(name, 'route');\n },\n );\n}\n\n/**\n * Generate route name from array of routes\n */\nfunction getRouteStringFromRoutes(routes: Route[]): string {\n if (!Array.isArray(routes) || routes.length === 0) {\n return '';\n }\n\n const routesWithPaths: Route[] = routes.filter((route: Route) => !!route.path);\n\n let index = -1;\n for (let x = routesWithPaths.length - 1; x >= 0; x--) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const route = routesWithPaths[x]!;\n if (route.path?.startsWith('/')) {\n index = x;\n break;\n }\n }\n\n return routesWithPaths.slice(index).reduce((acc, { path }) => {\n const pathSegment = acc === '/' || acc === '' ? path : `/${path}`;\n return `${acc}${pathSegment}`;\n }, '');\n}\n"],"names":["browserTracingIntegration","WINDOW","startBrowserTracingPageLoadSpan","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","startBrowserTracingNavigationSpan"],"mappings":";;;;;AAcA;AACA;;AAuBA;AACA;AACA;AACA;AACO,SAAS,sCAAsC;AACt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AAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAA,IAAK,MAAM,CAAC,MAAA,KAAW,CAAC,EAAE;AACrD,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF,EAAE,MAAM,eAAe,GAAY,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,KAAY,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;;AAEhF,EAAE,IAAI,KAAA,GAAQ,EAAE;AAChB,EAAE,KAAK,IAAI,CAAA,GAAI,eAAe,CAAC,MAAA,GAAS,CAAC,EAAE,CAAA,IAAK,CAAC,EAAE,CAAC,EAAE,EAAE;AACxD;AACA,IAAI,MAAM,KAAA,GAAQ,eAAe,CAAC,CAAC,CAAC;AACpC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE;AACrC,MAAM,KAAA,GAAQ,CAAC;AACf,MAAM;AACN,IAAI;AACJ,EAAE;;AAEF,EAAE,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,IAAA,EAAM,KAAK;AAChE,IAAI,MAAM,WAAA,GAAc,QAAQ,GAAA,IAAO,GAAA,KAAQ,EAAA,GAAK,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AACA,IAAA,OAAA,CAAA,EAAA,GAAA,CAAA,EAAA,WAAA,CAAA,CAAA;AACA,EAAA,CAAA,EAAA,EAAA,CAAA;AACA;;;;"}
@@ -0,0 +1,61 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const instrumentation = require('./reactrouter-compat-utils/instrumentation.js');
4
+ require('@sentry/core');
5
+ require('@sentry/browser');
6
+
7
+ /**
8
+ * A browser tracing integration that uses React Router v6 to instrument navigations.
9
+ * Expects `useEffect`, `useLocation`, `useNavigationType`, `createRoutesFromChildren` and `matchRoutes` to be passed as options.
10
+ */
11
+ function reactRouterV6BrowserTracingIntegration(
12
+ options,
13
+ ) {
14
+ return instrumentation.createReactRouterV6CompatibleTracingIntegration(options, '6');
15
+ }
16
+
17
+ /**
18
+ * A wrapper function that adds Sentry routing instrumentation to a React Router v6 useRoutes hook.
19
+ * This is used to automatically capture route changes as transactions when using the useRoutes hook.
20
+ */
21
+ function wrapUseRoutesV6(origUseRoutes) {
22
+ return instrumentation.createV6CompatibleWrapUseRoutes(origUseRoutes, '6');
23
+ }
24
+
25
+ /**
26
+ * A wrapper function that adds Sentry routing instrumentation to a React Router v6 createBrowserRouter function.
27
+ * This is used to automatically capture route changes as transactions when using the createBrowserRouter API.
28
+ */
29
+ function wrapCreateBrowserRouterV6
30
+
31
+ (createRouterFunction) {
32
+ return instrumentation.createV6CompatibleWrapCreateBrowserRouter(createRouterFunction, '6');
33
+ }
34
+
35
+ /**
36
+ * A wrapper function that adds Sentry routing instrumentation to a React Router v6 createMemoryRouter function.
37
+ * This is used to automatically capture route changes as transactions when using the createMemoryRouter API.
38
+ * The difference between createBrowserRouter and createMemoryRouter is that with createMemoryRouter,
39
+ * optional `initialEntries` are also taken into account.
40
+ */
41
+ function wrapCreateMemoryRouterV6
42
+
43
+ (createMemoryRouterFunction) {
44
+ return instrumentation.createV6CompatibleWrapCreateMemoryRouter(createMemoryRouterFunction, '6');
45
+ }
46
+
47
+ /**
48
+ * A higher-order component that adds Sentry routing instrumentation to a React Router v6 Route component.
49
+ * This is used to automatically capture route changes as transactions.
50
+ */
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ function withSentryReactRouterV6Routing(routes) {
53
+ return instrumentation.createV6CompatibleWithSentryReactRouterRouting(routes, '6');
54
+ }
55
+
56
+ exports.reactRouterV6BrowserTracingIntegration = reactRouterV6BrowserTracingIntegration;
57
+ exports.withSentryReactRouterV6Routing = withSentryReactRouterV6Routing;
58
+ exports.wrapCreateBrowserRouterV6 = wrapCreateBrowserRouterV6;
59
+ exports.wrapCreateMemoryRouterV6 = wrapCreateMemoryRouterV6;
60
+ exports.wrapUseRoutesV6 = wrapUseRoutesV6;
61
+ //# sourceMappingURL=reactrouterv6.js.map
@@ -0,0 +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 './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 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":["createReactRouterV6CompatibleTracingIntegration","createV6CompatibleWrapUseRoutes","createV6CompatibleWrapCreateBrowserRouter","createV6CompatibleWrapCreateMemoryRouter","createV6CompatibleWithSentryReactRouterRouting"],"mappings":";;;;;;AAYA;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;AACO,SAAS,eAAe,CAAC,aAAa,EAAwB;AACrE,EAAE,OAAOC,+CAA+B,CAAC,aAAa,EAAE,GAAG,CAAC;AAC5D;;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;AACA;AACO,SAAS,8BAA8B,CAAuD,MAAM,EAAQ;AACnH,EAAE,OAAOC,8DAA8C,CAAO,MAAM,EAAE,GAAG,CAAC;AAC1E;;;;;;;;"}
@@ -0,0 +1,61 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const instrumentation = require('./reactrouter-compat-utils/instrumentation.js');
4
+ require('@sentry/core');
5
+ require('@sentry/browser');
6
+
7
+ /**
8
+ * A browser tracing integration that uses React Router v7 to instrument navigations.
9
+ * Expects `useEffect`, `useLocation`, `useNavigationType`, `createRoutesFromChildren` and `matchRoutes` to be passed as options.
10
+ */
11
+ function reactRouterV7BrowserTracingIntegration(
12
+ options,
13
+ ) {
14
+ return instrumentation.createReactRouterV6CompatibleTracingIntegration(options, '7');
15
+ }
16
+
17
+ /**
18
+ * A higher-order component that adds Sentry routing instrumentation to a React Router v7 Route component.
19
+ * This is used to automatically capture route changes as transactions.
20
+ */
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
+ function withSentryReactRouterV7Routing(routes) {
23
+ return instrumentation.createV6CompatibleWithSentryReactRouterRouting(routes, '7');
24
+ }
25
+
26
+ /**
27
+ * A wrapper function that adds Sentry routing instrumentation to a React Router v7 createBrowserRouter function.
28
+ * This is used to automatically capture route changes as transactions when using the createBrowserRouter API.
29
+ */
30
+ function wrapCreateBrowserRouterV7
31
+
32
+ (createRouterFunction) {
33
+ return instrumentation.createV6CompatibleWrapCreateBrowserRouter(createRouterFunction, '7');
34
+ }
35
+
36
+ /**
37
+ * A wrapper function that adds Sentry routing instrumentation to a React Router v7 createMemoryRouter function.
38
+ * This is used to automatically capture route changes as transactions when using the createMemoryRouter API.
39
+ * The difference between createBrowserRouter and createMemoryRouter is that with createMemoryRouter,
40
+ * optional `initialEntries` are also taken into account.
41
+ */
42
+ function wrapCreateMemoryRouterV7
43
+
44
+ (createMemoryRouterFunction) {
45
+ return instrumentation.createV6CompatibleWrapCreateMemoryRouter(createMemoryRouterFunction, '7');
46
+ }
47
+
48
+ /**
49
+ * A wrapper function that adds Sentry routing instrumentation to a React Router v7 useRoutes hook.
50
+ * This is used to automatically capture route changes as transactions when using the useRoutes hook.
51
+ */
52
+ function wrapUseRoutesV7(origUseRoutes) {
53
+ return instrumentation.createV6CompatibleWrapUseRoutes(origUseRoutes, '7');
54
+ }
55
+
56
+ exports.reactRouterV7BrowserTracingIntegration = reactRouterV7BrowserTracingIntegration;
57
+ exports.withSentryReactRouterV7Routing = withSentryReactRouterV7Routing;
58
+ exports.wrapCreateBrowserRouterV7 = wrapCreateBrowserRouterV7;
59
+ exports.wrapCreateMemoryRouterV7 = wrapCreateMemoryRouterV7;
60
+ exports.wrapUseRoutesV7 = wrapUseRoutesV7;
61
+ //# sourceMappingURL=reactrouterv7.js.map
@@ -0,0 +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 './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;;;;;;;;"}
@@ -0,0 +1,106 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+
5
+ const ACTION_BREADCRUMB_CATEGORY = 'redux.action';
6
+ const ACTION_BREADCRUMB_TYPE = 'info';
7
+
8
+ const defaultOptions = {
9
+ attachReduxState: true,
10
+ actionTransformer: action => action,
11
+ stateTransformer: state => state || null,
12
+ };
13
+
14
+ /**
15
+ * Creates an enhancer that would be passed to Redux's createStore to log actions and the latest state to Sentry.
16
+ *
17
+ * @param enhancerOptions Options to pass to the enhancer
18
+ */
19
+ function createReduxEnhancer(enhancerOptions) {
20
+ // Note: We return an any type as to not have type conflicts.
21
+ const options = {
22
+ ...defaultOptions,
23
+ ...enhancerOptions,
24
+ };
25
+
26
+ return (next) =>
27
+ (reducer, initialState) => {
28
+ options.attachReduxState &&
29
+ core.getGlobalScope().addEventProcessor((event, hint) => {
30
+ try {
31
+ // @ts-expect-error try catch to reduce bundle size
32
+ if (event.type === undefined && event.contexts.state.state.type === 'redux') {
33
+ hint.attachments = [
34
+ ...(hint.attachments || []),
35
+ // @ts-expect-error try catch to reduce bundle size
36
+ { filename: 'redux_state.json', data: JSON.stringify(event.contexts.state.state.value) },
37
+ ];
38
+ }
39
+ } catch {
40
+ // empty
41
+ }
42
+ return event;
43
+ });
44
+
45
+ function sentryWrapReducer(reducer) {
46
+ return (state, action) => {
47
+ const newState = reducer(state, action);
48
+
49
+ const scope = core.getCurrentScope();
50
+
51
+ /* Action breadcrumbs */
52
+ const transformedAction = options.actionTransformer(action);
53
+ if (typeof transformedAction !== 'undefined' && transformedAction !== null) {
54
+ core.addBreadcrumb({
55
+ category: ACTION_BREADCRUMB_CATEGORY,
56
+ data: transformedAction,
57
+ type: ACTION_BREADCRUMB_TYPE,
58
+ });
59
+ }
60
+
61
+ /* Set latest state to scope */
62
+ const transformedState = options.stateTransformer(newState);
63
+ if (typeof transformedState !== 'undefined' && transformedState !== null) {
64
+ const client = core.getClient();
65
+ const options = client?.getOptions();
66
+ const normalizationDepth = options?.normalizeDepth || 3; // default state normalization depth to 3
67
+
68
+ // Set the normalization depth of the redux state to the configured `normalizeDepth` option or a sane number as a fallback
69
+ const newStateContext = { state: { type: 'redux', value: transformedState } };
70
+ core.addNonEnumerableProperty(
71
+ newStateContext,
72
+ '__sentry_override_normalization_depth__',
73
+ 3 + // 3 layers for `state.value.transformedState`
74
+ normalizationDepth, // rest for the actual state
75
+ );
76
+
77
+ scope.setContext('state', newStateContext);
78
+ } else {
79
+ scope.setContext('state', null);
80
+ }
81
+
82
+ /* Allow user to configure scope with latest state */
83
+ const { configureScopeWithState } = options;
84
+ if (typeof configureScopeWithState === 'function') {
85
+ configureScopeWithState(scope, newState);
86
+ }
87
+
88
+ return newState;
89
+ };
90
+ }
91
+
92
+ const store = next(sentryWrapReducer(reducer), initialState);
93
+
94
+ // eslint-disable-next-line @typescript-eslint/unbound-method
95
+ store.replaceReducer = new Proxy(store.replaceReducer, {
96
+ apply: function (target, thisArg, args) {
97
+ target.apply(thisArg, [sentryWrapReducer(args[0])]);
98
+ },
99
+ });
100
+
101
+ return store;
102
+ };
103
+ }
104
+
105
+ exports.createReduxEnhancer = createReduxEnhancer;
106
+ //# sourceMappingURL=redux.js.map
@@ -0,0 +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> =\n Required<S> extends {\n [$CombinedState]: undefined;\n }\n ? S extends CombinedState<infer S1>\n ? { [K in keyof S1]?: S1[K] extends Record<string, unknown> ? PreloadedState<S1[K]> : S1[K] }\n : never\n : { [K in keyof S]: S[K] extends string | number | boolean | symbol ? S[K] : PreloadedState<S[K]> };\n\ntype StoreEnhancerStoreCreator<Ext = Record<string, unknown>, StateExt = never> = <\n S = any,\n A extends Action = AnyAction,\n>(\n reducer: Reducer<S, A>,\n preloadedState?: PreloadedState<S>,\n) => Store<ExtendState<S, StateExt>, A, StateExt, Ext> & Ext;\n\nexport interface SentryEnhancerOptions<S = any> {\n /**\n * Redux state in attachments or not.\n * @default true\n */\n attachReduxState?: boolean;\n\n /**\n * Transforms the state before attaching it to an event.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not attach the state.\n */\n stateTransformer(state: S | undefined): (S & any) | null;\n /**\n * Transforms the action before sending it as a breadcrumb.\n * Use this to remove any private data before sending it to Sentry.\n * Return null to not send the breadcrumb.\n */\n actionTransformer(action: AnyAction): AnyAction | null;\n /**\n * Called on every state update, configure the Sentry Scope with the redux state.\n */\n configureScopeWithState?(scope: Scope, state: S): void;\n}\n\nconst ACTION_BREADCRUMB_CATEGORY = 'redux.action';\nconst ACTION_BREADCRUMB_TYPE = 'info';\n\nconst defaultOptions: SentryEnhancerOptions = {\n attachReduxState: true,\n actionTransformer: action => action,\n stateTransformer: state => state || null,\n};\n\n/**\n * Creates an enhancer that would be passed to Redux's createStore to log actions and the latest state to Sentry.\n *\n * @param enhancerOptions Options to pass to the enhancer\n */\nfunction createReduxEnhancer(enhancerOptions?: Partial<SentryEnhancerOptions>): any {\n // Note: We return an any type as to not have type conflicts.\n const options = {\n ...defaultOptions,\n ...enhancerOptions,\n };\n\n return (next: StoreEnhancerStoreCreator): StoreEnhancerStoreCreator =>\n <S = any, A extends Action = AnyAction>(reducer: Reducer<S, A>, initialState?: PreloadedState<S>) => {\n options.attachReduxState &&\n getGlobalScope().addEventProcessor((event, hint) => {\n try {\n // @ts-expect-error try catch to reduce bundle size\n if (event.type === undefined && event.contexts.state.state.type === 'redux') {\n hint.attachments = [\n ...(hint.attachments || []),\n // @ts-expect-error try catch to reduce bundle size\n { filename: 'redux_state.json', data: JSON.stringify(event.contexts.state.state.value) },\n ];\n }\n } catch {\n // empty\n }\n return event;\n });\n\n function sentryWrapReducer(reducer: Reducer<S, A>): Reducer<S, A> {\n return (state, action): S => {\n const newState = reducer(state, action);\n\n const scope = getCurrentScope();\n\n /* Action breadcrumbs */\n const transformedAction = options.actionTransformer(action);\n if (typeof transformedAction !== 'undefined' && transformedAction !== null) {\n addBreadcrumb({\n category: ACTION_BREADCRUMB_CATEGORY,\n data: transformedAction,\n type: ACTION_BREADCRUMB_TYPE,\n });\n }\n\n /* Set latest state to scope */\n const transformedState = options.stateTransformer(newState);\n if (typeof transformedState !== 'undefined' && transformedState !== null) {\n const client = getClient();\n const options = client?.getOptions();\n const normalizationDepth = options?.normalizeDepth || 3; // default state normalization depth to 3\n\n // Set the normalization depth of the redux state to the configured `normalizeDepth` option or a sane number as a fallback\n const newStateContext = { state: { type: 'redux', value: transformedState } };\n addNonEnumerableProperty(\n newStateContext,\n '__sentry_override_normalization_depth__',\n 3 + // 3 layers for `state.value.transformedState`\n normalizationDepth, // rest for the actual state\n );\n\n scope.setContext('state', newStateContext);\n } else {\n scope.setContext('state', null);\n }\n\n /* Allow user to configure scope with latest state */\n const { configureScopeWithState } = options;\n if (typeof configureScopeWithState === 'function') {\n configureScopeWithState(scope, newState);\n }\n\n return newState;\n };\n }\n\n const store = next(sentryWrapReducer(reducer), initialState);\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n store.replaceReducer = new Proxy(store.replaceReducer, {\n apply: function (target, thisArg, args) {\n target.apply(thisArg, [sentryWrapReducer(args[0])]);\n },\n });\n\n return store;\n };\n}\n\nexport { createReduxEnhancer };\n"],"names":["getGlobalScope","getCurrentScope","addBreadcrumb","getClient","addNonEnumerableProperty"],"mappings":";;;;AA2EA,MAAM,0BAAA,GAA6B,cAAc;AACjD,MAAM,sBAAA,GAAyB,MAAM;;AAErC,MAAM,cAAc,GAA0B;AAC9C,EAAE,gBAAgB,EAAE,IAAI;AACxB,EAAE,iBAAiB,EAAE,MAAA,IAAU,MAAM;AACrC,EAAE,gBAAgB,EAAE,KAAA,IAAS,KAAA,IAAS,IAAI;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,SAAS,mBAAmB,CAAC,eAAe,EAAwC;AACpF;AACA,EAAE,MAAM,UAAU;AAClB,IAAI,GAAG,cAAc;AACrB,IAAI,GAAG,eAAe;AACtB,GAAG;;AAEH,EAAE,OAAO,CAAC,IAAI;AACd,IAAI,CAAwC,OAAO,EAAiB,YAAY,KAAyB;AACzG,MAAM,OAAO,CAAC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21 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const browser = require('@sentry/browser');
4
+ const core = require('@sentry/core');
5
+ const React = require('react');
6
+
7
+ /**
8
+ * Inits the React SDK
9
+ */
10
+ function init(options) {
11
+ const opts = {
12
+ ...options,
13
+ };
14
+
15
+ core.applySdkMetadata(opts, 'react');
16
+ browser.setContext('react', { version: React.version });
17
+ return browser.init(opts);
18
+ }
19
+
20
+ exports.init = init;
21
+ //# sourceMappingURL=sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { BrowserOptions } from '@sentry/browser';\nimport { init as browserInit, setContext } from '@sentry/browser';\nimport type { Client } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport { version } from 'react';\n\n/**\n * Inits the React SDK\n */\nexport function init(options: BrowserOptions): Client | undefined {\n const opts = {\n ...options,\n };\n\n applySdkMetadata(opts, 'react');\n setContext('react', { version });\n return browserInit(opts);\n}\n"],"names":["applySdkMetadata","setContext","version","browserInit"],"mappings":";;;;;;AAMA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAsC;AAClE,EAAE,MAAM,OAAO;AACf,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAEA,qBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC;AACjC,EAAEC,kBAAU,CAAC,OAAO,EAAE,WAAEC,aAAA,EAAS,CAAC;AAClC,EAAE,OAAOC,YAAW,CAAC,IAAI,CAAC;AAC1B;;;;"}
@@ -0,0 +1,134 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const browser = require('@sentry/browser');
4
+ const core = require('@sentry/core');
5
+
6
+ /**
7
+ * A custom browser tracing integration for TanStack Router.
8
+ *
9
+ * The minimum compatible version of `@tanstack/react-router` is `1.64.0`.
10
+ *
11
+ * @param router A TanStack Router `Router` instance that should be used for routing instrumentation.
12
+ * @param options Sentry browser tracing configuration.
13
+ */
14
+ function tanstackRouterBrowserTracingIntegration(
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
+ router, // This is `any` because we don't want any type mismatches if TanStack Router changes their types
17
+ options = {},
18
+ ) {
19
+ const castRouterInstance = router;
20
+
21
+ const browserTracingIntegrationInstance = browser.browserTracingIntegration({
22
+ ...options,
23
+ instrumentNavigation: false,
24
+ instrumentPageLoad: false,
25
+ });
26
+
27
+ const { instrumentPageLoad = true, instrumentNavigation = true } = options;
28
+
29
+ return {
30
+ ...browserTracingIntegrationInstance,
31
+ afterAllSetup(client) {
32
+ browserTracingIntegrationInstance.afterAllSetup(client);
33
+
34
+ const initialWindowLocation = browser.WINDOW.location;
35
+ if (instrumentPageLoad && initialWindowLocation) {
36
+ const matchedRoutes = castRouterInstance.matchRoutes(
37
+ initialWindowLocation.pathname,
38
+ castRouterInstance.options.parseSearch(initialWindowLocation.search),
39
+ { preload: false, throwOnError: false },
40
+ );
41
+
42
+ const lastMatch = matchedRoutes[matchedRoutes.length - 1];
43
+ // If we only match __root__, we ended up not matching any route at all, so
44
+ // we fall back to the pathname.
45
+ const routeMatch = lastMatch?.routeId !== '__root__' ? lastMatch : undefined;
46
+
47
+ browser.startBrowserTracingPageLoadSpan(client, {
48
+ name: routeMatch ? routeMatch.routeId : initialWindowLocation.pathname,
49
+ attributes: {
50
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload',
51
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.tanstack_router',
52
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: routeMatch ? 'route' : 'url',
53
+ ...routeMatchToParamSpanAttributes(routeMatch),
54
+ },
55
+ });
56
+ }
57
+
58
+ if (instrumentNavigation) {
59
+ // 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
60
+ castRouterInstance.subscribe('onBeforeNavigate', onBeforeNavigateArgs => {
61
+ // onBeforeNavigate is called during pageloads. We can avoid creating navigation spans by:
62
+ // 1. Checking if there's no fromLocation (initial pageload)
63
+ // 2. Comparing the states of the to and from arguments
64
+ if (
65
+ !onBeforeNavigateArgs.fromLocation ||
66
+ onBeforeNavigateArgs.toLocation.state === onBeforeNavigateArgs.fromLocation.state
67
+ ) {
68
+ return;
69
+ }
70
+
71
+ const matchedRoutesOnBeforeNavigate = castRouterInstance.matchRoutes(
72
+ onBeforeNavigateArgs.toLocation.pathname,
73
+ onBeforeNavigateArgs.toLocation.search,
74
+ { preload: false, throwOnError: false },
75
+ );
76
+
77
+ const onBeforeNavigateLastMatch = matchedRoutesOnBeforeNavigate[matchedRoutesOnBeforeNavigate.length - 1];
78
+ const onBeforeNavigateRouteMatch =
79
+ onBeforeNavigateLastMatch?.routeId !== '__root__' ? onBeforeNavigateLastMatch : undefined;
80
+
81
+ const navigationLocation = browser.WINDOW.location;
82
+ const navigationSpan = browser.startBrowserTracingNavigationSpan(client, {
83
+ name: onBeforeNavigateRouteMatch ? onBeforeNavigateRouteMatch.routeId : navigationLocation.pathname,
84
+ attributes: {
85
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'navigation',
86
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.react.tanstack_router',
87
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: onBeforeNavigateRouteMatch ? 'route' : 'url',
88
+ },
89
+ });
90
+
91
+ // In case the user is redirected during navigation we want to update the span with the right value.
92
+ const unsubscribeOnResolved = castRouterInstance.subscribe('onResolved', onResolvedArgs => {
93
+ unsubscribeOnResolved();
94
+ if (navigationSpan) {
95
+ const matchedRoutesOnResolved = castRouterInstance.matchRoutes(
96
+ onResolvedArgs.toLocation.pathname,
97
+ onResolvedArgs.toLocation.search,
98
+ { preload: false, throwOnError: false },
99
+ );
100
+
101
+ const onResolvedLastMatch = matchedRoutesOnResolved[matchedRoutesOnResolved.length - 1];
102
+ const onResolvedRouteMatch =
103
+ onResolvedLastMatch?.routeId !== '__root__' ? onResolvedLastMatch : undefined;
104
+
105
+ if (onResolvedRouteMatch) {
106
+ navigationSpan.updateName(onResolvedRouteMatch.routeId);
107
+ navigationSpan.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
108
+ navigationSpan.setAttributes(routeMatchToParamSpanAttributes(onResolvedRouteMatch));
109
+ }
110
+ }
111
+ });
112
+ });
113
+ }
114
+ },
115
+ };
116
+ }
117
+
118
+ function routeMatchToParamSpanAttributes(match) {
119
+ if (!match) {
120
+ return {};
121
+ }
122
+
123
+ const paramAttributes = {};
124
+ Object.entries(match.params).forEach(([key, value]) => {
125
+ paramAttributes[`url.path.params.${key}`] = value; // TODO(v11): remove attribute which does not adhere to Sentry's semantic convention
126
+ paramAttributes[`url.path.parameter.${key}`] = value;
127
+ paramAttributes[`params.${key}`] = value; // params.[key] is an alias
128
+ });
129
+
130
+ return paramAttributes;
131
+ }
132
+
133
+ exports.tanstackRouterBrowserTracingIntegration = tanstackRouterBrowserTracingIntegration;
134
+ //# sourceMappingURL=tanstackrouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tanstackrouter.js","sources":["../../src/tanstackrouter.ts"],"sourcesContent":["import {\n browserTracingIntegration as originalBrowserTracingIntegration,\n startBrowserTracingNavigationSpan,\n startBrowserTracingPageLoadSpan,\n WINDOW,\n} from '@sentry/browser';\nimport type { Integration } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport type { VendoredTanstackRouter, VendoredTanstackRouterRouteMatch } from './vendor/tanstackrouter-types';\n\n/**\n * A custom browser tracing integration for TanStack Router.\n *\n * The minimum compatible version of `@tanstack/react-router` is `1.64.0`.\n *\n * @param router A TanStack Router `Router` instance that should be used for routing instrumentation.\n * @param options Sentry browser tracing configuration.\n */\nexport function tanstackRouterBrowserTracingIntegration(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n router: any, // This is `any` because we don't want any type mismatches if TanStack Router changes their types\n options: Parameters<typeof originalBrowserTracingIntegration>[0] = {},\n): Integration {\n const castRouterInstance: VendoredTanstackRouter = router;\n\n const browserTracingIntegrationInstance = originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n instrumentPageLoad: false,\n });\n\n const { instrumentPageLoad = true, instrumentNavigation = true } = options;\n\n return {\n ...browserTracingIntegrationInstance,\n afterAllSetup(client) {\n browserTracingIntegrationInstance.afterAllSetup(client);\n\n const initialWindowLocation = WINDOW.location;\n if (instrumentPageLoad && initialWindowLocation) {\n const matchedRoutes = castRouterInstance.matchRoutes(\n initialWindowLocation.pathname,\n castRouterInstance.options.parseSearch(initialWindowLocation.search),\n { preload: false, throwOnError: false },\n );\n\n const lastMatch = matchedRoutes[matchedRoutes.length - 1];\n // If we only match __root__, we ended up not matching any route at all, so\n // we fall back to the pathname.\n const routeMatch = lastMatch?.routeId !== '__root__' ? lastMatch : undefined;\n\n startBrowserTracingPageLoadSpan(client, {\n name: routeMatch ? routeMatch.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]: routeMatch ? 'route' : 'url',\n ...routeMatchToParamSpanAttributes(routeMatch),\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:\n // 1. Checking if there's no fromLocation (initial pageload)\n // 2. Comparing the states of the to and from arguments\n if (\n !onBeforeNavigateArgs.fromLocation ||\n onBeforeNavigateArgs.toLocation.state === onBeforeNavigateArgs.fromLocation.state\n ) {\n return;\n }\n\n const matchedRoutesOnBeforeNavigate = castRouterInstance.matchRoutes(\n onBeforeNavigateArgs.toLocation.pathname,\n onBeforeNavigateArgs.toLocation.search,\n { preload: false, throwOnError: false },\n );\n\n const onBeforeNavigateLastMatch = matchedRoutesOnBeforeNavigate[matchedRoutesOnBeforeNavigate.length - 1];\n const onBeforeNavigateRouteMatch =\n onBeforeNavigateLastMatch?.routeId !== '__root__' ? onBeforeNavigateLastMatch : undefined;\n\n const navigationLocation = WINDOW.location;\n const navigationSpan = startBrowserTracingNavigationSpan(client, {\n name: onBeforeNavigateRouteMatch ? onBeforeNavigateRouteMatch.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]: onBeforeNavigateRouteMatch ? '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 matchedRoutesOnResolved = castRouterInstance.matchRoutes(\n onResolvedArgs.toLocation.pathname,\n onResolvedArgs.toLocation.search,\n { preload: false, throwOnError: false },\n );\n\n const onResolvedLastMatch = matchedRoutesOnResolved[matchedRoutesOnResolved.length - 1];\n const onResolvedRouteMatch =\n onResolvedLastMatch?.routeId !== '__root__' ? onResolvedLastMatch : undefined;\n\n if (onResolvedRouteMatch) {\n navigationSpan.updateName(onResolvedRouteMatch.routeId);\n navigationSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n navigationSpan.setAttributes(routeMatchToParamSpanAttributes(onResolvedRouteMatch));\n }\n }\n });\n });\n }\n },\n };\n}\n\nfunction routeMatchToParamSpanAttributes(match: VendoredTanstackRouterRouteMatch | undefined): Record<string, string> {\n if (!match) {\n return {};\n }\n\n const paramAttributes: Record<string, string> = {};\n Object.entries(match.params).forEach(([key, value]) => {\n paramAttributes[`url.path.params.${key}`] = value; // TODO(v11): remove attribute which does not adhere to Sentry's semantic convention\n paramAttributes[`url.path.parameter.${key}`] = value;\n paramAttributes[`params.${key}`] = value; // params.[key] is an alias\n });\n\n return paramAttributes;\n}\n"],"names":["originalBrowserTracingIntegration","WINDOW","startBrowserTracingPageLoadSpan","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","startBrowserTracingNavigationSpan"],"mappings":";;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uCAAuC;AACvD;AACA,EAAE,MAAM;AACR,EAAE,OAAO,GAA4D,EAAE;AACvE,EAAe;AACf,EAAE,MAAM,kBAAkB,GAA2B,MAAM;;AAE3D,EAAE,MAAM,iCAAA,GAAoCA,iCAAiC,CAAC;AAC9E,IAAI,GAAG,OAAO;AACd,IAAI,oBAAoB,EAAE,KAAK;AAC/B,IAAI,kBAAkB,EAAE,KAAK;AAC7B,GAAG,CAAC;;AAEJ,EAAE,MAAM,EAAE,kBAAA,GAAqB,IAAI,EAAE,oBAAA,GAAuB,IAAA,EAAK,GAAI,OAAO;;AAE5E,EAAE,OAAO;AACT,IAAI,GAAG,iCAAiC;AACxC,IAAI,aAAa,CAAC,MAAM,EAAE;AAC1B,MAAM,iCAAiC,CAAC,aAAa,CAAC,MAAM,CAAC;;AAE7D,MAAM,MAAM,qBAAA,GAAwBC,cAAM,CAAC,QAAQ;AACnD,MAAM,IAAI,kBAAA,IAAsB,qBAAqB,EAAE;AACvD,QAAQ,MAAM,aAAA,GAAgB,kBAAkB,CAAC,WAAW;AAC5D,UAAU,qBAAqB,CAAC,QAAQ;AACxC,UAAU,kBAAkB,CAAC,OAAO,CAAC,WAAW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,+BAA+B,CAAC,oBAAoB,CAAC,CAAC;AACnG,cAAc;AACd,YAAY;AACZ,UAAU,CAAC,CAAC;AACZ,QAAQ,CAAC,CAAC;AACV,MAAM;AACN,IAAI,CAAC;AACL,GAAG;AACH;;AAEA,SAAS,+BAA+B,CAAC,KAAK,EAAwE;AACtH,EAAE,IAAI,CAAC,KAAK,EAAE;AACd,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF,EAAE,MAAM,eAAe,GAA2B,EAAE;AACpD,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK;AACzD,IAAI,eAAe,CAAC,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA,CAAA,GAAA,KAAA,CAAA;AACA,IAAA,eAAA,CAAA,CAAA,mBAAA,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA,KAAA;AACA,IAAA,eAAA,CAAA,CAAA,OAAA,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA,KAAA,CAAA;AACA,EAAA,CAAA,CAAA;;AAEA,EAAA,OAAA,eAAA;AACA;;;;"}
@@ -0,0 +1,8 @@
1
+ const REACT_RENDER_OP = 'ui.react.render';
2
+
3
+ const REACT_UPDATE_OP = 'ui.react.update';
4
+
5
+ const REACT_MOUNT_OP = 'ui.react.mount';
6
+
7
+ export { REACT_MOUNT_OP, REACT_RENDER_OP, REACT_UPDATE_OP };
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const REACT_RENDER_OP = 'ui.react.render';\n\nexport const REACT_UPDATE_OP = 'ui.react.update';\n\nexport const REACT_MOUNT_OP = 'ui.react.mount';\n"],"names":[],"mappings":"AAAO,MAAM,eAAA,GAAkB;;AAExB,MAAM,eAAA,GAAkB;;AAExB,MAAM,cAAA,GAAiB;;;;"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
3
+ *
4
+ * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
5
+ */
6
+ const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
7
+
8
+ export { DEBUG_BUILD };
9
+ //# sourceMappingURL=debug-build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-build.js","sources":["../../src/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAA,IAAc,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}