@cloudcare/browser-rum 3.3.23 → 3.3.25

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 (364) hide show
  1. package/README.md +33 -0
  2. package/README.zh.md +30 -0
  3. package/bundle/dataflux-rum.js +1 -1
  4. package/cjs/boot/buildEnv.js +1 -1
  5. package/cjs/boot/disabledRumPublicApi.js +5 -0
  6. package/cjs/boot/disabledRumPublicApi.js.map +1 -1
  7. package/cjs/boot/initCallbacks.js +25 -0
  8. package/cjs/boot/initCallbacks.js.map +1 -0
  9. package/cjs/boot/perStartRum.js +99 -50
  10. package/cjs/boot/perStartRum.js.map +1 -1
  11. package/cjs/boot/rum.js +7 -4
  12. package/cjs/boot/rum.js.map +1 -1
  13. package/cjs/boot/rumPublicApi.js +6 -7
  14. package/cjs/boot/rumPublicApi.js.map +1 -1
  15. package/cjs/boot/startRecording.js +2 -0
  16. package/cjs/boot/startRecording.js.map +1 -1
  17. package/cjs/domain/configuration.js +15 -2
  18. package/cjs/domain/configuration.js.map +1 -1
  19. package/cjs/domain/contexts/urlContexts.js +32 -21
  20. package/cjs/domain/contexts/urlContexts.js.map +1 -1
  21. package/cjs/domain/contexts/viewContexts.js +1 -1
  22. package/cjs/domain/contexts/viewContexts.js.map +1 -1
  23. package/cjs/domain/deflate/deflateWorker.js +39 -27
  24. package/cjs/domain/deflate/deflateWorker.js.map +1 -1
  25. package/cjs/domain/privacy.js +9 -6
  26. package/cjs/domain/privacy.js.map +1 -1
  27. package/cjs/domain/replay/record/canvasCommandCapture.js +91 -179
  28. package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -1
  29. package/cjs/domain/replay/record/canvasCommandObserverStub.js +24 -0
  30. package/cjs/domain/replay/record/canvasCommandObserverStub.js.map +1 -0
  31. package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +3 -2
  32. package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
  33. package/cjs/domain/replay/record/canvasContext.js +25 -0
  34. package/cjs/domain/replay/record/canvasContext.js.map +1 -1
  35. package/cjs/domain/replay/record/canvasEncodeWorker.js +1 -1
  36. package/cjs/domain/replay/record/canvasObserver.js +3 -0
  37. package/cjs/domain/replay/record/canvasObserver.js.map +1 -1
  38. package/cjs/domain/replay/record/mutationObserver.js +3 -12
  39. package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
  40. package/cjs/domain/replay/record/record.js +1 -1
  41. package/cjs/domain/replay/record/record.js.map +1 -1
  42. package/cjs/domain/replay/record/serialize.js +15 -13
  43. package/cjs/domain/replay/record/serialize.js.map +1 -1
  44. package/cjs/domain/replay/segmentCollection/buildReplayPayload.js +21 -6
  45. package/cjs/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
  46. package/cjs/domain/replay/segmentCollection/segmentCollection.js +91 -143
  47. package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
  48. package/cjs/domain/replayCanvasSupported.js +8 -0
  49. package/cjs/domain/replayCanvasSupported.js.map +1 -0
  50. package/cjs/domain/requestCollection.js +38 -39
  51. package/cjs/domain/requestCollection.js.map +1 -1
  52. package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js +1 -1
  53. package/cjs/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
  54. package/cjs/domain/rumEventsCollection/resource/fetchTimingRegistry.js +143 -0
  55. package/cjs/domain/rumEventsCollection/resource/fetchTimingRegistry.js.map +1 -0
  56. package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +2 -2
  57. package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
  58. package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +77 -45
  59. package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
  60. package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js +11 -9
  61. package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
  62. package/cjs/domain/rumEventsCollection/resource/resourceUtils.js +30 -40
  63. package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
  64. package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +7 -1
  65. package/cjs/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
  66. package/cjs/domain/rumEventsCollection/view/trackViews.js +3 -0
  67. package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
  68. package/cjs/domain/tracing/skywalkingTracer.js +4 -50
  69. package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
  70. package/cjs/domain/tracing/tracer.js +26 -3
  71. package/cjs/domain/tracing/tracer.js.map +1 -1
  72. package/esm/boot/buildEnv.js +2 -5
  73. package/esm/boot/buildEnv.js.map +1 -1
  74. package/esm/boot/disabledRumPublicApi.js +2 -35
  75. package/esm/boot/disabledRumPublicApi.js.map +1 -1
  76. package/esm/boot/initCallbacks.js +2 -0
  77. package/esm/boot/initCallbacks.js.map +1 -0
  78. package/esm/boot/perStartRum.js +2 -260
  79. package/esm/boot/perStartRum.js.map +1 -1
  80. package/esm/boot/recorderApi.js +2 -338
  81. package/esm/boot/recorderApi.js.map +1 -1
  82. package/esm/boot/recorderApiStub.js +2 -21
  83. package/esm/boot/recorderApiStub.js.map +1 -1
  84. package/esm/boot/rum.entry.js +2 -13
  85. package/esm/boot/rum.entry.js.map +1 -1
  86. package/esm/boot/rum.js +2 -184
  87. package/esm/boot/rum.js.map +1 -1
  88. package/esm/boot/rum.slim.entry.js +2 -7
  89. package/esm/boot/rum.slim.entry.js.map +1 -1
  90. package/esm/boot/rumEntryFactory.js +2 -18
  91. package/esm/boot/rumEntryFactory.js.map +1 -1
  92. package/esm/boot/rumPublicApi.js +2 -344
  93. package/esm/boot/rumPublicApi.js.map +1 -1
  94. package/esm/boot/rumRecorderApiStub.js +2 -13
  95. package/esm/boot/rumRecorderApiStub.js.map +1 -1
  96. package/esm/boot/rumSlimConfiguration.js +2 -10
  97. package/esm/boot/rumSlimConfiguration.js.map +1 -1
  98. package/esm/boot/sessionReplayPublicApi.js +2 -43
  99. package/esm/boot/sessionReplayPublicApi.js.map +1 -1
  100. package/esm/boot/startRecording.js +2 -444
  101. package/esm/boot/startRecording.js.map +1 -1
  102. package/esm/constants.js +2 -28
  103. package/esm/constants.js.map +1 -1
  104. package/esm/domain/assembly.js +2 -213
  105. package/esm/domain/assembly.js.map +1 -1
  106. package/esm/domain/configuration.js +2 -323
  107. package/esm/domain/configuration.js.map +1 -1
  108. package/esm/domain/contexts/commonContext.js +2 -8
  109. package/esm/domain/contexts/commonContext.js.map +1 -1
  110. package/esm/domain/contexts/displayContext.js +2 -16
  111. package/esm/domain/contexts/displayContext.js.map +1 -1
  112. package/esm/domain/contexts/foregroundContexts.js +2 -103
  113. package/esm/domain/contexts/foregroundContexts.js.map +1 -1
  114. package/esm/domain/contexts/internalContext.js +2 -41
  115. package/esm/domain/contexts/internalContext.js.map +1 -1
  116. package/esm/domain/contexts/pageStateHistory.js +2 -104
  117. package/esm/domain/contexts/pageStateHistory.js.map +1 -1
  118. package/esm/domain/contexts/urlContexts.js +2 -85
  119. package/esm/domain/contexts/urlContexts.js.map +1 -1
  120. package/esm/domain/contexts/viewContexts.js +2 -45
  121. package/esm/domain/contexts/viewContexts.js.map +1 -1
  122. package/esm/domain/deflate/deflateEncoder.js +2 -592
  123. package/esm/domain/deflate/deflateEncoder.js.map +1 -1
  124. package/esm/domain/deflate/deflateWorker.js +2 -225
  125. package/esm/domain/deflate/deflateWorker.js.map +1 -1
  126. package/esm/domain/deflate/index.js +2 -3
  127. package/esm/domain/deflate/index.js.map +1 -1
  128. package/esm/domain/domMutationObservable.js +2 -62
  129. package/esm/domain/domMutationObservable.js.map +1 -1
  130. package/esm/domain/encoderStreamId.js +2 -6
  131. package/esm/domain/encoderStreamId.js.map +1 -1
  132. package/esm/domain/firstInputPolyfill.js +2 -77
  133. package/esm/domain/firstInputPolyfill.js.map +1 -1
  134. package/esm/domain/initViewportObservable.js +2 -36
  135. package/esm/domain/initViewportObservable.js.map +1 -1
  136. package/esm/domain/locationChangeObservable.js +2 -65
  137. package/esm/domain/locationChangeObservable.js.map +1 -1
  138. package/esm/domain/performanceObservable.js +2 -116
  139. package/esm/domain/performanceObservable.js.map +1 -1
  140. package/esm/domain/performanceUtils.js +2 -45
  141. package/esm/domain/performanceUtils.js.map +1 -1
  142. package/esm/domain/plugins.js +2 -59
  143. package/esm/domain/plugins.js.map +1 -1
  144. package/esm/domain/privacy.js +2 -266
  145. package/esm/domain/privacy.js.map +1 -1
  146. package/esm/domain/replay/record/canvasAutoSnapshot.js +2 -9
  147. package/esm/domain/replay/record/canvasAutoSnapshot.js.map +1 -1
  148. package/esm/domain/replay/record/canvasCommandCapture.js +2 -1275
  149. package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -1
  150. package/esm/domain/replay/record/canvasCommandObserver.js +2 -1207
  151. package/esm/domain/replay/record/canvasCommandObserver.js.map +1 -1
  152. package/esm/domain/replay/record/canvasCommandObserverStub.js +2 -0
  153. package/esm/domain/replay/record/canvasCommandObserverStub.js.map +1 -0
  154. package/esm/domain/replay/record/canvasCommandSerializeArgs.js +2 -111
  155. package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -1
  156. package/esm/domain/replay/record/canvasContext.js +2 -50
  157. package/esm/domain/replay/record/canvasContext.js.map +1 -1
  158. package/esm/domain/replay/record/canvasContinuousScheduler.js +2 -378
  159. package/esm/domain/replay/record/canvasContinuousScheduler.js.map +1 -1
  160. package/esm/domain/replay/record/canvasEncodeBridge.js +2 -692
  161. package/esm/domain/replay/record/canvasEncodeBridge.js.map +1 -1
  162. package/esm/domain/replay/record/canvasEncodeWorker.js +2 -164
  163. package/esm/domain/replay/record/canvasEncodeWorker.js.map +1 -1
  164. package/esm/domain/replay/record/canvasFrameSignature.js +2 -75
  165. package/esm/domain/replay/record/canvasFrameSignature.js.map +1 -1
  166. package/esm/domain/replay/record/canvasMutationRecord.js +2 -26
  167. package/esm/domain/replay/record/canvasMutationRecord.js.map +1 -1
  168. package/esm/domain/replay/record/canvasObserver.js +2 -420
  169. package/esm/domain/replay/record/canvasObserver.js.map +1 -1
  170. package/esm/domain/replay/record/canvasSerializeArgs.js +2 -101
  171. package/esm/domain/replay/record/canvasSerializeArgs.js.map +1 -1
  172. package/esm/domain/replay/record/canvasWebGLPluginHost.js +2 -26
  173. package/esm/domain/replay/record/canvasWebGLPluginHost.js.map +1 -1
  174. package/esm/domain/replay/record/elementsScrollPositions.js +2 -23
  175. package/esm/domain/replay/record/elementsScrollPositions.js.map +1 -1
  176. package/esm/domain/replay/record/index.js +2 -4
  177. package/esm/domain/replay/record/index.js.map +1 -1
  178. package/esm/domain/replay/record/mutationBatch.js +2 -562
  179. package/esm/domain/replay/record/mutationBatch.js.map +1 -1
  180. package/esm/domain/replay/record/mutationObserver.js +2 -2332
  181. package/esm/domain/replay/record/mutationObserver.js.map +1 -1
  182. package/esm/domain/replay/record/mutationResourceBudget.js +2 -137
  183. package/esm/domain/replay/record/mutationResourceBudget.js.map +1 -1
  184. package/esm/domain/replay/record/observers.js +2 -624
  185. package/esm/domain/replay/record/observers.js.map +1 -1
  186. package/esm/domain/replay/record/privacy.js +2 -1
  187. package/esm/domain/replay/record/privacy.js.map +1 -1
  188. package/esm/domain/replay/record/record.js +2 -3511
  189. package/esm/domain/replay/record/record.js.map +1 -1
  190. package/esm/domain/replay/record/serializationUtils.js +2 -677
  191. package/esm/domain/replay/record/serializationUtils.js.map +1 -1
  192. package/esm/domain/replay/record/serialize.js +2 -735
  193. package/esm/domain/replay/record/serialize.js.map +1 -1
  194. package/esm/domain/replay/record/shadowRootsController.js +2 -902
  195. package/esm/domain/replay/record/shadowRootsController.js.map +1 -1
  196. package/esm/domain/replay/record/utils.js +2 -36
  197. package/esm/domain/replay/record/utils.js.map +1 -1
  198. package/esm/domain/replay/record/viewports.js +2 -58
  199. package/esm/domain/replay/record/viewports.js.map +1 -1
  200. package/esm/domain/replay/replayStats.js +2 -59
  201. package/esm/domain/replay/replayStats.js.map +1 -1
  202. package/esm/domain/replay/segmentCollection/buildReplayPayload.js +2 -31
  203. package/esm/domain/replay/segmentCollection/buildReplayPayload.js.map +1 -1
  204. package/esm/domain/replay/segmentCollection/index.js +2 -3
  205. package/esm/domain/replay/segmentCollection/index.js.map +1 -1
  206. package/esm/domain/replay/segmentCollection/segment.js +2 -415
  207. package/esm/domain/replay/segmentCollection/segment.js.map +1 -1
  208. package/esm/domain/replay/segmentCollection/segmentCollection.js +2 -1114
  209. package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
  210. package/esm/domain/replay/startRecordBridge.js +2 -13
  211. package/esm/domain/replay/startRecordBridge.js.map +1 -1
  212. package/esm/domain/replay/timeAnchor.js +2 -20
  213. package/esm/domain/replay/timeAnchor.js.map +1 -1
  214. package/esm/domain/replayCanvasSupported.js +2 -0
  215. package/esm/domain/replayCanvasSupported.js.map +1 -0
  216. package/esm/domain/requestCollection.js +2 -121
  217. package/esm/domain/requestCollection.js.map +1 -1
  218. package/esm/domain/rumEventsCollection/actions/actionCollection.js +2 -83
  219. package/esm/domain/rumEventsCollection/actions/actionCollection.js.map +1 -1
  220. package/esm/domain/rumEventsCollection/actions/clickChain.js +2 -62
  221. package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
  222. package/esm/domain/rumEventsCollection/actions/computeFrustration.js +2 -67
  223. package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
  224. package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js +2 -279
  225. package/esm/domain/rumEventsCollection/actions/getActionNameFromElement.js.map +1 -1
  226. package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js +2 -233
  227. package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
  228. package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -21
  229. package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
  230. package/esm/domain/rumEventsCollection/actions/listenActionEvents.js +2 -67
  231. package/esm/domain/rumEventsCollection/actions/listenActionEvents.js.map +1 -1
  232. package/esm/domain/rumEventsCollection/actions/trackClickActions.js +2 -263
  233. package/esm/domain/rumEventsCollection/actions/trackClickActions.js.map +1 -1
  234. package/esm/domain/rumEventsCollection/error/errorCollection.js +2 -93
  235. package/esm/domain/rumEventsCollection/error/errorCollection.js.map +1 -1
  236. package/esm/domain/rumEventsCollection/error/trackConsoleError.js +2 -12
  237. package/esm/domain/rumEventsCollection/error/trackConsoleError.js.map +1 -1
  238. package/esm/domain/rumEventsCollection/error/trackReportError.js +2 -19
  239. package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
  240. package/esm/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js +2 -55
  241. package/esm/domain/rumEventsCollection/longTask/longAnimationFrameCollection.js.map +1 -1
  242. package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js +2 -38
  243. package/esm/domain/rumEventsCollection/longTask/longTaskCollection.js.map +1 -1
  244. package/esm/domain/rumEventsCollection/resource/fetchTimingRegistry.js +2 -0
  245. package/esm/domain/rumEventsCollection/resource/fetchTimingRegistry.js.map +1 -0
  246. package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +2 -69
  247. package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
  248. package/esm/domain/rumEventsCollection/resource/resourceCollection.js +2 -294
  249. package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
  250. package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js +2 -232
  251. package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -1
  252. package/esm/domain/rumEventsCollection/resource/resourceUtils.js +2 -218
  253. package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
  254. package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +2 -19
  255. package/esm/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js.map +1 -1
  256. package/esm/domain/rumEventsCollection/resource/webSocketCollection.js +2 -191
  257. package/esm/domain/rumEventsCollection/resource/webSocketCollection.js.map +1 -1
  258. package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js +2 -47
  259. package/esm/domain/rumEventsCollection/view/interactionCountPolyfill.js.map +1 -1
  260. package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js +2 -42
  261. package/esm/domain/rumEventsCollection/view/trackCommonViewMetrics.js.map +1 -1
  262. package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +2 -117
  263. package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
  264. package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js +2 -20
  265. package/esm/domain/rumEventsCollection/view/trackFirstContentfulPaint.js.map +1 -1
  266. package/esm/domain/rumEventsCollection/view/trackFirstHidden.js +2 -49
  267. package/esm/domain/rumEventsCollection/view/trackFirstHidden.js.map +1 -1
  268. package/esm/domain/rumEventsCollection/view/trackFirstInput.js +2 -41
  269. package/esm/domain/rumEventsCollection/view/trackFirstInput.js.map +1 -1
  270. package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js +2 -44
  271. package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js.map +1 -1
  272. package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js +2 -153
  273. package/esm/domain/rumEventsCollection/view/trackInteractionToNextPaint.js.map +1 -1
  274. package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js +2 -54
  275. package/esm/domain/rumEventsCollection/view/trackLargestContentfulPaint.js.map +1 -1
  276. package/esm/domain/rumEventsCollection/view/trackLoadingTime.js +2 -50
  277. package/esm/domain/rumEventsCollection/view/trackLoadingTime.js.map +1 -1
  278. package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js +2 -73
  279. package/esm/domain/rumEventsCollection/view/trackNavigationTimings.js.map +1 -1
  280. package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js +2 -84
  281. package/esm/domain/rumEventsCollection/view/trackScrollMetrics.js.map +1 -1
  282. package/esm/domain/rumEventsCollection/view/trackSoftNavigationMetrics.js +2 -38
  283. package/esm/domain/rumEventsCollection/view/trackSoftNavigationMetrics.js.map +1 -1
  284. package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js +2 -15
  285. package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js.map +1 -1
  286. package/esm/domain/rumEventsCollection/view/trackViews.js +2 -418
  287. package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
  288. package/esm/domain/rumEventsCollection/view/viewCollection.js +2 -127
  289. package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
  290. package/esm/domain/rumSessionManager.js +2 -208
  291. package/esm/domain/rumSessionManager.js.map +1 -1
  292. package/esm/domain/tracing/ddtraceTracer.js +2 -40
  293. package/esm/domain/tracing/ddtraceTracer.js.map +1 -1
  294. package/esm/domain/tracing/getDocumentTraceId.js +2 -69
  295. package/esm/domain/tracing/getDocumentTraceId.js.map +1 -1
  296. package/esm/domain/tracing/jaegerTracer.js +2 -42
  297. package/esm/domain/tracing/jaegerTracer.js.map +1 -1
  298. package/esm/domain/tracing/sampler.js +2 -61
  299. package/esm/domain/tracing/sampler.js.map +1 -1
  300. package/esm/domain/tracing/skywalkingTracer.js +2 -90
  301. package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
  302. package/esm/domain/tracing/traceIdentifier.js +2 -57
  303. package/esm/domain/tracing/traceIdentifier.js.map +1 -1
  304. package/esm/domain/tracing/tracer.js +2 -128
  305. package/esm/domain/tracing/tracer.js.map +1 -1
  306. package/esm/domain/tracing/w3cTraceParentTracer.js +2 -69
  307. package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -1
  308. package/esm/domain/tracing/zipkinMultiTracer.js +2 -42
  309. package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
  310. package/esm/domain/tracing/zipkinSingleTracer.js +2 -41
  311. package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
  312. package/esm/domain/trackEventCounts.js +2 -49
  313. package/esm/domain/trackEventCounts.js.map +1 -1
  314. package/esm/domain/usr/index.js +2 -38
  315. package/esm/domain/usr/index.js.map +1 -1
  316. package/esm/domain/visitorId/index.js +2 -406
  317. package/esm/domain/visitorId/index.js.map +1 -1
  318. package/esm/domain/waitPageActivityEnd.js +2 -142
  319. package/esm/domain/waitPageActivityEnd.js.map +1 -1
  320. package/esm/index.js +2 -4
  321. package/esm/index.js.map +1 -1
  322. package/esm/transport/startRumBatch.js +2 -74
  323. package/esm/transport/startRumBatch.js.map +1 -1
  324. package/esm/transport/startRumEventBridge.js +2 -9
  325. package/esm/transport/startRumEventBridge.js.map +1 -1
  326. package/esm/types/index.js +2 -1
  327. package/esm/types/index.js.map +1 -1
  328. package/esm/types/sessionReplayConstants.js +2 -46
  329. package/esm/types/sessionReplayConstants.js.map +1 -1
  330. package/package.json +8 -8
  331. package/src/boot/disabledRumPublicApi.js +5 -0
  332. package/src/boot/initCallbacks.js +16 -0
  333. package/src/boot/perStartRum.js +102 -59
  334. package/src/boot/rum.js +7 -4
  335. package/src/boot/rumPublicApi.js +6 -8
  336. package/src/boot/startRecording.js +2 -0
  337. package/src/domain/configuration.js +13 -2
  338. package/src/domain/contexts/urlContexts.js +34 -27
  339. package/src/domain/contexts/viewContexts.js +2 -2
  340. package/src/domain/deflate/deflateWorker.js +35 -21
  341. package/src/domain/privacy.js +13 -13
  342. package/src/domain/replay/record/canvasCommandCapture.js +105 -239
  343. package/src/domain/replay/record/canvasCommandObserverStub.js +11 -0
  344. package/src/domain/replay/record/canvasCommandSerializeArgs.js +2 -2
  345. package/src/domain/replay/record/canvasContext.js +32 -0
  346. package/src/domain/replay/record/canvasObserver.js +5 -1
  347. package/src/domain/replay/record/mutationObserver.js +6 -22
  348. package/src/domain/replay/record/record.js +1 -1
  349. package/src/domain/replay/record/serialize.js +24 -11
  350. package/src/domain/replay/segmentCollection/buildReplayPayload.js +24 -14
  351. package/src/domain/replay/segmentCollection/segmentCollection.js +97 -227
  352. package/src/domain/replayCanvasSupported.js +1 -0
  353. package/src/domain/requestCollection.js +39 -51
  354. package/src/domain/rumEventsCollection/actions/listenActionEvents.js +8 -2
  355. package/src/domain/rumEventsCollection/resource/fetchTimingRegistry.js +138 -0
  356. package/src/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +2 -2
  357. package/src/domain/rumEventsCollection/resource/resourceCollection.js +87 -64
  358. package/src/domain/rumEventsCollection/resource/resourceTrackerManager.js +10 -10
  359. package/src/domain/rumEventsCollection/resource/resourceUtils.js +36 -59
  360. package/src/domain/rumEventsCollection/resource/retrieveInitialDocumentResourceTiming.js +8 -2
  361. package/src/domain/rumEventsCollection/view/trackViews.js +3 -0
  362. package/src/domain/tracing/skywalkingTracer.js +14 -91
  363. package/src/domain/tracing/tracer.js +28 -4
  364. package/types/index.d.ts +9 -0
