@sentry/browser 11.0.0-alpha.2 → 11.0.0-beta.1

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 (454) hide show
  1. package/build/npm/cjs/dev/client.js +5 -5
  2. package/build/npm/cjs/dev/client.js.map +1 -1
  3. package/build/npm/cjs/dev/diagnose-sdk.js +3 -3
  4. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
  5. package/build/npm/cjs/dev/eventbuilder.js +25 -28
  6. package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
  7. package/build/npm/cjs/dev/helpers.js +11 -11
  8. package/build/npm/cjs/dev/helpers.js.map +1 -1
  9. package/build/npm/cjs/dev/index.js +85 -84
  10. package/build/npm/cjs/dev/index.js.map +1 -1
  11. package/build/npm/cjs/dev/integrations/{bfcache.js → bfcacheMetrics.js} +41 -39
  12. package/build/npm/cjs/dev/integrations/bfcacheMetrics.js.map +1 -0
  13. package/build/npm/cjs/dev/integrations/breadcrumbs.js +27 -27
  14. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
  15. package/build/npm/cjs/dev/integrations/browserapierrors.js +16 -16
  16. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
  17. package/build/npm/cjs/dev/integrations/browsersession.js +9 -9
  18. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
  19. package/build/npm/cjs/dev/integrations/contextlines.js +5 -5
  20. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
  21. package/build/npm/cjs/dev/integrations/culturecontext.js +3 -3
  22. package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
  23. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +2 -2
  24. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  25. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +5 -5
  26. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  27. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +7 -7
  28. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  29. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -5
  30. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  31. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +7 -7
  32. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  33. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +16 -10
  34. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -1
  35. package/build/npm/cjs/dev/integrations/globalhandlers.js +15 -15
  36. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
  37. package/build/npm/cjs/dev/integrations/graphqlClient.js +28 -15
  38. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
  39. package/build/npm/cjs/dev/integrations/httpclient.js +20 -23
  40. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
  41. package/build/npm/cjs/dev/integrations/httpcontext.js +6 -7
  42. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
  43. package/build/npm/cjs/dev/integrations/linkederrors.js +3 -3
  44. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
  45. package/build/npm/cjs/dev/integrations/reportingobserver.js +6 -6
  46. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
  47. package/build/npm/cjs/dev/integrations/spotlight.js +6 -6
  48. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
  49. package/build/npm/cjs/dev/integrations/view-hierarchy.js +2 -2
  50. package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
  51. package/build/npm/cjs/dev/integrations/webVitals.js +3 -3
  52. package/build/npm/cjs/dev/integrations/webVitals.js.map +1 -1
  53. package/build/npm/cjs/dev/integrations/webWorker.js +18 -18
  54. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
  55. package/build/npm/cjs/dev/profiling/UIProfiler.js +33 -33
  56. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
  57. package/build/npm/cjs/dev/profiling/index.js +7 -7
  58. package/build/npm/cjs/dev/profiling/index.js.map +1 -1
  59. package/build/npm/cjs/dev/profiling/integration.js +8 -8
  60. package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
  61. package/build/npm/cjs/dev/profiling/utils.js +16 -16
  62. package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
  63. package/build/npm/cjs/dev/report-dialog.js +7 -7
  64. package/build/npm/cjs/dev/report-dialog.js.map +1 -1
  65. package/build/npm/cjs/dev/sdk.js +9 -9
  66. package/build/npm/cjs/dev/sdk.js.map +1 -1
  67. package/build/npm/cjs/dev/stack-parsers.js +10 -10
  68. package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
  69. package/build/npm/cjs/dev/tracing/backgroundtab.js +7 -7
  70. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
  71. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +48 -48
  72. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  73. package/build/npm/cjs/dev/tracing/linkedTraces.js +10 -11
  74. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
  75. package/build/npm/cjs/dev/tracing/reportPageLoaded.js +2 -2
  76. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
  77. package/build/npm/cjs/dev/tracing/request.js +37 -29
  78. package/build/npm/cjs/dev/tracing/request.js.map +1 -1
  79. package/build/npm/cjs/dev/tracing/setActiveSpan.js +5 -5
  80. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
  81. package/build/npm/cjs/dev/transports/fetch.js +3 -3
  82. package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
  83. package/build/npm/cjs/dev/transports/offline.js +5 -5
  84. package/build/npm/cjs/dev/transports/offline.js.map +1 -1
  85. package/build/npm/cjs/dev/userfeedback.js +3 -3
  86. package/build/npm/cjs/dev/userfeedback.js.map +1 -1
  87. package/build/npm/cjs/dev/utils/detectBrowserExtension.js +2 -2
  88. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
  89. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +3 -3
  90. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
  91. package/build/npm/cjs/prod/client.js +5 -5
  92. package/build/npm/cjs/prod/client.js.map +1 -1
  93. package/build/npm/cjs/prod/diagnose-sdk.js +3 -3
  94. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
  95. package/build/npm/cjs/prod/eventbuilder.js +25 -28
  96. package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
  97. package/build/npm/cjs/prod/helpers.js +11 -11
  98. package/build/npm/cjs/prod/helpers.js.map +1 -1
  99. package/build/npm/cjs/prod/index.js +85 -84
  100. package/build/npm/cjs/prod/index.js.map +1 -1
  101. package/build/npm/cjs/prod/integrations/{bfcache.js → bfcacheMetrics.js} +41 -39
  102. package/build/npm/cjs/prod/integrations/bfcacheMetrics.js.map +1 -0
  103. package/build/npm/cjs/prod/integrations/breadcrumbs.js +27 -27
  104. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
  105. package/build/npm/cjs/prod/integrations/browserapierrors.js +16 -16
  106. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
  107. package/build/npm/cjs/prod/integrations/browsersession.js +9 -9
  108. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
  109. package/build/npm/cjs/prod/integrations/contextlines.js +5 -5
  110. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
  111. package/build/npm/cjs/prod/integrations/culturecontext.js +3 -3
  112. package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
  113. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +2 -2
  114. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  115. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +5 -5
  116. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  117. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +7 -7
  118. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  119. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -5
  120. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  121. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +7 -7
  122. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  123. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +16 -10
  124. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -1
  125. package/build/npm/cjs/prod/integrations/globalhandlers.js +15 -15
  126. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
  127. package/build/npm/cjs/prod/integrations/graphqlClient.js +28 -15
  128. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
  129. package/build/npm/cjs/prod/integrations/httpclient.js +20 -23
  130. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
  131. package/build/npm/cjs/prod/integrations/httpcontext.js +6 -7
  132. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
  133. package/build/npm/cjs/prod/integrations/linkederrors.js +3 -3
  134. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
  135. package/build/npm/cjs/prod/integrations/reportingobserver.js +6 -6
  136. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
  137. package/build/npm/cjs/prod/integrations/spotlight.js +6 -6
  138. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
  139. package/build/npm/cjs/prod/integrations/view-hierarchy.js +2 -2
  140. package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
  141. package/build/npm/cjs/prod/integrations/webVitals.js +3 -3
  142. package/build/npm/cjs/prod/integrations/webVitals.js.map +1 -1
  143. package/build/npm/cjs/prod/integrations/webWorker.js +18 -18
  144. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
  145. package/build/npm/cjs/prod/profiling/UIProfiler.js +33 -33
  146. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
  147. package/build/npm/cjs/prod/profiling/index.js +7 -7
  148. package/build/npm/cjs/prod/profiling/index.js.map +1 -1
  149. package/build/npm/cjs/prod/profiling/integration.js +8 -8
  150. package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
  151. package/build/npm/cjs/prod/profiling/utils.js +16 -16
  152. package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
  153. package/build/npm/cjs/prod/report-dialog.js +7 -7
  154. package/build/npm/cjs/prod/report-dialog.js.map +1 -1
  155. package/build/npm/cjs/prod/sdk.js +9 -9
  156. package/build/npm/cjs/prod/sdk.js.map +1 -1
  157. package/build/npm/cjs/prod/stack-parsers.js +10 -10
  158. package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
  159. package/build/npm/cjs/prod/tracing/backgroundtab.js +7 -7
  160. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
  161. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +48 -48
  162. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  163. package/build/npm/cjs/prod/tracing/linkedTraces.js +10 -11
  164. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
  165. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +2 -2
  166. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
  167. package/build/npm/cjs/prod/tracing/request.js +37 -29
  168. package/build/npm/cjs/prod/tracing/request.js.map +1 -1
  169. package/build/npm/cjs/prod/tracing/setActiveSpan.js +5 -5
  170. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
  171. package/build/npm/cjs/prod/transports/fetch.js +3 -3
  172. package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
  173. package/build/npm/cjs/prod/transports/offline.js +5 -5
  174. package/build/npm/cjs/prod/transports/offline.js.map +1 -1
  175. package/build/npm/cjs/prod/userfeedback.js +3 -3
  176. package/build/npm/cjs/prod/userfeedback.js.map +1 -1
  177. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +2 -2
  178. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
  179. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +3 -3
  180. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
  181. package/build/npm/esm/dev/client.js +1 -1
  182. package/build/npm/esm/dev/client.js.map +1 -1
  183. package/build/npm/esm/dev/diagnose-sdk.js +1 -1
  184. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
  185. package/build/npm/esm/dev/eventbuilder.js +1 -4
  186. package/build/npm/esm/dev/eventbuilder.js.map +1 -1
  187. package/build/npm/esm/dev/helpers.js +1 -1
  188. package/build/npm/esm/dev/helpers.js.map +1 -1
  189. package/build/npm/esm/dev/index.js +3 -2
  190. package/build/npm/esm/dev/index.js.map +1 -1
  191. package/build/npm/esm/dev/integrations/{bfcache.js → bfcacheMetrics.js} +37 -35
  192. package/build/npm/esm/dev/integrations/bfcacheMetrics.js.map +1 -0
  193. package/build/npm/esm/dev/integrations/breadcrumbs.js +1 -1
  194. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
  195. package/build/npm/esm/dev/integrations/browserapierrors.js +1 -1
  196. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
  197. package/build/npm/esm/dev/integrations/browsersession.js +1 -1
  198. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
  199. package/build/npm/esm/dev/integrations/contextlines.js +1 -1
  200. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
  201. package/build/npm/esm/dev/integrations/culturecontext.js +1 -1
  202. package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
  203. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -1
  204. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  205. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +1 -1
  206. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  207. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +1 -1
  208. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  209. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +1 -1
  210. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  211. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +1 -1
  212. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  213. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +11 -5
  214. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -1
  215. package/build/npm/esm/dev/integrations/globalhandlers.js +1 -1
  216. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
  217. package/build/npm/esm/dev/integrations/graphqlClient.js +21 -8
  218. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
  219. package/build/npm/esm/dev/integrations/httpclient.js +1 -4
  220. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
  221. package/build/npm/esm/dev/integrations/httpcontext.js +1 -2
  222. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
  223. package/build/npm/esm/dev/integrations/linkederrors.js +1 -1
  224. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
  225. package/build/npm/esm/dev/integrations/reportingobserver.js +1 -1
  226. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
  227. package/build/npm/esm/dev/integrations/spotlight.js +1 -1
  228. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
  229. package/build/npm/esm/dev/integrations/view-hierarchy.js +1 -1
  230. package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
  231. package/build/npm/esm/dev/integrations/webVitals.js +1 -1
  232. package/build/npm/esm/dev/integrations/webVitals.js.map +1 -1
  233. package/build/npm/esm/dev/integrations/webWorker.js +1 -1
  234. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
  235. package/build/npm/esm/dev/package.json +1 -1
  236. package/build/npm/esm/dev/profiling/UIProfiler.js +1 -1
  237. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
  238. package/build/npm/esm/dev/profiling/index.js +1 -1
  239. package/build/npm/esm/dev/profiling/index.js.map +1 -1
  240. package/build/npm/esm/dev/profiling/integration.js +1 -1
  241. package/build/npm/esm/dev/profiling/integration.js.map +1 -1
  242. package/build/npm/esm/dev/profiling/utils.js +1 -1
  243. package/build/npm/esm/dev/profiling/utils.js.map +1 -1
  244. package/build/npm/esm/dev/report-dialog.js +1 -1
  245. package/build/npm/esm/dev/report-dialog.js.map +1 -1
  246. package/build/npm/esm/dev/sdk.js +1 -1
  247. package/build/npm/esm/dev/sdk.js.map +1 -1
  248. package/build/npm/esm/dev/stack-parsers.js +1 -1
  249. package/build/npm/esm/dev/stack-parsers.js.map +1 -1
  250. package/build/npm/esm/dev/tracing/backgroundtab.js +1 -1
  251. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
  252. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +7 -7
  253. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  254. package/build/npm/esm/dev/tracing/linkedTraces.js +1 -2
  255. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
  256. package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -1
  257. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
  258. package/build/npm/esm/dev/tracing/request.js +16 -8
  259. package/build/npm/esm/dev/tracing/request.js.map +1 -1
  260. package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -1
  261. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
  262. package/build/npm/esm/dev/transports/fetch.js +1 -1
  263. package/build/npm/esm/dev/transports/fetch.js.map +1 -1
  264. package/build/npm/esm/dev/transports/offline.js +1 -1
  265. package/build/npm/esm/dev/transports/offline.js.map +1 -1
  266. package/build/npm/esm/dev/userfeedback.js +1 -1
  267. package/build/npm/esm/dev/userfeedback.js.map +1 -1
  268. package/build/npm/esm/dev/utils/detectBrowserExtension.js +1 -1
  269. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
  270. package/build/npm/esm/dev/utils/lazyLoadIntegration.js +1 -1
  271. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
  272. package/build/npm/esm/prod/client.js +1 -1
  273. package/build/npm/esm/prod/client.js.map +1 -1
  274. package/build/npm/esm/prod/diagnose-sdk.js +1 -1
  275. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
  276. package/build/npm/esm/prod/eventbuilder.js +1 -4
  277. package/build/npm/esm/prod/eventbuilder.js.map +1 -1
  278. package/build/npm/esm/prod/helpers.js +1 -1
  279. package/build/npm/esm/prod/helpers.js.map +1 -1
  280. package/build/npm/esm/prod/index.js +3 -2
  281. package/build/npm/esm/prod/index.js.map +1 -1
  282. package/build/npm/esm/prod/integrations/{bfcache.js → bfcacheMetrics.js} +37 -35
  283. package/build/npm/esm/prod/integrations/bfcacheMetrics.js.map +1 -0
  284. package/build/npm/esm/prod/integrations/breadcrumbs.js +1 -1
  285. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
  286. package/build/npm/esm/prod/integrations/browserapierrors.js +1 -1
  287. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
  288. package/build/npm/esm/prod/integrations/browsersession.js +1 -1
  289. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
  290. package/build/npm/esm/prod/integrations/contextlines.js +1 -1
  291. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
  292. package/build/npm/esm/prod/integrations/culturecontext.js +1 -1
  293. package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
  294. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -1
  295. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  296. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +1 -1
  297. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  298. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +1 -1
  299. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  300. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +1 -1
  301. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  302. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +1 -1
  303. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  304. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +11 -5
  305. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -1
  306. package/build/npm/esm/prod/integrations/globalhandlers.js +1 -1
  307. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
  308. package/build/npm/esm/prod/integrations/graphqlClient.js +21 -8
  309. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
  310. package/build/npm/esm/prod/integrations/httpclient.js +1 -4
  311. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
  312. package/build/npm/esm/prod/integrations/httpcontext.js +1 -2
  313. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
  314. package/build/npm/esm/prod/integrations/linkederrors.js +1 -1
  315. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
  316. package/build/npm/esm/prod/integrations/reportingobserver.js +1 -1
  317. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
  318. package/build/npm/esm/prod/integrations/spotlight.js +1 -1
  319. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
  320. package/build/npm/esm/prod/integrations/view-hierarchy.js +1 -1
  321. package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
  322. package/build/npm/esm/prod/integrations/webVitals.js +1 -1
  323. package/build/npm/esm/prod/integrations/webVitals.js.map +1 -1
  324. package/build/npm/esm/prod/integrations/webWorker.js +1 -1
  325. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
  326. package/build/npm/esm/prod/package.json +1 -1
  327. package/build/npm/esm/prod/profiling/UIProfiler.js +1 -1
  328. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
  329. package/build/npm/esm/prod/profiling/index.js +1 -1
  330. package/build/npm/esm/prod/profiling/index.js.map +1 -1
  331. package/build/npm/esm/prod/profiling/integration.js +1 -1
  332. package/build/npm/esm/prod/profiling/integration.js.map +1 -1
  333. package/build/npm/esm/prod/profiling/utils.js +1 -1
  334. package/build/npm/esm/prod/profiling/utils.js.map +1 -1
  335. package/build/npm/esm/prod/report-dialog.js +1 -1
  336. package/build/npm/esm/prod/report-dialog.js.map +1 -1
  337. package/build/npm/esm/prod/sdk.js +1 -1
  338. package/build/npm/esm/prod/sdk.js.map +1 -1
  339. package/build/npm/esm/prod/stack-parsers.js +1 -1
  340. package/build/npm/esm/prod/stack-parsers.js.map +1 -1
  341. package/build/npm/esm/prod/tracing/backgroundtab.js +1 -1
  342. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
  343. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +7 -7
  344. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  345. package/build/npm/esm/prod/tracing/linkedTraces.js +1 -2
  346. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
  347. package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -1
  348. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
  349. package/build/npm/esm/prod/tracing/request.js +16 -8
  350. package/build/npm/esm/prod/tracing/request.js.map +1 -1
  351. package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -1
  352. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
  353. package/build/npm/esm/prod/transports/fetch.js +1 -1
  354. package/build/npm/esm/prod/transports/fetch.js.map +1 -1
  355. package/build/npm/esm/prod/transports/offline.js +1 -1
  356. package/build/npm/esm/prod/transports/offline.js.map +1 -1
  357. package/build/npm/esm/prod/userfeedback.js +1 -1
  358. package/build/npm/esm/prod/userfeedback.js.map +1 -1
  359. package/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -1
  360. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
  361. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +1 -1
  362. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
  363. package/build/npm/types/client.d.ts +3 -2
  364. package/build/npm/types/client.d.ts.map +1 -1
  365. package/build/npm/types/eventbuilder.d.ts +1 -1
  366. package/build/npm/types/eventbuilder.d.ts.map +1 -1
  367. package/build/npm/types/exports.d.ts +3 -3
  368. package/build/npm/types/exports.d.ts.map +1 -1
  369. package/build/npm/types/helpers.d.ts +2 -2
  370. package/build/npm/types/helpers.d.ts.map +1 -1
  371. package/build/npm/types/index.bundle.logs.metrics.d.ts +1 -1
  372. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
  373. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +1 -1
  374. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
  375. package/build/npm/types/index.bundle.tracing.d.ts +2 -2
  376. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  377. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +3 -3
  378. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
  379. package/build/npm/types/index.bundle.tracing.replay.d.ts +2 -2
  380. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  381. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +2 -2
  382. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  383. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +2 -2
  384. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
  385. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +3 -3
  386. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
  387. package/build/npm/types/index.d.ts +4 -4
  388. package/build/npm/types/index.d.ts.map +1 -1
  389. package/build/npm/types/integrations/{bfcache.d.ts → bfcacheMetrics.d.ts} +3 -3
  390. package/build/npm/types/integrations/bfcacheMetrics.d.ts.map +1 -0
  391. package/build/npm/types/integrations/breadcrumbs.d.ts.map +1 -1
  392. package/build/npm/types/integrations/contextlines.d.ts +1 -1
  393. package/build/npm/types/integrations/contextlines.d.ts.map +1 -1
  394. package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -1
  395. package/build/npm/types/integrations/globalhandlers.d.ts +1 -1
  396. package/build/npm/types/integrations/globalhandlers.d.ts.map +1 -1
  397. package/build/npm/types/integrations/graphqlClient.d.ts.map +1 -1
  398. package/build/npm/types/integrations/httpclient.d.ts.map +1 -1
  399. package/build/npm/types/integrations/view-hierarchy.d.ts +1 -1
  400. package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -1
  401. package/build/npm/types/integrations/webWorker.d.ts +1 -1
  402. package/build/npm/types/integrations/webWorker.d.ts.map +1 -1
  403. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts +1 -1
  404. package/build/npm/types/integrations-bundle/index.captureconsole.d.ts.map +1 -1
  405. package/build/npm/types/integrations-bundle/index.dedupe.d.ts +1 -1
  406. package/build/npm/types/integrations-bundle/index.dedupe.d.ts.map +1 -1
  407. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts +1 -1
  408. package/build/npm/types/integrations-bundle/index.extraerrordata.d.ts.map +1 -1
  409. package/build/npm/types/integrations-bundle/index.feedback.d.ts +1 -1
  410. package/build/npm/types/integrations-bundle/index.feedback.d.ts.map +1 -1
  411. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +1 -1
  412. package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -1
  413. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts +1 -1
  414. package/build/npm/types/integrations-bundle/index.rewriteframes.d.ts.map +1 -1
  415. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts +1 -1
  416. package/build/npm/types/pluggable-exports-bundle/index.multiplexedtransport.d.ts.map +1 -1
  417. package/build/npm/types/profiling/UIProfiler.d.ts +1 -1
  418. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -1
  419. package/build/npm/types/profiling/index.d.ts +1 -1
  420. package/build/npm/types/profiling/index.d.ts.map +1 -1
  421. package/build/npm/types/profiling/utils.d.ts +1 -1
  422. package/build/npm/types/profiling/utils.d.ts.map +1 -1
  423. package/build/npm/types/report-dialog.d.ts +1 -1
  424. package/build/npm/types/report-dialog.d.ts.map +1 -1
  425. package/build/npm/types/sdk.d.ts +1 -1
  426. package/build/npm/types/sdk.d.ts.map +1 -1
  427. package/build/npm/types/stack-parsers.d.ts +1 -1
  428. package/build/npm/types/stack-parsers.d.ts.map +1 -1
  429. package/build/npm/types/tracing/browserTracingIntegration.d.ts +1 -1
  430. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  431. package/build/npm/types/tracing/linkedTraces.d.ts +2 -2
  432. package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
  433. package/build/npm/types/tracing/reportPageLoaded.d.ts +1 -1
  434. package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -1
  435. package/build/npm/types/tracing/request.d.ts +1 -1
  436. package/build/npm/types/tracing/request.d.ts.map +1 -1
  437. package/build/npm/types/tracing/setActiveSpan.d.ts +1 -1
  438. package/build/npm/types/tracing/setActiveSpan.d.ts.map +1 -1
  439. package/build/npm/types/transports/fetch.d.ts +1 -1
  440. package/build/npm/types/transports/fetch.d.ts.map +1 -1
  441. package/build/npm/types/transports/offline.d.ts +1 -1
  442. package/build/npm/types/transports/offline.d.ts.map +1 -1
  443. package/build/npm/types/transports/types.d.ts +1 -1
  444. package/build/npm/types/transports/types.d.ts.map +1 -1
  445. package/build/npm/types/userfeedback.d.ts +1 -1
  446. package/build/npm/types/userfeedback.d.ts.map +1 -1
  447. package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -1
  448. package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
  449. package/package.json +7 -7
  450. package/build/npm/cjs/dev/integrations/bfcache.js.map +0 -1
  451. package/build/npm/cjs/prod/integrations/bfcache.js.map +0 -1
  452. package/build/npm/esm/dev/integrations/bfcache.js.map +0 -1
  453. package/build/npm/esm/prod/integrations/bfcache.js.map +0 -1
  454. package/build/npm/types/integrations/bfcache.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"bfcache.js","sources":["../../../../../src/integrations/bfcache.ts"],"sourcesContent":["import {\n SENTRY_SEGMENT_NAME,\n BROWSER_BFCACHE_FRAME,\n BROWSER_BFCACHE_NOT_RESTORED_REASON_COUNT,\n BROWSER_BFCACHE_OUTCOME,\n BROWSER_BFCACHE_REASON,\n SENTRY_ORIGIN,\n} from '@sentry/conventions/attributes';\nimport type { IntegrationFn, SpanAttributes } from '@sentry/core/browser';\nimport { debug, defineIntegration, getCurrentScope, metrics } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'Bfcache';\n\ntype BFCacheOutcome = 'hit' | 'miss';\n\ntype BFCacheFrame = 'top' | 'child';\n\ninterface BFCacheIntegrationOptions {\n /**\n * Maximum number of not-restored reasons to emit per miss.\n *\n * By default every reason is reported. Set this to cap the number emitted per miss.\n * Values below 1 are clamped to 1.\n */\n maxReasons: number;\n}\n\ninterface NotRestoredReason {\n reason?: string;\n}\n\ninterface NotRestoredReasons {\n children?: NotRestoredReasons[] | null;\n reasons?: (NotRestoredReason | string)[] | null;\n}\n\ninterface NavigationTimingWithNotRestoredReasons extends PerformanceNavigationTiming {\n notRestoredReasons?: NotRestoredReasons | null;\n}\n\ninterface CollectedReason {\n reason: string;\n frame: BFCacheFrame;\n}\n\n/**\n * Captures bfcache hit/miss counters and Chromium notRestoredReasons when available.\n */\nexport const bfcacheIntegration = defineIntegration((options: Partial<BFCacheIntegrationOptions> = {}) => {\n const maxReasons = _resolveMaxReasons(options.maxReasons);\n\n return {\n name: INTEGRATION_NAME,\n\n setupOnce() {\n if (!WINDOW.addEventListener || !WINDOW.performance?.getEntriesByType) {\n DEBUG_BUILD && debug.log(`[${INTEGRATION_NAME}] Browser APIs unavailable, skipping instrumentation.`);\n return;\n }\n\n function onPageShow(event: PageTransitionEvent) {\n const routeName = _getSegmentName();\n if (event.persisted) {\n _captureBFCacheNavigation('hit', 0, routeName);\n return;\n }\n\n const navigationEntry = WINDOW.performance.getEntriesByType('navigation')[0] as\n | NavigationTimingWithNotRestoredReasons\n | undefined;\n\n if (navigationEntry?.type !== 'back_forward') {\n return;\n }\n\n const reasons = _collectNotRestoredReasons(navigationEntry.notRestoredReasons, maxReasons);\n _captureBFCacheNavigation('miss', reasons.length, routeName);\n\n // Measures how expensive the fallback reload was when a back/forward navigation missed bfcache.\n if (typeof navigationEntry.duration === 'number' && navigationEntry.duration > 0) {\n metrics.distribution('browser.bfcache.reload.duration', navigationEntry.duration, {\n unit: 'millisecond',\n attributes: _withOriginAttr({\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n }\n\n reasons.forEach(r => _captureBFCacheReason(r, routeName));\n }\n\n // Listener should stay active because the event can trigger for an initial show before the bfcache entry coming into the second one.\n // This can be platform-dependent so we need to skip as many events till we get to the one containing the entry.\n // So we can't have { once } or a cleanup logic here, which is fine because `setupOnce` registers it a single time regardless of how many clients are created.\n WINDOW.addEventListener('pageshow', onPageShow, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Captures a bf navigation as a metric and records the outcome and reason count.\n */\nfunction _captureBFCacheNavigation(outcome: BFCacheOutcome, reasonCount: number, routeName?: string): void {\n metrics.count('browser.bfcache.navigation', 1, {\n attributes: _withOriginAttr({\n [BROWSER_BFCACHE_OUTCOME]: outcome,\n // Attribute should be present if reasons are >= 1\n [BROWSER_BFCACHE_NOT_RESTORED_REASON_COUNT]: reasonCount || undefined,\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n}\n\n/**\n * Maps a collected reason to a metric and captures/sends it.\n */\nfunction _captureBFCacheReason({ reason, frame }: CollectedReason, routeName?: string) {\n metrics.count('browser.bfcache.not_restored', 1, {\n attributes: _withOriginAttr({\n [BROWSER_BFCACHE_REASON]: reason,\n [BROWSER_BFCACHE_FRAME]: frame,\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n}\n\n/**\n * The segment name for a bfcache navigation, read from the scope rather than any span.\n *\n * A hit restore is silent to tracing (no pageload span), but the frozen scope still holds the last\n * transaction name a downstream SDK (Vue/React/etc.) set before the freeze, so we reuse that. On a miss the\n * page reloads with a fresh scope, so this is the new pageload name. Falls back to the raw pathname when unset.\n */\nfunction _getSegmentName(): string | undefined {\n return getCurrentScope().getScopeData().transactionName || WINDOW.location?.pathname;\n}\n\n/**\n * Resolves the configured `maxReasons` cap. Reports every reason by default and clamps values below 1 to 1,\n * since a cap under 1 would silently drop all reasons.\n *\n * Exported for tests only.\n */\nexport function _resolveMaxReasons(maxReasons: number | undefined): number {\n if (maxReasons == null) {\n return Infinity;\n }\n\n if (maxReasons < 1) {\n DEBUG_BUILD &&\n debug.warn(`[${INTEGRATION_NAME}] \\`maxReasons\\` must be at least 1, got ${maxReasons}. Using 1 instead.`);\n return 1;\n }\n\n return maxReasons;\n}\n\n/**\n * Flattens the (possibly nested) bfcache `notRestoredReasons` tree into a capped list of reasons.\n *\n * Exported for tests only.\n */\nexport function _collectNotRestoredReasons(\n notRestoredReasons: NotRestoredReasons | null | undefined,\n maxReasons: number,\n): CollectedReason[] {\n const reasons: CollectedReason[] = [];\n\n if (!notRestoredReasons || maxReasons <= 0) {\n return reasons;\n }\n\n _collectReasonsFromFrame(notRestoredReasons, 'top', reasons, maxReasons);\n\n return reasons;\n}\n\nfunction _collectReasonsFromFrame(\n frame: NotRestoredReasons,\n frameType: BFCacheFrame,\n collectedReasons: CollectedReason[],\n maxReasons: number,\n): void {\n if (collectedReasons.length >= maxReasons) {\n return;\n }\n\n frame.reasons?.forEach(reason => {\n if (collectedReasons.length >= maxReasons) {\n return;\n }\n\n const reasonValue = typeof reason === 'string' ? reason : reason.reason;\n if (!reasonValue) {\n return;\n }\n\n collectedReasons.push({\n reason: reasonValue,\n frame: frameType,\n });\n });\n\n frame.children?.forEach(child => {\n _collectReasonsFromFrame(child, 'child', collectedReasons, maxReasons);\n });\n}\n\n/**\n * Adds the origin attributes to a set of attributes, it mutates the original attributes.\n */\nfunction _withOriginAttr(attributes: SpanAttributes): SpanAttributes {\n attributes[SENTRY_ORIGIN] = 'auto.browser.bfcache';\n\n return attributes;\n}\n"],"names":["defineIntegration","WINDOW","DEBUG_BUILD","debug","metrics","SENTRY_SEGMENT_NAME","BROWSER_BFCACHE_OUTCOME","BROWSER_BFCACHE_NOT_RESTORED_REASON_COUNT","BROWSER_BFCACHE_REASON","BROWSER_BFCACHE_FRAME","getCurrentScope","attributes","SENTRY_ORIGIN"],"mappings":";;;;;;;AAaA,MAAM,gBAAA,GAAmB,SAAA;AAqClB,MAAM,kBAAA,GAAqBA,yBAAA,CAAkB,CAAC,OAAA,GAA8C,EAAC,KAAM;AACxG,EAAA,MAAM,UAAA,GAAa,kBAAA,CAAmB,OAAA,CAAQ,UAAU,CAAA;AAExD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IAEN,SAAA,GAAY;AACV,MAAA,IAAI,CAACC,cAAA,CAAO,gBAAA,IAAoB,CAACA,cAAA,CAAO,aAAa,gBAAA,EAAkB;AACrE,QAAAC,sBAAA,IAAe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,OAAA,EAAS,UAAU,CAAA;AAEvE,EAAA,OAAO,OAAA;AACT;AAEA,SAAS,wBAAA,CACP,KAAA,EACA,SAAA,EACA,gBAAA,EACA,UAAA,EACM;AACN,EAAA,IAAI,gBAAA,CAAiB,UAAU,UAAA,EAAY;AACzC,IAAA;AAAA,EACF;AAEA,EAAA,KAAA,CAAM,OAAA,EAAS,QAAQ,CAAA,MAAA,KAAU;AAC/B,IAAA,IAAI,gBAAA,CAAiB,UAAU,UAAA,EAAY;AACzC,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,WAAA,GAAc,OAAO,MAAA,KAAW,QAAA,GAAW,SAAS,MAAA,CAAO,MAAA;AACjE,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA;AAAA,IACF;AAEA,IAAA,gBAAA,CAAiB,IAAA,CAAK;AAAA,MACpB,MAAA,EAAQ,WAAA;AAAA,MACR,KAAA,EAAO;AAAA,KACR,CAAA;AAAA,EACH,CAAC,CAAA;AAED,EAAA,KAAA,CAAM,QAAA,EAAU,QAAQ,CAAA,KAAA,KAAS;AAC/B,IAAA,wBAAA,CAAyB,KAAA,EAAO,OAAA,EAAS,gBAAA,EAAkB,UAAU,CAAA;AAAA,EACvE,CAAC,CAAA;AACH;AAKA,SAAS,gBAAgBQ,YAAA,EAA4C;AACnE,EAAAA,YAAA,CAAWC,wBAAa,CAAA,GAAI,sBAAA;AAE5B,EAAA,OAAOD,YAAA;AACT;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"bfcache.js","sources":["../../../../../src/integrations/bfcache.ts"],"sourcesContent":["import {\n SENTRY_SEGMENT_NAME,\n BROWSER_BFCACHE_FRAME,\n BROWSER_BFCACHE_NOT_RESTORED_REASON_COUNT,\n BROWSER_BFCACHE_OUTCOME,\n BROWSER_BFCACHE_REASON,\n SENTRY_ORIGIN,\n} from '@sentry/conventions/attributes';\nimport type { IntegrationFn, SpanAttributes } from '@sentry/core/browser';\nimport { debug, defineIntegration, getCurrentScope, metrics } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'Bfcache';\n\ntype BFCacheOutcome = 'hit' | 'miss';\n\ntype BFCacheFrame = 'top' | 'child';\n\ninterface BFCacheIntegrationOptions {\n /**\n * Maximum number of not-restored reasons to emit per miss.\n *\n * By default every reason is reported. Set this to cap the number emitted per miss.\n * Values below 1 are clamped to 1.\n */\n maxReasons: number;\n}\n\ninterface NotRestoredReason {\n reason?: string;\n}\n\ninterface NotRestoredReasons {\n children?: NotRestoredReasons[] | null;\n reasons?: (NotRestoredReason | string)[] | null;\n}\n\ninterface NavigationTimingWithNotRestoredReasons extends PerformanceNavigationTiming {\n notRestoredReasons?: NotRestoredReasons | null;\n}\n\ninterface CollectedReason {\n reason: string;\n frame: BFCacheFrame;\n}\n\n/**\n * Captures bfcache hit/miss counters and Chromium notRestoredReasons when available.\n */\nexport const bfcacheIntegration = defineIntegration((options: Partial<BFCacheIntegrationOptions> = {}) => {\n const maxReasons = _resolveMaxReasons(options.maxReasons);\n\n return {\n name: INTEGRATION_NAME,\n\n setupOnce() {\n if (!WINDOW.addEventListener || !WINDOW.performance?.getEntriesByType) {\n DEBUG_BUILD && debug.log(`[${INTEGRATION_NAME}] Browser APIs unavailable, skipping instrumentation.`);\n return;\n }\n\n function onPageShow(event: PageTransitionEvent) {\n const routeName = _getSegmentName();\n if (event.persisted) {\n _captureBFCacheNavigation('hit', 0, routeName);\n return;\n }\n\n const navigationEntry = WINDOW.performance.getEntriesByType('navigation')[0] as\n | NavigationTimingWithNotRestoredReasons\n | undefined;\n\n if (navigationEntry?.type !== 'back_forward') {\n return;\n }\n\n const reasons = _collectNotRestoredReasons(navigationEntry.notRestoredReasons, maxReasons);\n _captureBFCacheNavigation('miss', reasons.length, routeName);\n\n // Measures how expensive the fallback reload was when a back/forward navigation missed bfcache.\n if (typeof navigationEntry.duration === 'number' && navigationEntry.duration > 0) {\n metrics.distribution('browser.bfcache.reload.duration', navigationEntry.duration, {\n unit: 'millisecond',\n attributes: _withOriginAttr({\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n }\n\n reasons.forEach(r => _captureBFCacheReason(r, routeName));\n }\n\n // Listener should stay active because the event can trigger for an initial show before the bfcache entry coming into the second one.\n // This can be platform-dependent so we need to skip as many events till we get to the one containing the entry.\n // So we can't have { once } or a cleanup logic here, which is fine because `setupOnce` registers it a single time regardless of how many clients are created.\n WINDOW.addEventListener('pageshow', onPageShow, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Captures a bf navigation as a metric and records the outcome and reason count.\n */\nfunction _captureBFCacheNavigation(outcome: BFCacheOutcome, reasonCount: number, routeName?: string): void {\n metrics.count('browser.bfcache.navigation', 1, {\n attributes: _withOriginAttr({\n [BROWSER_BFCACHE_OUTCOME]: outcome,\n // Attribute should be present if reasons are >= 1\n [BROWSER_BFCACHE_NOT_RESTORED_REASON_COUNT]: reasonCount || undefined,\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n}\n\n/**\n * Maps a collected reason to a metric and captures/sends it.\n */\nfunction _captureBFCacheReason({ reason, frame }: CollectedReason, routeName?: string) {\n metrics.count('browser.bfcache.not_restored', 1, {\n attributes: _withOriginAttr({\n [BROWSER_BFCACHE_REASON]: reason,\n [BROWSER_BFCACHE_FRAME]: frame,\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n}\n\n/**\n * The segment name for a bfcache navigation, read from the scope rather than any span.\n *\n * A hit restore is silent to tracing (no pageload span), but the frozen scope still holds the last\n * transaction name a downstream SDK (Vue/React/etc.) set before the freeze, so we reuse that. On a miss the\n * page reloads with a fresh scope, so this is the new pageload name. Falls back to the raw pathname when unset.\n */\nfunction _getSegmentName(): string | undefined {\n return getCurrentScope().getScopeData().transactionName || WINDOW.location?.pathname;\n}\n\n/**\n * Resolves the configured `maxReasons` cap. Reports every reason by default and clamps values below 1 to 1,\n * since a cap under 1 would silently drop all reasons.\n *\n * Exported for tests only.\n */\nexport function _resolveMaxReasons(maxReasons: number | undefined): number {\n if (maxReasons == null) {\n return Infinity;\n }\n\n if (maxReasons < 1) {\n DEBUG_BUILD &&\n debug.warn(`[${INTEGRATION_NAME}] \\`maxReasons\\` must be at least 1, got ${maxReasons}. Using 1 instead.`);\n return 1;\n }\n\n return maxReasons;\n}\n\n/**\n * Flattens the (possibly nested) bfcache `notRestoredReasons` tree into a capped list of reasons.\n *\n * Exported for tests only.\n */\nexport function _collectNotRestoredReasons(\n notRestoredReasons: NotRestoredReasons | null | undefined,\n maxReasons: number,\n): CollectedReason[] {\n const reasons: CollectedReason[] = [];\n\n if (!notRestoredReasons || maxReasons <= 0) {\n return reasons;\n }\n\n _collectReasonsFromFrame(notRestoredReasons, 'top', reasons, maxReasons);\n\n return reasons;\n}\n\nfunction _collectReasonsFromFrame(\n frame: NotRestoredReasons,\n frameType: BFCacheFrame,\n collectedReasons: CollectedReason[],\n maxReasons: number,\n): void {\n if (collectedReasons.length >= maxReasons) {\n return;\n }\n\n frame.reasons?.forEach(reason => {\n if (collectedReasons.length >= maxReasons) {\n return;\n }\n\n const reasonValue = typeof reason === 'string' ? reason : reason.reason;\n if (!reasonValue) {\n return;\n }\n\n collectedReasons.push({\n reason: reasonValue,\n frame: frameType,\n });\n });\n\n frame.children?.forEach(child => {\n _collectReasonsFromFrame(child, 'child', collectedReasons, maxReasons);\n });\n}\n\n/**\n * Adds the origin attributes to a set of attributes, it mutates the original attributes.\n */\nfunction _withOriginAttr(attributes: SpanAttributes): SpanAttributes {\n attributes[SENTRY_ORIGIN] = 'auto.browser.bfcache';\n\n return attributes;\n}\n"],"names":[],"mappings":";;;;;AAaA,MAAM,gBAAA,GAAmB,SAAA;AAqClB,MAAM,kBAAA,GAAqB,iBAAA,CAAkB,CAAC,OAAA,GAA8C,EAAC,KAAM;AACxG,EAAA,MAAM,UAAA,GAAa,kBAAA,CAAmB,OAAA,CAAQ,UAAU,CAAA;AAExD,EAAA,OA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;AAEpC,EAAA,IAAI,CAAC,kBAAA,IAAsB,UAAA,IAAc,CAAA,EAAG;AAC1C,IAAA,OAAO,OAAA;AAAA,EACT;AAEA,EAAA,wBAAA,CAAyB,kBAAA,EAAoB,KAAA,EAAO,OAAA,EAAS,UAAU,CAAA;AAEvE,EAAA,OAAO,OAAA;AACT;AAEA,SAAS,wBAAA,CACP,KAAA,EACA,SAAA,EACA,gBAAA,EACA,UAAA,EACM;AACN,EAAA,IAAI,gBAAA,CAAiB,UAAU,UAAA,EAAY;AACzC,IAAA;AAAA,EACF;AAEA,EAAA,KAAA,CAAM,OAAA,EAAS,QAAQ,CAAA,MAAA,KAAU;AAC/B,IAAA,IAAI,gBAAA,CAAiB,UAAU,UAAA,EAAY;AACzC,MAAA;AAAA,IACF;AAEA,IAAA,MAAM,WAAA,GAAc,OAAO,MAAA,KAAW,QAAA,GAAW,SAAS,MAAA,CAAO,MAAA;AACjE,IAAA,IAAI,CAAC,WAAA,EAAa;AAChB,MAAA;AAAA,IACF;AAEA,IAAA,gBAAA,CAAiB,IAAA,CAAK;AAAA,MACpB,MAAA,EAAQ,WAAA;AAAA,MACR,KAAA,EAAO;AAAA,KACR,CAAA;AAAA,EACH,CAAC,CAAA;AAED,EAAA,KAAA,CAAM,QAAA,EAAU,QAAQ,CAAA,KAAA,KAAS;AAC/B,IAAA,wBAAA,CAAyB,KAAA,EAAO,OAAA,EAAS,gBAAA,EAAkB,UAAU,CAAA;AAAA,EACvE,CAAC,CAAA;AACH;AAKA,SAAS,gBAAgB,UAAA,EAA4C;AACnE,EAAA,UAAA,CAAW,aAAa,CAAA,GAAI,sBAAA;AAE5B,EAAA,OAAO,UAAA;AACT;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"bfcache.js","sources":["../../../../../src/integrations/bfcache.ts"],"sourcesContent":["import {\n SENTRY_SEGMENT_NAME,\n BROWSER_BFCACHE_FRAME,\n BROWSER_BFCACHE_NOT_RESTORED_REASON_COUNT,\n BROWSER_BFCACHE_OUTCOME,\n BROWSER_BFCACHE_REASON,\n SENTRY_ORIGIN,\n} from '@sentry/conventions/attributes';\nimport type { IntegrationFn, SpanAttributes } from '@sentry/core/browser';\nimport { debug, defineIntegration, getCurrentScope, metrics } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\n\nconst INTEGRATION_NAME = 'Bfcache';\n\ntype BFCacheOutcome = 'hit' | 'miss';\n\ntype BFCacheFrame = 'top' | 'child';\n\ninterface BFCacheIntegrationOptions {\n /**\n * Maximum number of not-restored reasons to emit per miss.\n *\n * By default every reason is reported. Set this to cap the number emitted per miss.\n * Values below 1 are clamped to 1.\n */\n maxReasons: number;\n}\n\ninterface NotRestoredReason {\n reason?: string;\n}\n\ninterface NotRestoredReasons {\n children?: NotRestoredReasons[] | null;\n reasons?: (NotRestoredReason | string)[] | null;\n}\n\ninterface NavigationTimingWithNotRestoredReasons extends PerformanceNavigationTiming {\n notRestoredReasons?: NotRestoredReasons | null;\n}\n\ninterface CollectedReason {\n reason: string;\n frame: BFCacheFrame;\n}\n\n/**\n * Captures bfcache hit/miss counters and Chromium notRestoredReasons when available.\n */\nexport const bfcacheIntegration = defineIntegration((options: Partial<BFCacheIntegrationOptions> = {}) => {\n const maxReasons = _resolveMaxReasons(options.maxReasons);\n\n return {\n name: INTEGRATION_NAME,\n\n setupOnce() {\n if (!WINDOW.addEventListener || !WINDOW.performance?.getEntriesByType) {\n DEBUG_BUILD && debug.log(`[${INTEGRATION_NAME}] Browser APIs unavailable, skipping instrumentation.`);\n return;\n }\n\n function onPageShow(event: PageTransitionEvent) {\n const routeName = _getSegmentName();\n if (event.persisted) {\n _captureBFCacheNavigation('hit', 0, routeName);\n return;\n }\n\n const navigationEntry = WINDOW.performance.getEntriesByType('navigation')[0] as\n | NavigationTimingWithNotRestoredReasons\n | undefined;\n\n if (navigationEntry?.type !== 'back_forward') {\n return;\n }\n\n const reasons = _collectNotRestoredReasons(navigationEntry.notRestoredReasons, maxReasons);\n _captureBFCacheNavigation('miss', reasons.length, routeName);\n\n // Measures how expensive the fallback reload was when a back/forward navigation missed bfcache.\n if (typeof navigationEntry.duration === 'number' && navigationEntry.duration > 0) {\n metrics.distribution('browser.bfcache.reload.duration', navigationEntry.duration, {\n unit: 'millisecond',\n attributes: _withOriginAttr({\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n }\n\n reasons.forEach(r => _captureBFCacheReason(r, routeName));\n }\n\n // Listener should stay active because the event can trigger for an initial show before the bfcache entry coming into the second one.\n // This can be platform-dependent so we need to skip as many events till we get to the one containing the entry.\n // So we can't have { once } or a cleanup logic here, which is fine because `setupOnce` registers it a single time regardless of how many clients are created.\n WINDOW.addEventListener('pageshow', onPageShow, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Captures a bf navigation as a metric and records the outcome and reason count.\n */\nfunction _captureBFCacheNavigation(outcome: BFCacheOutcome, reasonCount: number, routeName?: string): void {\n metrics.count('browser.bfcache.navigation', 1, {\n attributes: _withOriginAttr({\n [BROWSER_BFCACHE_OUTCOME]: outcome,\n // Attribute should be present if reasons are >= 1\n [BROWSER_BFCACHE_NOT_RESTORED_REASON_COUNT]: reasonCount || undefined,\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n}\n\n/**\n * Maps a collected reason to a metric and captures/sends it.\n */\nfunction _captureBFCacheReason({ reason, frame }: CollectedReason, routeName?: string) {\n metrics.count('browser.bfcache.not_restored', 1, {\n attributes: _withOriginAttr({\n [BROWSER_BFCACHE_REASON]: reason,\n [BROWSER_BFCACHE_FRAME]: frame,\n [SENTRY_SEGMENT_NAME]: routeName,\n }),\n });\n}\n\n/**\n * The segment name for a bfcache navigation, read from the scope rather than any span.\n *\n * A hit restore is silent to tracing (no pageload span), but the frozen scope still holds the last\n * transaction name a downstream SDK (Vue/React/etc.) set before the freeze, so we reuse that. On a miss the\n * page reloads with a fresh scope, so this is the new pageload name. Falls back to the raw pathname when unset.\n */\nfunction _getSegmentName(): string | undefined {\n return getCurrentScope().getScopeData().transactionName || WINDOW.location?.pathname;\n}\n\n/**\n * Resolves the configured `maxReasons` cap. Reports every reason by default and clamps values below 1 to 1,\n * since a cap under 1 would silently drop all reasons.\n *\n * Exported for tests only.\n */\nexport function _resolveMaxReasons(maxReasons: number | undefined): number {\n if (maxReasons == null) {\n return Infinity;\n }\n\n if (maxReasons < 1) {\n DEBUG_BUILD &&\n debug.warn(`[${INTEGRATION_NAME}] \\`maxReasons\\` must be at least 1, got ${maxReasons}. Using 1 instead.`);\n return 1;\n }\n\n return maxReasons;\n}\n\n/**\n * Flattens the (possibly nested) bfcache `notRestoredReasons` tree into a capped list of reasons.\n *\n * Exported for tests only.\n */\nexport function _collectNotRestoredReasons(\n notRestoredReasons: NotRestoredReasons | null | undefined,\n maxReasons: number,\n): CollectedReason[] {\n const reasons: CollectedReason[] = [];\n\n if (!notRestoredReasons || maxReasons <= 0) {\n return reasons;\n }\n\n _collectReasonsFromFrame(notRestoredReasons, 'top', reasons, maxReasons);\n\n return reasons;\n}\n\nfunction _collectReasonsFromFrame(\n frame: NotRestoredReasons,\n frameType: BFCacheFrame,\n collectedReasons: CollectedReason[],\n maxReasons: number,\n): void {\n if (collectedReasons.length >= maxReasons) {\n return;\n }\n\n frame.reasons?.forEach(reason => {\n if (collectedReasons.length >= maxReasons) {\n return;\n }\n\n const reasonValue = typeof reason === 'string' ? reason : reason.reason;\n if (!reasonValue) {\n return;\n }\n\n collectedReasons.push({\n reason: reasonValue,\n frame: frameType,\n });\n });\n\n frame.children?.forEach(child => {\n _collectReasonsFromFrame(child, 'child', collectedReasons, maxReasons);\n });\n}\n\n/**\n * Adds the origin attributes to a set of attributes, it mutates the original attributes.\n */\nfunction _withOriginAttr(attributes: SpanAttributes): SpanAttributes {\n attributes[SENTRY_ORIGIN] = 'auto.browser.bfcache';\n\n return attributes;\n}\n"],"names":[],"mappings":";;;;;AAaA,MAAM,gBAAA,GAAmB,SAAA;AAqClB,MAAM,k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