@@ -1 +1 @@
1
- {"version":3,"file":"waitPageActivityEnd.js","names":["Observable","each","timeStampNow","LifeCycleEventType","some","matchList","instrumentMethod","setTimeout","clearTimeout","createPerformanceObservable","RumPerformanceEntryType","PAGE_ACTIVITY_VALIDATION_DELAY","PAGE_ACTIVITY_END_DELAY","waitPageActivityEnd","lifeCycle","domMutationObservable","configuration","pageActivityEndCallback","maxDuration","pageActivityObservable","createPageActivityObservable","doWaitPageActivityEnd","pageActivityEndTimeoutId","hasCompleted","validationTimeoutId","complete","hadActivity","maxDurationTimeoutId","undefined","end","pageActivitySubscription","subscribe","data","isBusy","lastChangeTime","stop","unsubscribe","event","observable","subscriptions","firstRequestIndex","pendingRequestsCount","push","notifyPageActivity","type","RESOURCE","entries","entry","isExcludedUrl","name","REQUEST_STARTED","startEvent","url","requestIndex","REQUEST_COMPLETED","request","_trackWindowOpen","trackWindowOpen","stopTrackingWindowOpen","s","notify","requestUrl","excludedActivityUrls","callback","window"],"sources":["../../src/domain/waitPageActivityEnd.js"],"mappings":"AAAA,SACEA,UAAU,EACVC,IAAI,EACJC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,oBAAoB,GAAG;MAAE,CAAC,CAAC;IACzD;EACF,CAAC,CAAC;AACJ;AAEA,SAASO,aAAaA,CAAChC,aAAa,EAAE6C,UAAU,EAAE;EAChD,OAAOxD,SAAS,CAACW,aAAa,CAAC8C,oBAAoB,EAAED,UAAU,CAAC;AAClE;AAEA,SAASJ,eAAeA,CAACM,QAAQ,EAAE;EACjC,OAAOzD,gBAAgB,CAAC0D,MAAM,EAAE,MAAM,EAAED,QAAQ,CAAC;AACnD","ignoreList":[]}
1
+ {"version":3,"file":"waitPageActivityEnd.js","names":["Observable","each","timeStampNow","LifeCycleEventType","some","matchList","instrumentMethod","setTimeout","clearTimeout","createPerformanceObservable","RumPerformanceEntryType","PAGE_ACTIVITY_VALIDATION_DELAY","PAGE_ACTIVITY_END_DELAY","waitPageActivityEnd","lifeCycle","domMutationObservable","configuration","pageActivityEndCallback","maxDuration","doWaitPageActivityEnd","createPageActivityObservable","pageActivityObservable","pageActivityEndTimeoutId","hasCompleted","validationTimeoutId","complete","hadActivity","maxDurationTimeoutId","undefined","end","pageActivitySubscription","subscribe","data","isBusy","lastChangeTime","stop","unsubscribe","event","observable","firstRequestIndex","subscriptions","pendingRequestsCount","push","notifyPageActivity","type","RESOURCE","entries","entry","isExcludedUrl","name","REQUEST_STARTED","startEvent","url","requestIndex","REQUEST_COMPLETED","request","stopTrackingWindowOpen","trackWindowOpen","callback","window","s","notify","requestUrl","excludedActivityUrls"],"sources":["../../src/domain/waitPageActivityEnd.js"],"mappings":"OACEA,WACAC,KACAC,aACAC,mBACAC,KACAC,UACAC,iBACAC,WACAC,iBACK,iCAELC,4BACAC,4BACK,yCAEA,IAAIC,+BAAiC,WAErC,IAAIC,wBAA0B,WAgC9B,SAASC,oBACdC,UACAC,sBACAC,cACAC,wBACAC,aAOA,OAAOC,sBALsBC,6BAC3BN,UACAC,sBACAC,eAIAC,wBACAC,YAEJ,QAEO,SAASC,sBACdE,uBACAJ,wBACAC,aAEA,IAAII,yBACAC,cAAe,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AASC,gBAAgBC,UACvB,OAAOpD,iBAAiBqD,OAAQ,OAAQD,SAC1C,CArB2BD,CAAgBd,oBACOR,KAC9C,OAAO,WACLqB,yBACAvD,KAAKuC,eAAe,SAAUoB,GAC5BA,EAAExB,aACJ,GACF,EAEA,SAASO,qBACPL,WAAWuB,OAAO,CAAE5B,OAAQQ,qBAAuB,GACrD,CACF,GACF,CAEA,SAASO,cAAchC,cAAe8C,YACpC,OAAOzD,UAAUW,cAAc+C,qBAAsBD,WACvD","ignoreList":[]}
package/esm/index.js CHANGED
@@ -1,4 +1,2 @@
1
- import { datafluxRum } from './boot/rum.entry';
2
- export { datafluxRum };
3
- export { TraceType } from '@cloudcare/browser-core';
4
- //# sourceMappingURL=index.js.map
1
+ import{datafluxRum}from"./boot/rum.entry";export{datafluxRum};export{TraceType}from"@cloudcare/browser-core";
2
+ //# sourceMappingURL=index.js.map
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["datafluxRum","TraceType"],"sources":["../src/index.js"],"mappings":"AAAA,SAASA,WAAW,QAAQ,kBAAkB;AAC9C,SAASA,WAAW;AACpB,SAASC,SAAS,QAAQ,yBAAyB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["datafluxRum","TraceType"],"sources":["../src/index.js"],"mappings":"OAASA,gBAAmB,0BACnBA,oBACAC,cAAiB","ignoreList":[]}
@@ -1,74 +1,2 @@
1
- import { createIdentityEncoder, createHttpRequest, LifeCycleEventType, Observable, RumEventType, startBatchWithReplica } from '@cloudcare/browser-core';
2
- import { EncoderStreamId } from '../domain/encoderStreamId';
3
- export function startRumBatch(configuration, lifeCycle, telemetryEventObservable, reportError, pageExitObservable, sessionExpireObservable, createEncoder) {
4
- var rumEncoder = createEncoder(EncoderStreamId.RUM);
5
- // Both batches share the same retry queue and bandwidth limits.
6
- var request = createHttpRequest(configuration.rumEndpoint, configuration.batchBytesLimit, configuration.retryMaxSize, reportError);
7
- var flushRequestObservable = new Observable();
8
- var immediateViewBatch;
9
- var immediateViewEncoder;
10
- var batch = startBatchWithReplica(configuration, {
11
- endpoint: configuration.rumEndpoint,
12
- request: request,
13
- encoder: rumEncoder,
14
- encoderFallback: rumEncoder.isAsync ? createIdentityEncoder : undefined
15
- }, reportError, pageExitObservable, sessionExpireObservable);
16
- var prepareUrgentFlushSubscription = batch.prepareUrgentFlushObservable.subscribe(function (event) {
17
- return lifeCycle.notify(LifeCycleEventType.PAGE_EXITED, event);
18
- });
19
- var rumEventSubscription = lifeCycle.subscribe(LifeCycleEventType.RUM_EVENT_COLLECTED, function (serverRumEvent) {
20
- if (serverRumEvent.type === RumEventType.VIEW) {
21
- batch.upsert(serverRumEvent, serverRumEvent.view.id);
22
- } else {
23
- batch.add(serverRumEvent);
24
- }
25
- });
26
- function sendImmediateView(event, reason) {
27
- if (!immediateViewBatch) {
28
- immediateViewEncoder = createEncoder(EncoderStreamId.RUM_INITIAL_VIEW);
29
- immediateViewBatch = startBatchWithReplica(configuration, {
30
- request: request,
31
- encoder: immediateViewEncoder,
32
- encoderFallback: immediateViewEncoder.isAsync ? createIdentityEncoder : undefined,
33
- flushRequestObservable: flushRequestObservable
34
- }, reportError,
35
- // The regular batch already owns the exit copy. Do not promote an
36
- // older first version from this encoder's journal on the same exit.
37
- new Observable(), sessionExpireObservable);
38
- }
39
- // Send initial and forced-session Views separately. The normal batch retains
40
- // each View's latest version for its original deadline and exit beacon,
41
- // including rapid routes whose first fetches have not completed yet.
42
- immediateViewBatch.upsert(event, event.view.id);
43
- flushRequestObservable.notify(reason);
44
- }
45
- var initialViewSubscription = lifeCycle.subscribe(LifeCycleEventType.RUM_VIEW_FIRST_COLLECTED, function (event) {
46
- return sendImmediateView(event, 'view_created');
47
- });
48
- var forcedViewSubscription = lifeCycle.subscribe(LifeCycleEventType.RUM_VIEW_FORCED_COLLECTED, function (event) {
49
- return sendImmediateView(event, 'session_forced');
50
- });
51
- var telemetrySubscription = telemetryEventObservable.subscribe(function (event) {
52
- batch.add(event);
53
- });
54
- return {
55
- flushObservable: batch.flushObservable,
56
- add: batch.add,
57
- upsert: batch.upsert,
58
- stop: function stop() {
59
- prepareUrgentFlushSubscription.unsubscribe();
60
- rumEventSubscription.unsubscribe();
61
- initialViewSubscription.unsubscribe();
62
- forcedViewSubscription.unsubscribe();
63
- telemetrySubscription.unsubscribe();
64
- batch.stop();
65
- if (immediateViewBatch) {
66
- immediateViewBatch.stop();
67
- if (immediateViewEncoder.stop) {
68
- immediateViewEncoder.stop();
69
- }
70
- }
71
- }
72
- };
73
- }
74
- //# sourceMappingURL=startRumBatch.js.map
1
+ import{createIdentityEncoder,createHttpRequest,LifeCycleEventType,Observable,RumEventType,startBatchWithReplica}from"@cloudcare/browser-core";import{EncoderStreamId}from"../domain/encoderStreamId";export function startRumBatch(configuration,lifeCycle,telemetryEventObservable,reportError,pageExitObservable,sessionExpireObservable,createEncoder){var immediateViewBatch,immediateViewEncoder,rumEncoder=createEncoder(EncoderStreamId.RUM),request=createHttpRequest(configuration.rumEndpoint,configuration.batchBytesLimit,configuration.retryMaxSize,reportError),flushRequestObservable=new Observable,batch=startBatchWithReplica(configuration,{endpoint:configuration.rumEndpoint,request:request,encoder:rumEncoder,encoderFallback:rumEncoder.isAsync?createIdentityEncoder:void 0},reportError,pageExitObservable,sessionExpireObservable),prepareUrgentFlushSubscription=batch.prepareUrgentFlushObservable.subscribe((function(event){return lifeCycle.notify(LifeCycleEventType.PAGE_EXITED,event)})),rumEventSubscription=lifeCycle.subscribe(LifeCycleEventType.RUM_EVENT_COLLECTED,(function(serverRumEvent){serverRumEvent.type===RumEventType.VIEW?batch.upsert(serverRumEvent,serverRumEvent.view.id):batch.add(serverRumEvent)}));function sendImmediateView(event,reason){immediateViewBatch||(immediateViewEncoder=createEncoder(EncoderStreamId.RUM_INITIAL_VIEW),immediateViewBatch=startBatchWithReplica(configuration,{request:request,encoder:immediateViewEncoder,encoderFallback:immediateViewEncoder.isAsync?createIdentityEncoder:void 0,flushRequestObservable:flushRequestObservable},reportError,new Observable,sessionExpireObservable)),immediateViewBatch.upsert(event,event.view.id),flushRequestObservable.notify(reason)}var initialViewSubscription=lifeCycle.subscribe(LifeCycleEventType.RUM_VIEW_FIRST_COLLECTED,(function(event){return sendImmediateView(event,"view_created")})),forcedViewSubscription=lifeCycle.subscribe(LifeCycleEventType.RUM_VIEW_FORCED_COLLECTED,(function(event){return sendImmediateView(event,"session_forced")})),telemetrySubscription=telemetryEventObservable.subscribe((function(event){batch.add(event)}));return{flushObservable:batch.flushObservable,add:batch.add,upsert:batch.upsert,stop:function stop(){prepareUrgentFlushSubscription.unsubscribe(),rumEventSubscription.unsubscribe(),initialViewSubscription.unsubscribe(),forcedViewSubscription.unsubscribe(),telemetrySubscription.unsubscribe(),batch.stop(),immediateViewBatch&&(immediateViewBatch.stop(),immediateViewEncoder.stop&&immediateViewEncoder.stop())}}}
2
+ //# sourceMappingURL=startRumBatch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"startRumBatch.js","names":["createIdentityEncoder","createHttpRequest","LifeCycleEventType","Observable","RumEventType","startBatchWithReplica","EncoderStreamId","startRumBatch","configuration","lifeCycle","telemetryEventObservable","reportError","pageExitObservable","sessionExpireObservable","createEncoder","rumEncoder","RUM","request","rumEndpoint","batchBytesLimit","retryMaxSize","flushRequestObservable","immediateViewBatch","immediateViewEncoder","batch","endpoint","encoder","encoderFallback","isAsync","undefined","prepareUrgentFlushSubscription","prepareUrgentFlushObservable","subscribe","event","notify","PAGE_EXITED","rumEventSubscription","RUM_EVENT_COLLECTED","serverRumEvent","type","VIEW","upsert","view","id","add","sendImmediateView","reason","RUM_INITIAL_VIEW","initialViewSubscription","RUM_VIEW_FIRST_COLLECTED","forcedViewSubscription","RUM_VIEW_FORCED_COLLECTED","telemetrySubscription","flushObservable","stop","unsubscribe"],"sources":["../../src/transport/startRumBatch.js"],"mappings":"AAAA,SACEA,qBAAqB,EACrBC,iBAAiB,EACjBC,kBAAkB,EAClBC,UAAU,EACVC,YAAY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M,EAAEjB,KAAK,CAACiB,MAAM;IACpBa,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAc;MAChBxB,8BAA8B,CAACyB,WAAW,CAAC,CAAC;MAC5CnB,oBAAoB,CAACmB,WAAW,CAAC,CAAC;MAClCP,uBAAuB,CAACO,WAAW,CAAC,CAAC;MACrCL,sBAAsB,CAACK,WAAW,CAAC,CAAC;MACpCH,qBAAqB,CAACG,WAAW,CAAC,CAAC;MACnC/B,KAAK,CAAC8B,IAAI,CAAC,CAAC;MACZ,IAAIhC,kBAAkB,EAAE;QACtBA,kBAAkB,CAACgC,IAAI,CAAC,CAAC;QACzB,IAAI/B,oBAAoB,CAAC+B,IAAI,EAAE;UAC7B/B,oBAAoB,CAAC+B,IAAI,CAAC,CAAC;QAC7B;MACF;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"startRumBatch.js","names":["createIdentityEncoder","createHttpRequest","LifeCycleEventType","Observable","RumEventType","startBatchWithReplica","EncoderStreamId","startRumBatch","configuration","lifeCycle","telemetryEventObservable","reportError","pageExitObservable","sessionExpireObservable","createEncoder","immediateViewBatch","immediateViewEncoder","rumEncoder","RUM","request","rumEndpoint","batchBytesLimit","retryMaxSize","flushRequestObservable","batch","endpoint","encoder","encoderFallback","isAsync","undefined","prepareUrgentFlushSubscription","prepareUrgentFlushObservable","subscribe","event","notify","PAGE_EXITED","rumEventSubscription","RUM_EVENT_COLLECTED","serverRumEvent","type","VIEW","upsert","view","id","add","sendImmediateView","reason","RUM_INITIAL_VIEW","initialViewSubscription","RUM_VIEW_FIRST_COLLECTED","forcedViewSubscription","RUM_VIEW_FORCED_COLLECTED","telemetrySubscription","flushObservable","stop","unsubscribe"],"sources":["../../src/transport/startRumBatch.js"],"mappings":"OACEA,sBACAC,kBACAC,mBACAC,WACAC,aACAC,0BACK,iCACEC,oBAAuB,mCACzB,SAASC,cACdC,cACAC,UACAC,yBACAC,YACAC,mBACAC,wBACAC,eAEA,IASIC,mBACAC,q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,wBAAwBO,cACxBL,uBAAuBK,cACvBH,sBAAsBG,cACtB/B,MAAM8B,OACFvC,qBACFA,mBAAmBuC,OACftC,qBAAqBsC,MACvBtC,qBAAqBsC,OAG3B,EAEJ","ignoreList":[]}
@@ -1,9 +1,2 @@
1
- import { getEventBridge, LifeCycleEventType, processedMessageByDataMap } from '@cloudcare/browser-core';
2
- export function startRumEventBridge(lifeCycle) {
3
- var bridge = getEventBridge();
4
- lifeCycle.subscribe(LifeCycleEventType.RUM_EVENT_COLLECTED, function (serverRumEvent) {
5
- var data = processedMessageByDataMap(serverRumEvent).rowData;
6
- bridge.send('rum', data);
7
- });
8
- }
9
- //# sourceMappingURL=startRumEventBridge.js.map
1
+ import{getEventBridge,LifeCycleEventType,processedMessageByDataMap}from"@cloudcare/browser-core";export function startRumEventBridge(lifeCycle){var bridge=getEventBridge();lifeCycle.subscribe(LifeCycleEventType.RUM_EVENT_COLLECTED,(function(serverRumEvent){var data=processedMessageByDataMap(serverRumEvent).rowData;bridge.send("rum",data)}))}
2
+ //# sourceMappingURL=startRumEventBridge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"startRumEventBridge.js","names":["getEventBridge","LifeCycleEventType","processedMessageByDataMap","startRumEventBridge","lifeCycle","bridge","subscribe","RUM_EVENT_COLLECTED","serverRumEvent","data","rowData","send"],"sources":["../../src/transport/startRumEventBridge.js"],"mappings":"AAAA,SACEA,cAAc,EACdC,kBAAkB,EAClBC,yBAAyB,QACpB,yBAAyB;AAEhC,OAAO,SAASC,mBAAmBA,CAACC,SAAS,EAAE;EAC7C,IAAIC,MAAM,GAAGL,cAAc,CAAC,CAAC;EAE7BI,SAAS,CAACE,SAAS,CACjBL,kBAAkB,CAACM,mBAAmB,EACtC,UAAUC,cAAc,EAAE;IACxB,IAAIC,IAAI,GAAGP,yBAAyB,CAACM,cAAc,CAAC,CAACE,OAAO;IAC5DL,MAAM,CAACM,IAAI,CAAC,KAAK,EAAEF,IAAI,CAAC;EAC1B,CACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"startRumEventBridge.js","names":["getEventBridge","LifeCycleEventType","processedMessageByDataMap","startRumEventBridge","lifeCycle","bridge","subscribe","RUM_EVENT_COLLECTED","serverRumEvent","data","rowData","send"],"sources":["../../src/transport/startRumEventBridge.js"],"mappings":"OACEA,eACAC,mBACAC,8BACK,iCAEA,SAASC,oBAAoBC,WAClC,IAAIC,OAASL,iBAEbI,UAAUE,UACRL,mBAAmBM,qBACnB,SAAUC,gBACR,IAAIC,KAAOP,0BAA0BM,gBAAgBE,QACrDL,OAAOM,KAAK,MAAOF,KACrB,GAEJ","ignoreList":[]}
@@ -1 +1,2 @@
1
- export * from './sessionReplayConstants';
1
+ export*from"./sessionReplayConstants";
2
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/types/index.js"],"mappings":"AAAA,cAAc,0BAA0B","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["from"],"sources":["../../src/types/index.js"],"mappings":"MAAAA,KAAc","ignoreList":[]}
@@ -1,46 +1,2 @@
1
- export var RecordType = {
2
- FullSnapshot: 2,
3
- IncrementalSnapshot: 3,
4
- Meta: 4,
5
- Focus: 6,
6
- ViewEnd: 7,
7
- VisualViewport: 8,
8
- FrustrationRecord: 9
9
- };
10
- export var NodeType = {
11
- Document: 0,
12
- DocumentType: 1,
13
- Element: 2,
14
- Text: 3,
15
- CDATA: 4,
16
- DocumentFragment: 11
17
- };
18
- export var IncrementalSource = {
19
- Mutation: 0,
20
- MouseMove: 1,
21
- MouseInteraction: 2,
22
- Scroll: 3,
23
- ViewportResize: 4,
24
- Input: 5,
25
- TouchMove: 6,
26
- MediaInteraction: 7,
27
- StyleSheetRule: 8,
28
- CanvasMutation: 9
29
- // Font : 10,
30
- };
31
- export var MouseInteractionType = {
32
- MouseUp: 0,
33
- MouseDown: 1,
34
- Click: 2,
35
- ContextMenu: 3,
36
- DblClick: 4,
37
- Focus: 5,
38
- Blur: 6,
39
- TouchStart: 7,
40
- TouchEnd: 9
41
- };
42
- export var MediaInteractionType = {
43
- Play: 0,
44
- Pause: 1
45
- };
46
- //# sourceMappingURL=sessionReplayConstants.js.map
1
+ export var RecordType={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9};export var NodeType={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11};export var IncrementalSource={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8,CanvasMutation:9};export var MouseInteractionType={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9};export var MediaInteractionType={Play:0,Pause:1};
2
+ //# sourceMappingURL=sessionReplayConstants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sessionReplayConstants.js","names":["RecordType","FullSnapshot","IncrementalSnapshot","Meta","Focus","ViewEnd","VisualViewport","FrustrationRecord","NodeType","Document","DocumentType","Element","Text","CDATA","DocumentFragment","IncrementalSource","Mutation","MouseMove","MouseInteraction","Scroll","ViewportResize","Input","TouchMove","MediaInteraction","StyleSheetRule","CanvasMutation","MouseInteractionType","MouseUp","MouseDown","Click","ContextMenu","DblClick","Blur","TouchStart","TouchEnd","MediaInteractionType","Play","Pause"],"sources":["../../src/types/sessionReplayConstants.js"],"mappings":"AAAA,OAAO,IAAIA,UAAU,GAAG;EACtBC,YAAY,EAAE,CAAC;EACfC,mBAAmB,EAAE,CAAC;EACtBC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,OAAO,EAAE,CAAC;EACVC,cAAc,EAAE,CAAC;EACjBC,iBAAiB,EAAE;AACrB,CAAC;AAED,OAAO,IAAIC,QAAQ,GAAG;EACpBC,QAAQ,EAAE,CAAC;EACXC,YAAY,EAAE,CAAC;EACfC,OAAO,EAAE,CAAC;EACVC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE,CAAC;EACRC,gBAAgB,EAAE;AACpB,CAAC;AAED,OAAO,IAAIC,iBAAiB,GAAG;EAC7BC,QAAQ,EAAE,CAAC;EACXC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE,CAAC;EACnBC,MAAM,EAAE,CAAC;EACTC,cAAc,EAAE,CAAC;EACjBC,KAAK,EAAE,CAAC;EACRC,SAAS,EAAE,CAAC;EACZC,gBAAgB,EAAE,CAAC;EACnBC,cAAc,EAAE,CAAC;EACjBC,cAAc,EAAE;EAChB;AACF,CAAC;AAED,OAAO,IAAIC,oBAAoB,GAAG;EAChCC,OAAO,EAAE,CAAC;EACVC,SAAS,EAAE,CAAC;EACZC,KAAK,EAAE,CAAC;EACRC,WAAW,EAAE,CAAC;EACdC,QAAQ,EAAE,CAAC;EACX3B,KAAK,EAAE,CAAC;EACR4B,IAAI,EAAE,CAAC;EACPC,UAAU,EAAE,CAAC;EACbC,QAAQ,EAAE;AACZ,CAAC;AAED,OAAO,IAAIC,oBAAoB,GAAG;EAChCC,IAAI,EAAE,CAAC;EACPC,KAAK,EAAE;AACT,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"sessionReplayConstants.js","names":["RecordType","FullSnapshot","IncrementalSnapshot","Meta","Focus","ViewEnd","VisualViewport","FrustrationRecord","NodeType","Document","DocumentType","Element","Text","CDATA","DocumentFragment","IncrementalSource","Mutation","MouseMove","MouseInteraction","Scroll","ViewportResize","Input","TouchMove","MediaInteraction","StyleSheetRule","CanvasMutation","MouseInteractionType","MouseUp","MouseDown","Click","ContextMenu","DblClick","Blur","TouchStart","TouchEnd","MediaInteractionType","Play","Pause"],"sources":["../../src/types/sessionReplayConstants.js"],"mappings":"OAAO,IAAIA,WAAa,CACtBC,aAAc,EACdC,oBAAqB,EACrBC,KAAM,EACNC,MAAO,EACPC,QAAS,EACTC,eAAgB,EAChBC,kBAAmB,UAGd,IAAIC,SAAW,CACpBC,SAAU,EACVC,aAAc,EACdC,QAAS,EACTC,KAAM,EACNC,MAAO,EACPC,iBAAkB,WAGb,IAAIC,kBAAoB,CAC7BC,SAAU,EACVC,UAAW,EACXC,iBAAkB,EAClBC,OAAQ,EACRC,eAAgB,EAChBC,MAAO,EACPC,UAAW,EACXC,iBAAkB,EAClBC,eAAgB,EAChBC,eAAgB,UAIX,IAAIC,qBAAuB,CAChCC,QAAS,EACTC,UAAW,EACXC,MAAO,EACPC,YAAa,EACbC,SAAU,EACV3B,MAAO,EACP4B,KAAM,EACNC,WAAY,EACZC,SAAU,UAGL,IAAIC,qBAAuB,CAChCC,KAAM,EACNC,MAAO","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-rum",
3
- "version": "3.3.23",
3
+ "version": "3.3.25",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "types": "types/index.d.ts",
7
7
  "dependencies": {
8
- "@cloudcare/browser-core": "3.3.23",
9
- "@cloudcare/browser-worker": "3.3.23"
8
+ "@cloudcare/browser-core": "3.3.25",
9
+ "@cloudcare/browser-worker": "3.3.25"
10
10
  },
11
11
  "description": "Guance Browser SDK RUM Package",
12
12
  "browserSdkCapabilities": {
@@ -16,10 +16,10 @@
16
16
  "dev": "webpack serve --open --mode=development",
17
17
  "build": "run-s build:cjs build:esm build:bundle",
18
18
  "build:cjs": "rm -rf cjs && babel --config-file ./babel.cjs.json --out-dir cjs ./src && npm run replace-build-env cjs && node ../../scripts/strip-source-map-sources-content.js cjs",
19
- "build:esm": "rm -rf esm && babel --config-file ./babel.esm.json --out-dir esm ./src && npm run replace-build-env esm && node ../../scripts/strip-source-map-sources-content.js esm",
20
- "build:bundle": "rm -rf bundle && webpack --mode=production && npm run check:bundle-size && npm run check:bundle-contract",
21
- "check:bundle-size": "node ../../scripts/check-bundle-size.js bundle/dataflux-rum.js",
22
- "check:bundle-contract": "node ../../scripts/check-bundle-property-contract.js bundle/dataflux-rum.js rum && node ../../scripts/check-rum-webgl-boundary.js bundle/dataflux-rum.js",
19
+ "build:esm": "rm -rf esm && babel --config-file ./babel.esm.json --out-dir esm ./src && npm run replace-build-env esm && node ../../scripts/optimize-esm.js esm && node ../../scripts/strip-source-map-sources-content.js esm",
20
+ "build:bundle": "rm -rf bundle && webpack --mode=production && webpack --mode=production --env domOnly && npm run check:bundle-size && npm run check:bundle-contract",
21
+ "check:bundle-size": "node ../../scripts/check-bundle-size.js bundle/dataflux-rum.js && node ../../scripts/check-bundle-size.js bundle/dataflux-rum-dom.js dom",
22
+ "check:bundle-contract": "node ../../scripts/check-bundle-property-contract.js bundle/dataflux-rum.js rum && node ../../scripts/check-bundle-property-contract.js bundle/dataflux-rum-dom.js rum && node ../../scripts/check-rum-webgl-boundary.js bundle/dataflux-rum.js",
23
23
  "replace-build-env": "node ../../scripts/replace-build-env.js",
24
24
  "publish:oss:current": "npm run build:bundle && node ./scripts/publish-oss.js current",
25
25
  "publish:oss:lts": "npm run build:bundle && node ./scripts/publish-oss.js lts",
@@ -41,5 +41,5 @@
41
41
  "author": "dataflux",
42
42
  "license": "MIT",
43
43
  "homepage": "https://github.com/GuanceCloud/datakit-js/README.md",
44
- "gitHead": "93ef4be8e95f758f9ec913397fca997b9128d6d3"
44
+ "gitHead": "18fd0d6c18b13e632048d3917b71d2c04811830a"
45
45
  }
@@ -1,5 +1,7 @@
1
1
  // A construction failure happens before init(), so its monitor cannot help.
2
2
  // Keep this fallback free of runtime collectors and browser instrumentation.
3
+ import { reportInitError } from './initCallbacks'
4
+
3
5
  export function makeDisabledRumPublicApi(withReplay) {
4
6
  function noop() {}
5
7
  function emptyContext() { return {} }
@@ -31,6 +33,9 @@ export function makeDisabledRumPublicApi(withReplay) {
31
33
  }
32
34
  }
33
35
  methods.forEach(function (name) { api[name] = noop })
36
+ api.init = function (configuration) {
37
+ reportInitError(configuration, 'sdk_disabled', 'RUM is disabled because SDK construction failed.')
38
+ }
34
39
  api.getGlobalContext = api.getRumGlobalContext = api.getViewContext = api.getUser = emptyContext
35
40
  api.createResourceTrackerId = function () { return '' }
36
41
  api.getRemoteConfiguration = noop
@@ -0,0 +1,16 @@
1
+ import { catchUserErrors, displayAlreadyInitializedError, getType } from '@cloudcare/browser-core'
2
+
3
+ export function callInitCallback(configuration, name, result) {
4
+ if (configuration && getType(configuration[name]) === 'function') {
5
+ catchUserErrors(configuration[name], name + ' callback threw an error:')(result)
6
+ }
7
+ }
8
+
9
+ export function reportInitError(configuration, code, message) {
10
+ callInitCallback(configuration, 'onInitError', { code: code, message: message })
11
+ }
12
+
13
+ export function reportAlreadyInitialized(configuration) {
14
+ displayAlreadyInitializedError('DATAFLUX_RUM', configuration)
15
+ reportInitError(configuration, 'already_initialized', 'RUM is already initialized or initialization is in progress.')
16
+ }
@@ -2,7 +2,8 @@ import {
2
2
  createBoundedBuffer,
3
3
  display,
4
4
  canUseEventBridge,
5
- displayAlreadyInitializedError,
5
+ catchUserErrors,
6
+ monitorError,
6
7
  willSyntheticsInjectRum,
7
8
  noop,
8
9
  timeStampNow,
@@ -15,8 +16,9 @@ import {
15
16
  getEventBridge,
16
17
  getType
17
18
  } from '@cloudcare/browser-core'
18
- import { validateAndBuildRumConfiguration } from '../domain/configuration'
19
+ import { prepareReplayCanvasConfiguration, validateAndBuildRumConfiguration } from '../domain/configuration'
19
20
  import { getPluginsTelemetry, validatePlugins } from '../domain/plugins'
21
+ import { callInitCallback, reportInitError, reportAlreadyInitialized } from './initCallbacks'
20
22
 
21
23
  export function createPreStartStrategy(
22
24
  rumPublicApiOptions,
@@ -28,7 +30,7 @@ export function createPreStartStrategy(
28
30
  var startCompressionWorker = rumPublicApiOptions.startCompressionWorker
29
31
  var overrideInitConfiguration = rumPublicApiOptions.overrideInitConfiguration
30
32
  var bufferApiCalls = createBoundedBuffer()
31
- var remoteConfigrationCallbacks = createBoundedBuffer()
33
+ var remoteConfigurationCallbacks = createBoundedBuffer()
32
34
  var firstStartViewCall
33
35
 
34
36
  var compressionWorker
@@ -37,11 +39,11 @@ export function createPreStartStrategy(
37
39
  var cachedConfiguration
38
40
  var cachedRemoteConfiguration
39
41
  var hasStarted
40
- var initializationPending
41
- var pluginsRequireManualViewTracking
42
+ var pendingAttempt
43
+ var workerFailed = false
42
44
  var resourceTrackerManager = rumPublicApiOptions.resourceTrackerManager
43
45
  function tryStartRum() {
44
- if (hasStarted || !cachedInitConfiguration || !cachedConfiguration) {
46
+ if (hasStarted || workerFailed || !cachedInitConfiguration || !cachedConfiguration) {
45
47
  return
46
48
  }
47
49
 
@@ -61,17 +63,35 @@ export function createPreStartStrategy(
61
63
  initialViewOptions = firstStartViewCall.options
62
64
  }
63
65
 
66
+ hasStarted = true
64
67
  var startRumResult = doStartRum(
65
68
  cachedConfiguration,
66
69
  compressionWorker,
67
70
  initialViewOptions
68
71
  )
69
- hasStarted = true
70
72
 
71
73
  bufferApiCalls.drain(startRumResult)
72
74
  }
73
75
 
74
- function doInit(initConfiguration, remoteConfiguration) {
76
+ function fail(attempt, code, message) {
77
+ if (pendingAttempt !== attempt) return
78
+ attempt.$rConfigurationReadyCallbacks = undefined
79
+ pendingAttempt = undefined
80
+ if (code === 'worker_initialization_failed') workerFailed = true
81
+ reportInitError(attempt, code, message)
82
+ }
83
+
84
+ function run(attempt, callback) {
85
+ if (pendingAttempt !== attempt) return
86
+ try {
87
+ callback()
88
+ } catch (error) {
89
+ fail(attempt, 'initialization_failed', 'An error occurred while initializing RUM.')
90
+ monitorError(error)
91
+ }
92
+ }
93
+
94
+ function doInit(attempt, initConfiguration, remoteConfiguration, remoteError) {
75
95
  var eventBridgeAvailable = canUseEventBridge()
76
96
  if (eventBridgeAvailable) {
77
97
  initConfiguration = overrideInitConfigurationForBridge(initConfiguration)
@@ -83,11 +103,7 @@ export function createPreStartStrategy(
83
103
  // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides
84
104
  cachedInitConfiguration = initConfiguration
85
105
  cachedRemoteConfiguration = remoteConfiguration
86
- remoteConfigrationCallbacks.drain(cachedRemoteConfiguration)
87
- if (cachedConfiguration) {
88
- displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)
89
- return
90
- }
106
+ remoteConfigurationCallbacks.drain(cachedRemoteConfiguration)
91
107
  var telemetryConfiguration = deepClone(initConfiguration)
92
108
  if (initConfiguration.plugins) {
93
109
  telemetryConfiguration.plugins = getPluginsTelemetry(
@@ -97,7 +113,7 @@ export function createPreStartStrategy(
97
113
  addTelemetryConfiguration(telemetryConfiguration)
98
114
  var configuration = validateAndBuildRumConfiguration(initConfiguration)
99
115
  if (!configuration) {
100
- initializationPending = false
116
+ fail(attempt, 'invalid_configuration', 'Invalid RUM configuration.')
101
117
  return
102
118
  }
103
119
 
@@ -109,48 +125,71 @@ export function createPreStartStrategy(
109
125
  display.warn(
110
126
  'No storage available for session. We will not send any data.'
111
127
  )
112
- initializationPending = false
128
+ fail(attempt, 'storage_unavailable', 'No storage available for the RUM session.')
113
129
  return
114
130
  }
115
131
 
132
+ var prepared = false
133
+ var workerReady = true
134
+ function notifyIfReady() {
135
+ if (!prepared || !workerReady || pendingAttempt !== attempt) return
136
+ pendingAttempt = undefined
137
+ const result = { remoteConfiguration: 'disabled' }
138
+ if (remoteError) {
139
+ result.remoteConfiguration = 'fallback'
140
+ result.remoteConfigurationError = remoteError
141
+ } else if (remoteConfiguration !== undefined) {
142
+ result.remoteConfiguration = 'applied'
143
+ }
144
+ callInitCallback(attempt, 'onInitSuccess', result)
145
+ }
146
+
116
147
  if (
117
148
  configuration.compressIntakeRequests &&
118
149
  !configuration.sendContentTypeByJson &&
119
150
  !eventBridgeAvailable &&
120
151
  startCompressionWorker
121
152
  ) {
122
- compressionWorker = startCompressionWorker(
123
- configuration,
124
- 'RUM',
125
- // Worker initialization can fail asynchronously, especially in Firefox where even CSP
126
- // issues are reported asynchronously. For now, the SDK will continue its execution even if
127
- // data won't be sent to Datadog. We could improve this behavior in the future.
128
- noop
129
- )
130
- if (!compressionWorker) {
131
- // The compression worker starter should have logged an error message explaining the issue
132
- initializationPending = false
153
+ workerReady = false
154
+ function onWorkerError(reason) {
155
+ fail(attempt, 'worker_initialization_failed', reason || 'Unable to create the RUM compression Worker.')
156
+ }
157
+ compressionWorker = startCompressionWorker(configuration, 'RUM', onWorkerError, undefined, function () {
158
+ workerReady = true
159
+ notifyIfReady()
160
+ })
161
+ if (!compressionWorker || workerFailed) {
162
+ onWorkerError()
133
163
  return
134
164
  }
135
165
  }
136
166
 
167
+ // Let plugins queue the initial manual View before collection starts.
168
+ const callbacks = attempt.$rConfigurationReadyCallbacks
169
+ attempt.$rConfigurationReadyCallbacks = undefined
170
+ callbacks.forEach(function (callback) {
171
+ catchUserErrors(callback, 'Plugin configuration callback threw an error:')()
172
+ })
137
173
  cachedConfiguration = configuration
138
- initializationPending = false
139
- // Instrumuent fetch to track network requests
140
- // This is needed in case the consent is not granted and some cutsomer
141
- // library (Apollo Client) is storing uninstrumented fetch to be used later
142
- // The subscrption is needed so that the instrumentation process is completed
174
+ // Instrument fetch before returning so libraries can cache the wrapped function.
143
175
  initFetchObservable().subscribe(noop)
144
176
  tryStartRum()
177
+ // The handshake gates the notification. Collection starts as soon as the Worker exists.
178
+ prepared = true
179
+ notifyIfReady()
145
180
  }
146
181
 
147
182
  return {
148
183
  init: function (initConfiguration, publicApi) {
184
+ if (workerFailed) return
149
185
  if (!initConfiguration) {
150
186
  display.error('Missing configuration')
151
187
  return
152
188
  }
153
- // Set the experimental feature flags as early as possible, so we can use them in most places
189
+ if (pendingAttempt || cachedConfiguration) {
190
+ reportAlreadyInitialized(initConfiguration)
191
+ return
192
+ }
154
193
 
155
194
  // If we are in a Synthetics test configured to automatically inject a RUM instance, we want
156
195
  // to completely discard the customer application RUM instance by ignoring their init() call.
@@ -158,37 +197,40 @@ export function createPreStartStrategy(
158
197
  // internal `ignoreInitIfSyntheticsWillInjectRum` option is here to bypass this condition.
159
198
  if (ignoreInitIfSyntheticsWillInjectRum && willSyntheticsInjectRum()) {
160
199
  cachedInitConfiguration = initConfiguration
161
- return
162
- }
163
- if (initializationPending || cachedConfiguration) {
164
- displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)
200
+ reportInitError(initConfiguration, 'initialization_ignored', 'RUM initialization was delegated to Synthetics.')
165
201
  return
166
202
  }
167
203
  // Expose the accepted configuration regardless of initialization success.
204
+ initConfiguration = prepareReplayCanvasConfiguration(initConfiguration)
168
205
  cachedInitConfiguration = initConfiguration
169
- if (!validatePlugins(initConfiguration.plugins)) {
170
- return
171
- }
172
- initializationPending = true
173
- if (rumPublicApiOptions.onInit) {
174
- rumPublicApiOptions.onInit(initConfiguration, publicApi)
175
- }
176
- pluginsRequireManualViewTracking =
177
- !!initConfiguration.plugins &&
178
- initConfiguration.trackViewsManually === true
179
- if (initConfiguration.remoteConfiguration) {
180
- fetchAndApplyRemoteConfiguration(
181
- initConfiguration,
182
- function (remoteInitConfiguration, remoteConfiguration) {
183
- if (pluginsRequireManualViewTracking) {
184
- remoteInitConfiguration.trackViewsManually = true
185
- }
186
- doInit(remoteInitConfiguration, remoteConfiguration)
187
- }
188
- )
189
- } else {
190
- doInit(initConfiguration)
206
+ const attempt = pendingAttempt = {
207
+ onInitSuccess: initConfiguration.onInitSuccess,
208
+ onInitError: initConfiguration.onInitError,
209
+ $rConfigurationReadyCallbacks: []
191
210
  }
211
+ run(attempt, function () {
212
+ if (!validatePlugins(initConfiguration.plugins)) {
213
+ fail(attempt, 'invalid_plugins', 'Invalid RUM plugins configuration.')
214
+ return
215
+ }
216
+ if (rumPublicApiOptions.onInit) {
217
+ rumPublicApiOptions.onInit(initConfiguration, publicApi, function (callback) {
218
+ if (attempt.$rConfigurationReadyCallbacks) attempt.$rConfigurationReadyCallbacks.push(callback)
219
+ })
220
+ }
221
+ const pluginsRequireManualViewTracking =
222
+ !!initConfiguration.plugins && initConfiguration.trackViewsManually === true
223
+ if (initConfiguration.remoteConfiguration) {
224
+ fetchAndApplyRemoteConfiguration(initConfiguration, function (resolved, remote, error) {
225
+ run(attempt, function () {
226
+ if (pluginsRequireManualViewTracking) resolved.trackViewsManually = true
227
+ doInit(attempt, resolved, remote, error)
228
+ })
229
+ })
230
+ } else {
231
+ doInit(attempt, initConfiguration)
232
+ }
233
+ })
192
234
  },
193
235
 
194
236
  getInitConfiguration: function () {
@@ -196,10 +238,11 @@ export function createPreStartStrategy(
196
238
  },
197
239
  getRemoteConfiguration: function (callback) {
198
240
  if (getType(callback) === 'function') {
241
+ callback = catchUserErrors(callback, 'getRemoteConfiguration callback threw an error:')
199
242
  if (cachedRemoteConfiguration) {
200
243
  callback(cachedRemoteConfiguration)
201
244
  } else {
202
- remoteConfigrationCallbacks.add(callback)
245
+ remoteConfigurationCallbacks.add(callback)
203
246
  }
204
247
  }
205
248
  },