@atlaskit/react-ufo 3.6.6 → 3.6.7

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 (430) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +5 -6
  3. package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -4
  4. package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +6 -6
  5. package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -4
  6. package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
  7. package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +10 -10
  8. package/dist/cjs/assets/index.js +14 -17
  9. package/dist/cjs/assets/utils.js +13 -10
  10. package/dist/cjs/bundle-eval-timing/index.js +8 -8
  11. package/dist/cjs/coinflip/index.js +2 -3
  12. package/dist/cjs/config/index.js +42 -30
  13. package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +41 -29
  14. package/dist/cjs/create-payload/common/utils/index.js +20 -16
  15. package/dist/cjs/create-payload/index.js +120 -128
  16. package/dist/cjs/create-payload/utils/get-interaction-status.js +2 -3
  17. package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
  18. package/dist/cjs/create-payload/utils/get-react-ufo-payload-version.js +3 -4
  19. package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +2 -3
  20. package/dist/cjs/create-payload/utils/get-vc-metrics.js +7 -8
  21. package/dist/cjs/create-post-interaction-log-payload/index.js +12 -13
  22. package/dist/cjs/custom-data/index.js +14 -6
  23. package/dist/cjs/custom-mark/index.js +3 -4
  24. package/dist/cjs/custom-spans/index.js +3 -4
  25. package/dist/cjs/custom-timings/index.js +6 -6
  26. package/dist/cjs/experience-trace-id-context/index.js +21 -16
  27. package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -4
  28. package/dist/cjs/feature-flags-accessed/common/utils/index.js +12 -12
  29. package/dist/cjs/feature-flags-accessed/index.js +4 -4
  30. package/dist/cjs/generate-id/index.js +2 -3
  31. package/dist/cjs/global-error-handler/index.js +16 -15
  32. package/dist/cjs/initial-page-load-extra-timing/index.js +6 -6
  33. package/dist/cjs/interaction-metrics/index.js +146 -110
  34. package/dist/cjs/interaction-metrics/post-interaction-log.js +0 -10
  35. package/dist/cjs/interaction-metrics-init/index.js +15 -16
  36. package/dist/cjs/interaction-metrics-init/schedule-idle-callback.js +2 -3
  37. package/dist/cjs/resource-timing/common/utils/config.js +10 -10
  38. package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +14 -14
  39. package/dist/cjs/resource-timing/main.js +19 -20
  40. package/dist/cjs/resource-timing/utils.js +3 -4
  41. package/dist/cjs/round-number/index.js +3 -4
  42. package/dist/cjs/route-name/index.js +2 -3
  43. package/dist/cjs/segment/schedule-on-paint.js +2 -4
  44. package/dist/cjs/segment/segment.js +4 -5
  45. package/dist/cjs/set-interaction-error/index.js +3 -4
  46. package/dist/cjs/short-id/index.js +2 -3
  47. package/dist/cjs/ssr/index.js +21 -18
  48. package/dist/cjs/trace-interaction/index.js +4 -5
  49. package/dist/cjs/trace-pageload/index.js +6 -6
  50. package/dist/cjs/trace-press/index.js +2 -3
  51. package/dist/cjs/trace-redirect/index.js +2 -3
  52. package/dist/cjs/trace-transition/index.js +2 -3
  53. package/dist/cjs/trace-transition/utils/generate-span-id/index.js +3 -4
  54. package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +3 -4
  55. package/dist/cjs/vc/index.js +6 -17
  56. package/dist/cjs/vc/vc-observer/attachAbortListeners.js +3 -4
  57. package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +22 -13
  58. package/dist/cjs/vc/vc-observer/getViewport.js +6 -6
  59. package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +10 -20
  60. package/dist/cjs/vc/vc-observer/index.js +119 -145
  61. package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +3 -4
  62. package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +0 -17
  63. package/dist/cjs/vc/vc-observer/observers/index.js +2 -29
  64. package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -3
  65. package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
  66. package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +0 -2
  67. package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +0 -2
  68. package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -4
  69. package/dist/cjs/vc/vc-observer-new/entries-timeline/index.js +0 -9
  70. package/dist/cjs/vc/vc-observer-new/get-element-name.js +2 -3
  71. package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +10 -11
  72. package/dist/cjs/vc/vc-observer-new/index.js +0 -9
  73. package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
  74. package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -6
  75. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +12 -20
  76. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +26 -26
  77. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
  78. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +13 -25
  79. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +7 -8
  80. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +39 -48
  81. package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +7 -8
  82. package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
  83. package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
  84. package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
  85. package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/task-yield.js +7 -8
  86. package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +7 -15
  87. package/dist/cjs/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +7 -8
  88. package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -15
  89. package/dist/cjs/vc/vc-observer-new/viewport-observer/performance-observer/index.js +9 -9
  90. package/dist/cjs/vc/vc-observer-new/window-event-observer/index.js +1 -7
  91. package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +4 -5
  92. package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +2 -3
  93. package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +4 -5
  94. package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +2 -3
  95. package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
  96. package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +8 -9
  97. package/dist/es2019/assets/index.js +14 -19
  98. package/dist/es2019/assets/utils.js +8 -10
  99. package/dist/es2019/bundle-eval-timing/index.js +6 -7
  100. package/dist/es2019/coinflip/index.js +2 -4
  101. package/dist/es2019/config/index.js +28 -29
  102. package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +15 -18
  103. package/dist/es2019/create-payload/common/utils/index.js +14 -15
  104. package/dist/es2019/create-payload/index.js +75 -84
  105. package/dist/es2019/create-payload/utils/get-interaction-status.js +2 -4
  106. package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
  107. package/dist/es2019/create-payload/utils/get-react-ufo-payload-version.js +2 -3
  108. package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +2 -3
  109. package/dist/es2019/create-payload/utils/get-vc-metrics.js +2 -3
  110. package/dist/es2019/create-post-interaction-log-payload/index.js +12 -13
  111. package/dist/es2019/custom-data/index.js +13 -5
  112. package/dist/es2019/custom-mark/index.js +2 -3
  113. package/dist/es2019/custom-spans/index.js +2 -3
  114. package/dist/es2019/custom-timings/index.js +4 -5
  115. package/dist/es2019/experience-trace-id-context/index.js +14 -15
  116. package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +2 -3
  117. package/dist/es2019/feature-flags-accessed/common/utils/index.js +10 -11
  118. package/dist/es2019/feature-flags-accessed/index.js +2 -3
  119. package/dist/es2019/generate-id/index.js +2 -3
  120. package/dist/es2019/global-error-handler/index.js +13 -14
  121. package/dist/es2019/initial-page-load-extra-timing/index.js +4 -5
  122. package/dist/es2019/interaction-metrics/index.js +108 -109
  123. package/dist/es2019/interaction-metrics/post-interaction-log.js +0 -10
  124. package/dist/es2019/interaction-metrics-init/index.js +14 -15
  125. package/dist/es2019/interaction-metrics-init/schedule-idle-callback.js +2 -3
  126. package/dist/es2019/resource-timing/common/utils/config.js +8 -9
  127. package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +12 -13
  128. package/dist/es2019/resource-timing/main.js +18 -19
  129. package/dist/es2019/resource-timing/utils.js +2 -3
  130. package/dist/es2019/round-number/index.js +2 -3
  131. package/dist/es2019/route-name/index.js +2 -3
  132. package/dist/es2019/segment/schedule-on-paint.js +2 -4
  133. package/dist/es2019/segment/segment.js +4 -5
  134. package/dist/es2019/set-interaction-error/index.js +2 -3
  135. package/dist/es2019/short-id/index.js +2 -3
  136. package/dist/es2019/ssr/index.js +16 -17
  137. package/dist/es2019/trace-interaction/index.js +4 -5
  138. package/dist/es2019/trace-pageload/index.js +4 -5
  139. package/dist/es2019/trace-press/index.js +2 -3
  140. package/dist/es2019/trace-redirect/index.js +2 -3
  141. package/dist/es2019/trace-transition/index.js +2 -3
  142. package/dist/es2019/trace-transition/utils/generate-span-id/index.js +2 -3
  143. package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +2 -3
  144. package/dist/es2019/vc/index.js +4 -16
  145. package/dist/es2019/vc/vc-observer/attachAbortListeners.js +2 -3
  146. package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +4 -5
  147. package/dist/es2019/vc/vc-observer/getViewport.js +4 -5
  148. package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +8 -20
  149. package/dist/es2019/vc/vc-observer/index.js +104 -134
  150. package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +2 -3
  151. package/dist/es2019/vc/vc-observer/observers/editor-lnv/index.js +0 -17
  152. package/dist/es2019/vc/vc-observer/observers/index.js +2 -29
  153. package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -4
  154. package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
  155. package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +0 -2
  156. package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +0 -2
  157. package/dist/es2019/vc/vc-observer/revisions/revisions.js +2 -3
  158. package/dist/es2019/vc/vc-observer-new/entries-timeline/index.js +0 -9
  159. package/dist/es2019/vc/vc-observer-new/get-element-name.js +2 -3
  160. package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +10 -11
  161. package/dist/es2019/vc/vc-observer-new/index.js +0 -9
  162. package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
  163. package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +0 -3
  164. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +4 -14
  165. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +4 -5
  166. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
  167. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +8 -20
  168. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +2 -3
  169. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +8 -9
  170. package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +2 -3
  171. package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
  172. package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
  173. package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
  174. package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/task-yield.js +2 -4
  175. package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +7 -15
  176. package/dist/es2019/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +8 -8
  177. package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -15
  178. package/dist/es2019/vc/vc-observer-new/viewport-observer/performance-observer/index.js +8 -9
  179. package/dist/es2019/vc/vc-observer-new/window-event-observer/index.js +1 -7
  180. package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +4 -5
  181. package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +2 -3
  182. package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +4 -5
  183. package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +2 -3
  184. package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
  185. package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +8 -9
  186. package/dist/esm/assets/index.js +14 -17
  187. package/dist/esm/assets/utils.js +8 -10
  188. package/dist/esm/bundle-eval-timing/index.js +6 -7
  189. package/dist/esm/coinflip/index.js +2 -4
  190. package/dist/esm/config/index.js +28 -29
  191. package/dist/esm/create-experimental-interaction-metrics-payload/index.js +36 -28
  192. package/dist/esm/create-payload/common/utils/index.js +14 -15
  193. package/dist/esm/create-payload/index.js +119 -127
  194. package/dist/esm/create-payload/utils/get-interaction-status.js +2 -4
  195. package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
  196. package/dist/esm/create-payload/utils/get-react-ufo-payload-version.js +2 -3
  197. package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +2 -3
  198. package/dist/esm/create-payload/utils/get-vc-metrics.js +7 -8
  199. package/dist/esm/create-post-interaction-log-payload/index.js +12 -13
  200. package/dist/esm/custom-data/index.js +13 -5
  201. package/dist/esm/custom-mark/index.js +2 -3
  202. package/dist/esm/custom-spans/index.js +2 -3
  203. package/dist/esm/custom-timings/index.js +4 -5
  204. package/dist/esm/experience-trace-id-context/index.js +14 -15
  205. package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +2 -3
  206. package/dist/esm/feature-flags-accessed/common/utils/index.js +10 -11
  207. package/dist/esm/feature-flags-accessed/index.js +2 -3
  208. package/dist/esm/generate-id/index.js +2 -3
  209. package/dist/esm/global-error-handler/index.js +13 -14
  210. package/dist/esm/initial-page-load-extra-timing/index.js +4 -5
  211. package/dist/esm/interaction-metrics/index.js +108 -109
  212. package/dist/esm/interaction-metrics/post-interaction-log.js +0 -10
  213. package/dist/esm/interaction-metrics-init/index.js +14 -15
  214. package/dist/esm/interaction-metrics-init/schedule-idle-callback.js +2 -3
  215. package/dist/esm/resource-timing/common/utils/config.js +8 -9
  216. package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +12 -13
  217. package/dist/esm/resource-timing/main.js +18 -19
  218. package/dist/esm/resource-timing/utils.js +2 -3
  219. package/dist/esm/round-number/index.js +2 -3
  220. package/dist/esm/route-name/index.js +2 -3
  221. package/dist/esm/segment/schedule-on-paint.js +2 -4
  222. package/dist/esm/segment/segment.js +4 -5
  223. package/dist/esm/set-interaction-error/index.js +2 -3
  224. package/dist/esm/short-id/index.js +2 -3
  225. package/dist/esm/ssr/index.js +16 -17
  226. package/dist/esm/trace-interaction/index.js +4 -5
  227. package/dist/esm/trace-pageload/index.js +4 -5
  228. package/dist/esm/trace-press/index.js +2 -3
  229. package/dist/esm/trace-redirect/index.js +2 -3
  230. package/dist/esm/trace-transition/index.js +2 -3
  231. package/dist/esm/trace-transition/utils/generate-span-id/index.js +2 -3
  232. package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +2 -3
  233. package/dist/esm/vc/index.js +4 -16
  234. package/dist/esm/vc/vc-observer/attachAbortListeners.js +2 -3
  235. package/dist/esm/vc/vc-observer/getVCRevisionsData.js +21 -12
  236. package/dist/esm/vc/vc-observer/getViewport.js +4 -5
  237. package/dist/esm/vc/vc-observer/heatmap/heatmap.js +10 -20
  238. package/dist/esm/vc/vc-observer/index.js +119 -145
  239. package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +2 -3
  240. package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +0 -17
  241. package/dist/esm/vc/vc-observer/observers/index.js +2 -29
  242. package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -4
  243. package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
  244. package/dist/esm/vc/vc-observer/revisions/fy25_01.js +0 -2
  245. package/dist/esm/vc/vc-observer/revisions/fy25_02.js +0 -2
  246. package/dist/esm/vc/vc-observer/revisions/revisions.js +2 -3
  247. package/dist/esm/vc/vc-observer-new/entries-timeline/index.js +0 -9
  248. package/dist/esm/vc/vc-observer-new/get-element-name.js +2 -3
  249. package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +10 -11
  250. package/dist/esm/vc/vc-observer-new/index.js +0 -9
  251. package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
  252. package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -6
  253. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +9 -19
  254. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +24 -25
  255. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
  256. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +13 -25
  257. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +7 -8
  258. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +39 -48
  259. package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +7 -8
  260. package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
  261. package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
  262. package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
  263. package/dist/esm/vc/vc-observer-new/metric-calculator/utils/task-yield.js +7 -9
  264. package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +7 -15
  265. package/dist/esm/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +7 -8
  266. package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -15
  267. package/dist/esm/vc/vc-observer-new/viewport-observer/performance-observer/index.js +7 -9
  268. package/dist/esm/vc/vc-observer-new/window-event-observer/index.js +1 -7
  269. package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +2 -2
  270. package/dist/types/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +1 -1
  271. package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +3 -3
  272. package/dist/types/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +1 -1
  273. package/dist/types/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -2
  274. package/dist/types/assets/index.d.ts +1 -3
  275. package/dist/types/assets/utils.d.ts +4 -4
  276. package/dist/types/bundle-eval-timing/index.d.ts +2 -2
  277. package/dist/types/coinflip/index.d.ts +1 -1
  278. package/dist/types/common/react-ufo-payload-schema.d.ts +1 -0
  279. package/dist/types/config/index.d.ts +16 -14
  280. package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +4 -5
  281. package/dist/types/create-payload/common/utils/index.d.ts +8 -7
  282. package/dist/types/create-payload/index.d.ts +1 -97
  283. package/dist/types/create-payload/utils/get-interaction-status.d.ts +1 -1
  284. package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +1 -1
  285. package/dist/types/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
  286. package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +1 -1
  287. package/dist/types/create-payload/utils/get-vc-metrics.d.ts +2 -2
  288. package/dist/types/create-post-interaction-log-payload/index.d.ts +1 -1
  289. package/dist/types/custom-data/index.d.ts +1 -1
  290. package/dist/types/custom-mark/index.d.ts +1 -1
  291. package/dist/types/custom-spans/index.d.ts +1 -1
  292. package/dist/types/custom-timings/index.d.ts +2 -2
  293. package/dist/types/experience-trace-id-context/index.d.ts +7 -7
  294. package/dist/types/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +1 -1
  295. package/dist/types/feature-flags-accessed/common/utils/index.d.ts +2 -2
  296. package/dist/types/feature-flags-accessed/index.d.ts +1 -1
  297. package/dist/types/generate-id/index.d.ts +1 -1
  298. package/dist/types/global-error-handler/index.d.ts +3 -3
  299. package/dist/types/initial-page-load-extra-timing/index.d.ts +2 -2
  300. package/dist/types/interaction-context/index.d.ts +1 -1
  301. package/dist/types/interaction-metrics/index.d.ts +44 -44
  302. package/dist/types/interaction-metrics/post-interaction-log.d.ts +0 -1
  303. package/dist/types/interaction-metrics-init/index.d.ts +1 -1
  304. package/dist/types/interaction-metrics-init/schedule-idle-callback.d.ts +1 -1
  305. package/dist/types/resource-timing/common/utils/config.d.ts +2 -2
  306. package/dist/types/resource-timing/common/utils/resource-timing-buffer.d.ts +5 -5
  307. package/dist/types/resource-timing/main.d.ts +1 -1
  308. package/dist/types/resource-timing/utils.d.ts +1 -1
  309. package/dist/types/round-number/index.d.ts +1 -1
  310. package/dist/types/route-name/index.d.ts +3 -3
  311. package/dist/types/segment/schedule-on-paint.d.ts +1 -1
  312. package/dist/types/set-interaction-error/index.d.ts +1 -1
  313. package/dist/types/short-id/index.d.ts +1 -1
  314. package/dist/types/ssr/index.d.ts +5 -5
  315. package/dist/types/trace-interaction/index.d.ts +1 -1
  316. package/dist/types/trace-pageload/index.d.ts +2 -2
  317. package/dist/types/trace-press/index.d.ts +1 -1
  318. package/dist/types/trace-redirect/index.d.ts +1 -1
  319. package/dist/types/trace-transition/index.d.ts +1 -1
  320. package/dist/types/trace-transition/utils/generate-span-id/index.d.ts +1 -1
  321. package/dist/types/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -1
  322. package/dist/types/vc/index.d.ts +2 -2
  323. package/dist/types/vc/vc-observer/attachAbortListeners.d.ts +2 -2
  324. package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +5 -5
  325. package/dist/types/vc/vc-observer/getViewport.d.ts +2 -2
  326. package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +1 -1
  327. package/dist/types/vc/vc-observer/index.d.ts +4 -4
  328. package/dist/types/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -1
  329. package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +4 -4
  330. package/dist/types/vc/vc-observer/revisions/revisions.d.ts +1 -1
  331. package/dist/types/vc/vc-observer-new/get-element-name.d.ts +1 -1
  332. package/dist/types/vc/vc-observer-new/get-unique-element-name.d.ts +1 -1
  333. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +3 -2
  334. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +2 -2
  335. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +2 -2
  336. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
  337. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +1 -1
  338. package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +2 -2
  339. package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +1 -1
  340. package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +1 -1
  341. package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +1 -1
  342. package/dist/types/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +1 -1
  343. package/dist/types/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
  344. package/dist/types/vc/vc-observer-new/viewport-observer/intersection-observer/index.d.ts +1 -1
  345. package/dist/types/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +1 -1
  346. package/dist/types/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +2 -2
  347. package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +2 -2
  348. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +1 -1
  349. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +3 -3
  350. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +1 -1
  351. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -2
  352. package/dist/types-ts4.5/assets/index.d.ts +1 -3
  353. package/dist/types-ts4.5/assets/utils.d.ts +4 -4
  354. package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +2 -2
  355. package/dist/types-ts4.5/coinflip/index.d.ts +1 -1
  356. package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +1 -0
  357. package/dist/types-ts4.5/config/index.d.ts +20 -14
  358. package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +4 -5
  359. package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +8 -7
  360. package/dist/types-ts4.5/create-payload/index.d.ts +1 -97
  361. package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +1 -1
  362. package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +1 -1
  363. package/dist/types-ts4.5/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
  364. package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +1 -1
  365. package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +2 -2
  366. package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +1 -1
  367. package/dist/types-ts4.5/custom-data/index.d.ts +1 -1
  368. package/dist/types-ts4.5/custom-mark/index.d.ts +1 -1
  369. package/dist/types-ts4.5/custom-spans/index.d.ts +1 -1
  370. package/dist/types-ts4.5/custom-timings/index.d.ts +2 -2
  371. package/dist/types-ts4.5/experience-trace-id-context/index.d.ts +7 -7
  372. package/dist/types-ts4.5/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +1 -1
  373. package/dist/types-ts4.5/feature-flags-accessed/common/utils/index.d.ts +2 -2
  374. package/dist/types-ts4.5/feature-flags-accessed/index.d.ts +1 -1
  375. package/dist/types-ts4.5/generate-id/index.d.ts +1 -1
  376. package/dist/types-ts4.5/global-error-handler/index.d.ts +3 -3
  377. package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +2 -2
  378. package/dist/types-ts4.5/interaction-context/index.d.ts +1 -1
  379. package/dist/types-ts4.5/interaction-metrics/index.d.ts +44 -44
  380. package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +0 -1
  381. package/dist/types-ts4.5/interaction-metrics-init/index.d.ts +1 -1
  382. package/dist/types-ts4.5/interaction-metrics-init/schedule-idle-callback.d.ts +1 -1
  383. package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +2 -2
  384. package/dist/types-ts4.5/resource-timing/common/utils/resource-timing-buffer.d.ts +5 -5
  385. package/dist/types-ts4.5/resource-timing/main.d.ts +1 -1
  386. package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -1
  387. package/dist/types-ts4.5/round-number/index.d.ts +1 -1
  388. package/dist/types-ts4.5/route-name/index.d.ts +3 -3
  389. package/dist/types-ts4.5/segment/schedule-on-paint.d.ts +1 -1
  390. package/dist/types-ts4.5/set-interaction-error/index.d.ts +1 -1
  391. package/dist/types-ts4.5/short-id/index.d.ts +1 -1
  392. package/dist/types-ts4.5/ssr/index.d.ts +5 -5
  393. package/dist/types-ts4.5/trace-interaction/index.d.ts +1 -1
  394. package/dist/types-ts4.5/trace-pageload/index.d.ts +2 -2
  395. package/dist/types-ts4.5/trace-press/index.d.ts +1 -1
  396. package/dist/types-ts4.5/trace-redirect/index.d.ts +1 -1
  397. package/dist/types-ts4.5/trace-transition/index.d.ts +1 -1
  398. package/dist/types-ts4.5/trace-transition/utils/generate-span-id/index.d.ts +1 -1
  399. package/dist/types-ts4.5/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -1
  400. package/dist/types-ts4.5/vc/index.d.ts +2 -2
  401. package/dist/types-ts4.5/vc/vc-observer/attachAbortListeners.d.ts +2 -2
  402. package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +5 -5
  403. package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -2
  404. package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +1 -1
  405. package/dist/types-ts4.5/vc/vc-observer/index.d.ts +4 -4
  406. package/dist/types-ts4.5/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -1
  407. package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +4 -4
  408. package/dist/types-ts4.5/vc/vc-observer/revisions/revisions.d.ts +1 -1
  409. package/dist/types-ts4.5/vc/vc-observer-new/get-element-name.d.ts +1 -1
  410. package/dist/types-ts4.5/vc/vc-observer-new/get-unique-element-name.d.ts +1 -1
  411. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +3 -2
  412. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +2 -2
  413. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +2 -2
  414. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
  415. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +1 -1
  416. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +2 -2
  417. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +1 -1
  418. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +1 -1
  419. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +1 -1
  420. package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +1 -1
  421. package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
  422. package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/intersection-observer/index.d.ts +1 -1
  423. package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +1 -1
  424. package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +2 -2
  425. package/package.json +4 -1
  426. package/dist/cjs/self-measurements/index.js +0 -261
  427. package/dist/es2019/self-measurements/index.js +0 -213
  428. package/dist/esm/self-measurements/index.js +0 -246
  429. package/dist/types/self-measurements/index.d.ts +0 -57
  430. package/dist/types-ts4.5/self-measurements/index.d.ts +0 -57
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.convertPhysicalToLogicalResolution = void 0;
7
- var _selfMeasurements = require("../../../../self-measurements");
6
+ exports.convertPhysicalToLogicalResolution = convertPhysicalToLogicalResolution;
7
+ exports.default = void 0;
8
8
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
9
9
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
10
10
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
11
11
  // The LayoutShiftAttribution API is returning the numbers on physical dimension
12
- var convertPhysicalToLogicalResolution = exports.convertPhysicalToLogicalResolution = (0, _selfMeasurements.withProfiling)(function convertPhysicalToLogicalResolution(rect) {
12
+ function convertPhysicalToLogicalResolution(rect) {
13
13
  if (typeof window.devicePixelRatio !== 'number') {
14
14
  return rect;
15
15
  }
@@ -19,13 +19,13 @@ var convertPhysicalToLogicalResolution = exports.convertPhysicalToLogicalResolut
19
19
 
20
20
  // eslint-disable-next-line compat/compat
21
21
  return new DOMRect(rect.x / window.devicePixelRatio, rect.y / window.devicePixelRatio, rect.width / window.devicePixelRatio, rect.height / window.devicePixelRatio);
22
- }, ['vc']);
23
- var createPerformanceObserver = (0, _selfMeasurements.withProfiling)(function createPerformanceObserver(args) {
22
+ }
23
+ function createPerformanceObserver(_ref) {
24
+ var onLayoutShift = _ref.onLayoutShift;
24
25
  if (!window || typeof window.PerformanceObserver !== 'function') {
25
26
  return null;
26
27
  }
27
- var onLayoutShift = (0, _selfMeasurements.withProfiling)(args.onLayoutShift, ['vc']);
28
- var performanceObserverCallback = (0, _selfMeasurements.withProfiling)(function performanceObserverCallback(entries) {
28
+ var performanceObserverCallback = function performanceObserverCallback(entries) {
29
29
  var _iterator = _createForOfIteratorHelper(entries.getEntries()),
30
30
  _step;
31
31
  try {
@@ -53,8 +53,8 @@ var createPerformanceObserver = (0, _selfMeasurements.withProfiling)(function cr
53
53
  } finally {
54
54
  _iterator.f();
55
55
  }
56
- }, ['vc']);
56
+ };
57
57
  var observer = new PerformanceObserver(performanceObserverCallback);
58
58
  return observer;
59
- }, ['vc']);
59
+ }
60
60
  var _default = exports.default = createPerformanceObserver;
@@ -9,17 +9,11 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _bindEventListener = require("bind-event-listener");
12
- var _selfMeasurements = require("../../../self-measurements");
13
12
  var WindowEventObserver = exports.default = /*#__PURE__*/function () {
14
13
  function WindowEventObserver(opts) {
15
14
  (0, _classCallCheck2.default)(this, WindowEventObserver);
16
15
  (0, _defineProperty2.default)(this, "unbindFns", []);
17
- var operationTimer = (0, _selfMeasurements.markProfilingStart)('WindowEventObserver constructor');
18
- this.onEvent = (0, _selfMeasurements.withProfiling)(opts.onEvent, ['vc']);
19
- this.bindEvent = (0, _selfMeasurements.withProfiling)(this.bindEvent.bind(this), ['vc']);
20
- this.start = (0, _selfMeasurements.withProfiling)(this.start.bind(this), ['vc']);
21
- this.stop = (0, _selfMeasurements.withProfiling)(this.stop.bind(this), ['vc']);
22
- (0, _selfMeasurements.markProfilingEnd)(operationTimer);
16
+ this.onEvent = opts.onEvent;
23
17
  }
24
18
  return (0, _createClass2.default)(WindowEventObserver, [{
25
19
  key: "bindEvent",
@@ -1,10 +1,9 @@
1
- import { withProfiling } from '../../../self-measurements';
2
1
  /* Borrowed from https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/performance/browser-metrics/src/plugins/timings/resource.ts */
3
2
  const cacheableTypes = ['script', 'link'];
4
3
  const CACHE_NETWORK = 'network';
5
4
  const CACHE_MEMORY = 'memory';
6
5
  const CACHE_DISK = 'disk';
7
- const calculateTransferType = withProfiling(function calculateTransferType(type, duration, size) {
6
+ function calculateTransferType(type, duration, size) {
8
7
  if (!cacheableTypes.includes(type)) {
9
8
  return CACHE_NETWORK;
10
9
  }
@@ -18,8 +17,8 @@ const calculateTransferType = withProfiling(function calculateTransferType(type,
18
17
  return null;
19
18
  }
20
19
  return CACHE_NETWORK;
21
- });
22
- export const getCacheHitRatio = withProfiling(function getCacheHitRatio({
20
+ }
21
+ export function getCacheHitRatio({
23
22
  start
24
23
  }) {
25
24
  let fromCache = 0;
@@ -61,4 +60,4 @@ export const getCacheHitRatio = withProfiling(function getCacheHitRatio({
61
60
  } catch (e) {
62
61
  return {};
63
62
  }
64
- });
63
+ }
@@ -1,5 +1,4 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
- export const getCLS = withProfiling(function getCLS(start, stop, buffer) {
1
+ export function getCLS(start, stop, buffer) {
3
2
  const layoutShifts = buffer.getAll().filter(entry => entry.startTime >= start && entry.startTime <= stop);
4
3
  const sessionWindows = [];
5
4
  let currentWindow = null;
@@ -31,4 +30,4 @@ export const getCLS = withProfiling(function getCLS(start, stop, buffer) {
31
30
 
32
31
  // Return score of largest burst as CLS metric
33
32
  return Math.round(maxScore * 10000) / 10000;
34
- });
33
+ }
@@ -1,14 +1,13 @@
1
- import { withProfiling } from '../../../self-measurements';
2
1
  import { getCLS } from './cls';
3
2
  import { PerformanceObserverEntryTypes } from './const';
4
3
  import { getTBT } from './tbt';
5
4
  import { EntriesBuffer } from './utils/buffer';
6
5
  import { startLSObserver, startLTObserver } from './utils/observer';
7
- export const startLighthouseObserver = withProfiling(function startLighthouseObserver() {
6
+ export function startLighthouseObserver() {
8
7
  startLSObserver();
9
8
  startLTObserver();
10
- });
11
- export const getLighthouseMetrics = withProfiling(function getLighthouseMetrics({
9
+ }
10
+ export function getLighthouseMetrics({
12
11
  start,
13
12
  stop
14
13
  }) {
@@ -21,4 +20,4 @@ export const getLighthouseMetrics = withProfiling(function getLighthouseMetrics(
21
20
  'metric:tbt:observed': Math.round(tbt.observed),
22
21
  'metric:cls': cls
23
22
  };
24
- });
23
+ }
@@ -1,6 +1,5 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
1
  const MAX_ACCEPTABLE_TASK_DURATION = 50;
3
- export const getTBT = withProfiling(function getTBT(start, stop, buffer) {
2
+ export function getTBT(start, stop, buffer) {
4
3
  return buffer.getAll().filter(entry => entry.startTime <= stop && entry.duration > MAX_ACCEPTABLE_TASK_DURATION && (entry.startTime >= start || entry.startTime + entry.duration >= start || entry.startTime <= start && entry.startTime + entry.duration >= stop)).reduce((tbt, entry) => {
5
4
  const longTaskStop = entry.startTime + entry.duration;
6
5
  const intersectStart = Math.max(entry.startTime + MAX_ACCEPTABLE_TASK_DURATION, start);
@@ -15,4 +14,4 @@ export const getTBT = withProfiling(function getTBT(start, stop, buffer) {
15
14
  total: 0,
16
15
  observed: 0
17
16
  });
18
- });
17
+ }
@@ -1,13 +1,10 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { withProfiling } from '../../../../../self-measurements';
3
2
  import { PerformanceObserverEntryTypes } from '../../const';
4
3
  export class BufferWithMaxLength {
5
4
  constructor(maxLength = 1000) {
6
5
  _defineProperty(this, "buffer", []);
7
6
  _defineProperty(this, "full", false);
8
7
  this.maxLength = maxLength;
9
- this.push = withProfiling(this.push.bind(this));
10
- this.getAll = withProfiling(this.getAll.bind(this));
11
8
  }
12
9
  push(item) {
13
10
  if (this.full || this.maxLength === this.buffer.length) {
@@ -1,8 +1,7 @@
1
- import { withProfiling } from '../../../../../self-measurements';
2
1
  import { PerformanceObserverEntryTypes } from '../../const';
3
2
  import { EntriesBuffer } from '../buffer';
4
3
  let pe = null;
5
- const getObserver = withProfiling(function getObserver() {
4
+ function getObserver() {
6
5
  if (typeof PerformanceObserver !== 'function') {
7
6
  // Only instantiate the IntersectionObserver if it's supported
8
7
  return null;
@@ -10,7 +9,7 @@ const getObserver = withProfiling(function getObserver() {
10
9
  if (pe !== null) {
11
10
  return pe;
12
11
  }
13
- const performanceObserverCallback = withProfiling(function performanceObserverCallback(list) {
12
+ const performanceObserverCallback = list => {
14
13
  list.getEntries().forEach(entry => {
15
14
  if (entry.entryType === PerformanceObserverEntryTypes.LayoutShift) {
16
15
  EntriesBuffer[PerformanceObserverEntryTypes.LayoutShift].push(entry);
@@ -19,21 +18,21 @@ const getObserver = withProfiling(function getObserver() {
19
18
  EntriesBuffer[PerformanceObserverEntryTypes.LongTask].push(entry);
20
19
  }
21
20
  });
22
- });
21
+ };
23
22
  pe = new PerformanceObserver(performanceObserverCallback);
24
23
  return pe;
25
- });
26
- export const startLSObserver = withProfiling(function startLSObserver() {
24
+ }
25
+ export function startLSObserver() {
27
26
  var _getObserver;
28
27
  (_getObserver = getObserver()) === null || _getObserver === void 0 ? void 0 : _getObserver.observe({
29
28
  type: PerformanceObserverEntryTypes.LayoutShift,
30
29
  buffered: true
31
30
  });
32
- });
33
- export const startLTObserver = withProfiling(function startLTObserver() {
31
+ }
32
+ export function startLTObserver() {
34
33
  var _getObserver2;
35
34
  (_getObserver2 = getObserver()) === null || _getObserver2 === void 0 ? void 0 : _getObserver2.observe({
36
35
  type: PerformanceObserverEntryTypes.LongTask,
37
36
  buffered: true
38
37
  });
39
- });
38
+ }
@@ -1,7 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- var _CHRSummary;
3
2
  import { fg } from '@atlaskit/platform-feature-flags';
4
- import { withProfiling } from '../self-measurements';
5
3
  import { calculateTransferType, checkIfTimingsAvailable, DISK_KEY, getTypeOfRequest, MEMORY_KEY, NETWORK_KEY, round } from './utils';
6
4
  export class CHRSummary {
7
5
  constructor() {
@@ -17,7 +15,6 @@ export class CHRSummary {
17
15
  [NETWORK_KEY]: 0
18
16
  });
19
17
  _defineProperty(this, "sizeTotal", 0);
20
- this.add = withProfiling(this.add.bind(this));
21
18
  }
22
19
  add(asset) {
23
20
  const encodedSize = asset.encodedSize || 0;
@@ -30,29 +27,27 @@ export class CHRSummary {
30
27
  this.size[type] += encodedSize;
31
28
  this.sizeTotal += encodedSize;
32
29
  }
30
+ static makePayload(summary) {
31
+ const {
32
+ size,
33
+ bundlesCount,
34
+ sizeTotal
35
+ } = summary;
36
+ const cachedSize = size[MEMORY_KEY] + size[DISK_KEY];
37
+ const sizeRatio = round(cachedSize / summary.sizeTotal);
38
+ return {
39
+ size: sizeTotal,
40
+ chr: sizeRatio,
41
+ count: bundlesCount
42
+ };
43
+ }
33
44
  }
34
- _CHRSummary = CHRSummary;
35
- _defineProperty(CHRSummary, "makePayload", withProfiling(function makePayload(summary) {
36
- const {
37
- size,
38
- bundlesCount,
39
- sizeTotal
40
- } = summary;
41
- const cachedSize = size[MEMORY_KEY] + size[DISK_KEY];
42
- const sizeRatio = round(cachedSize / summary.sizeTotal);
43
- return {
44
- size: sizeTotal,
45
- chr: sizeRatio,
46
- count: bundlesCount
47
- };
48
- }));
49
45
  export class CHRReporter {
50
46
  constructor() {
51
47
  _defineProperty(this, "all", new CHRSummary());
52
48
  _defineProperty(this, "allAtlassian", new CHRSummary());
53
49
  _defineProperty(this, "preloaded", new CHRSummary());
54
50
  _defineProperty(this, "defaultAllowedTypes", ['js']);
55
- this.get = withProfiling(this.get.bind(this));
56
51
  }
57
52
  get(resourceTimings, assetsConfig, SSRDoneTime) {
58
53
  try {
@@ -1,11 +1,9 @@
1
- import { withProfiling } from '../self-measurements';
2
-
3
1
  /* Borrowed from https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/performance/browser-metrics/src/plugins/timings/resource.ts */
4
2
  export const cacheableTypes = ['script', 'link', 'other'];
5
3
  export const MEMORY_KEY = 'mem';
6
4
  export const DISK_KEY = 'disk';
7
5
  export const NETWORK_KEY = 'net';
8
- export const calculateTransferType = withProfiling(function calculateTransferType(name, type, duration, size) {
6
+ export function calculateTransferType(name, type, duration, size) {
9
7
  if (!cacheableTypes.includes(type) && !(type === 'other' && name.includes('.js'))) {
10
8
  return null;
11
9
  }
@@ -19,8 +17,8 @@ export const calculateTransferType = withProfiling(function calculateTransferTyp
19
17
  return null;
20
18
  }
21
19
  return NETWORK_KEY;
22
- });
23
- export const getTypeOfRequest = withProfiling(function getTypeOfRequest({
20
+ }
21
+ export function getTypeOfRequest({
24
22
  name,
25
23
  initiatorType: type
26
24
  }) {
@@ -57,16 +55,16 @@ export const getTypeOfRequest = withProfiling(function getTypeOfRequest({
57
55
  break;
58
56
  }
59
57
  return category;
60
- });
61
- export const checkIfTimingsAvailable = withProfiling(function checkIfTimingsAvailable(entry) {
58
+ }
59
+ export function checkIfTimingsAvailable(entry) {
62
60
  if (entry.decodedSize === 0 && entry.encodedSize === 0 && entry.requestStart === 0 && entry.responseStart === 0) {
63
61
  return false;
64
62
  }
65
63
  return true;
66
- });
67
- export const round = withProfiling(function round(n) {
64
+ }
65
+ export function round(n) {
68
66
  if (isNaN(n)) {
69
67
  return 0;
70
68
  }
71
69
  return Math.round(n * 10000) / 10000;
72
- });
70
+ }
@@ -1,14 +1,13 @@
1
1
  import { roundEpsilon } from '../round-number';
2
- import { withProfiling } from '../self-measurements';
3
2
  let config = null;
4
- export const configure = withProfiling(function configure(bundleEvalTimingConfiguration) {
3
+ export function configure(bundleEvalTimingConfiguration) {
5
4
  config = bundleEvalTimingConfiguration;
6
- });
7
- const getPerformanceObject = withProfiling(function getPerformanceObject() {
5
+ }
6
+ function getPerformanceObject() {
8
7
  var _window;
9
8
  return ((_window = window) !== null && _window !== void 0 ? _window : {}).performance;
10
- });
11
- export const getBundleEvalTimings = withProfiling(function getBundleEvalTimings(interactionStartTime) {
9
+ }
10
+ export function getBundleEvalTimings(interactionStartTime) {
12
11
  if (config == null) {
13
12
  return {};
14
13
  }
@@ -41,4 +40,4 @@ export const getBundleEvalTimings = withProfiling(function getBundleEvalTimings(
41
40
  return {};
42
41
  }
43
42
  return timings;
44
- });
43
+ }
@@ -1,5 +1,3 @@
1
- import { withProfiling } from '../self-measurements';
2
-
3
1
  /**
4
2
  * A random function that passes one in rate times.
5
3
  * E.g. coinflip(2) is the same as if you flipped a coin.
@@ -7,7 +5,7 @@ import { withProfiling } from '../self-measurements';
7
5
  * @param rate The change that it will pass (1 in <rate> times)
8
6
  * @returns bool, if it passes or not
9
7
  */
10
- const coinflip = withProfiling(function coinflip(rate) {
8
+ function coinflip(rate) {
11
9
  if (rate === 0) {
12
10
  return false;
13
11
  } else if (rate === 1) {
@@ -15,5 +13,5 @@ const coinflip = withProfiling(function coinflip(rate) {
15
13
  } else {
16
14
  return Math.random() * rate <= 1;
17
15
  }
18
- });
16
+ }
19
17
  export default coinflip;
@@ -1,16 +1,15 @@
1
- import { withProfiling } from '../self-measurements';
2
1
  let config;
3
2
 
4
3
  // Defensively typed, since this is directly user-editable
5
4
  // and they could delete empty members
6
5
 
7
- export const setUFOConfig = withProfiling(function setUFOConfig(newConfig) {
6
+ export function setUFOConfig(newConfig) {
8
7
  config = newConfig;
9
- });
10
- export const getConfig = withProfiling(function getConfig() {
8
+ }
9
+ export function getConfig() {
11
10
  return config;
12
- });
13
- export const getInteractionRate = withProfiling(function getInteractionRate(name, interactionKind) {
11
+ }
12
+ export function getInteractionRate(name, interactionKind) {
14
13
  try {
15
14
  if (!config) {
16
15
  return 0;
@@ -67,8 +66,8 @@ export const getInteractionRate = withProfiling(function getInteractionRate(name
67
66
  // Fallback
68
67
  return 0;
69
68
  }
70
- });
71
- export const getExperimentalInteractionRate = withProfiling(function getExperimentalInteractionRate(name, interactionType) {
69
+ }
70
+ export function getExperimentalInteractionRate(name, interactionType) {
72
71
  try {
73
72
  if (!config) {
74
73
  return 0;
@@ -89,8 +88,8 @@ export const getExperimentalInteractionRate = withProfiling(function getExperime
89
88
  } catch (e) {
90
89
  return 0;
91
90
  }
92
- });
93
- export const getPostInteractionRate = withProfiling(function getPostInteractionRate(name, interactionType) {
91
+ }
92
+ export function getPostInteractionRate(name, interactionType) {
94
93
  try {
95
94
  if (!config) {
96
95
  return 0;
@@ -111,8 +110,8 @@ export const getPostInteractionRate = withProfiling(function getPostInteractionR
111
110
  } catch (e) {
112
111
  return 0;
113
112
  }
114
- });
115
- export const getCapabilityRate = withProfiling(function getCapabilityRate(capability) {
113
+ }
114
+ export function getCapabilityRate(capability) {
116
115
  try {
117
116
  if (!config) {
118
117
  return 0;
@@ -130,9 +129,9 @@ export const getCapabilityRate = withProfiling(function getCapabilityRate(capabi
130
129
  } catch {
131
130
  return 0;
132
131
  }
133
- });
132
+ }
134
133
  const validTypingMethods = ['timeout', 'timeoutNoAlloc', 'mutationObserver'];
135
- export const getTypingPerformanceTracingMethod = withProfiling(function getTypingPerformanceTracingMethod() {
134
+ export function getTypingPerformanceTracingMethod() {
136
135
  const defaultMethod = 'timeout';
137
136
  try {
138
137
  if (!config) {
@@ -149,10 +148,10 @@ export const getTypingPerformanceTracingMethod = withProfiling(function getTypin
149
148
  } catch (e) {
150
149
  return defaultMethod;
151
150
  }
152
- });
151
+ }
153
152
 
154
153
  // Will ask UFO to wait for BM3 TTI for all events on this list
155
- export const getAwaitBM3TTIList = withProfiling(function getAwaitBM3TTIList() {
154
+ export function getAwaitBM3TTIList() {
156
155
  try {
157
156
  if (!config) {
158
157
  return [];
@@ -168,10 +167,10 @@ export const getAwaitBM3TTIList = withProfiling(function getAwaitBM3TTIList() {
168
167
  } catch (e) {
169
168
  return [];
170
169
  }
171
- });
170
+ }
172
171
 
173
172
  // Flag to remove ufo segments prefixes
174
- export const getRemovePageSegmentsUFOPrefixes = withProfiling(function getRemovePageSegmentsUFOPrefixes() {
173
+ export function getRemovePageSegmentsUFOPrefixes() {
175
174
  try {
176
175
  if (!config) {
177
176
  return false;
@@ -187,10 +186,10 @@ export const getRemovePageSegmentsUFOPrefixes = withProfiling(function getRemove
187
186
  } catch (e) {
188
187
  return false;
189
188
  }
190
- });
189
+ }
191
190
 
192
191
  // Flag to remove ufo segments prefixes
193
- export const getRemoveInteractionsUFOPrefixes = withProfiling(function getRemoveInteractionsUFOPrefixes() {
192
+ export function getRemoveInteractionsUFOPrefixes() {
194
193
  try {
195
194
  if (!config) {
196
195
  return false;
@@ -206,13 +205,13 @@ export const getRemoveInteractionsUFOPrefixes = withProfiling(function getRemove
206
205
  } catch (e) {
207
206
  return false;
208
207
  }
209
- });
208
+ }
210
209
 
211
210
  // Will ask UFO to override ufoName => experienceKey to the apdex key
212
211
  // This is to cover use cases where one rUFO route is split into multiple BM3 keys (1:N)
213
212
  // This workaround should only be used as last resource,
214
213
  // when we find router limitations preventing teams from splliting these routes
215
- export const getUfoNameOverrides = withProfiling(function getUfoNameOverrides() {
214
+ export function getUfoNameOverrides() {
216
215
  try {
217
216
  if (!config) {
218
217
  return undefined;
@@ -227,10 +226,10 @@ export const getUfoNameOverrides = withProfiling(function getUfoNameOverrides()
227
226
  } catch (e) {
228
227
  return undefined;
229
228
  }
230
- });
229
+ }
231
230
 
232
231
  // Contains the list of interactions that do not abort existing known interactions
233
- export const getDoNotAbortActivePressInteraction = withProfiling(function getDoNotAbortActivePressInteraction() {
232
+ export function getDoNotAbortActivePressInteraction() {
234
233
  try {
235
234
  if (!config) {
236
235
  return undefined;
@@ -242,10 +241,10 @@ export const getDoNotAbortActivePressInteraction = withProfiling(function getDoN
242
241
  } catch (e) {
243
242
  return undefined;
244
243
  }
245
- });
244
+ }
246
245
 
247
246
  // Contains the list of interactions that do not abort on transitions
248
- export const getDoNotAbortActivePressInteractionOnTransition = withProfiling(function getDoNotAbortActivePressInteractionOnTransition() {
247
+ export function getDoNotAbortActivePressInteractionOnTransition() {
249
248
  try {
250
249
  if (!config) {
251
250
  return undefined;
@@ -257,12 +256,12 @@ export const getDoNotAbortActivePressInteractionOnTransition = withProfiling(fun
257
256
  } catch (e) {
258
257
  return undefined;
259
258
  }
260
- });
261
- export const shouldHandleEditorLnv = withProfiling(function shouldHandleEditorLnv() {
259
+ }
260
+ export function shouldHandleEditorLnv() {
262
261
  try {
263
262
  var _config$enableEditorL, _config;
264
263
  return (_config$enableEditorL = (_config = config) === null || _config === void 0 ? void 0 : _config.enableEditorLnvHandler) !== null && _config$enableEditorL !== void 0 ? _config$enableEditorL : false;
265
264
  } catch (e) {
266
265
  return false;
267
266
  }
268
- });
267
+ }
@@ -1,21 +1,20 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { getPageVisibilityState } from '../hidden-timing';
3
- import { withProfiling } from '../self-measurements';
4
3
  import { VCObserver } from '../vc/vc-observer';
5
4
  const interactionBuffer = [];
6
- let bufferInteractionData = withProfiling(function bufferInteractionData(interactionId, data) {
5
+ let bufferInteractionData = (interactionId, data) => {
7
6
  interactionBuffer.push({
8
7
  interactionId,
9
8
  data
10
9
  });
11
- });
12
- const clearInteractionBuffer = withProfiling(function clearInteractionBuffer() {
10
+ };
11
+ function clearInteractionBuffer() {
13
12
  interactionBuffer.length = 0;
14
- });
15
- const appendInteractionData = withProfiling(function appendInteractionData(interactionId, data) {
13
+ }
14
+ function appendInteractionData(interactionId, data) {
16
15
  bufferInteractionData(interactionId, data);
17
- });
18
- export const installInteractionSink = withProfiling(function installInteractionSink(handler) {
16
+ }
17
+ export function installInteractionSink(handler) {
19
18
  for (const {
20
19
  interactionId,
21
20
  data
@@ -23,23 +22,21 @@ export const installInteractionSink = withProfiling(function installInteractionS
23
22
  handler(interactionId, data);
24
23
  }
25
24
  clearInteractionBuffer();
26
- bufferInteractionData = withProfiling(handler);
27
- });
28
- export const sinkExperimentalHandler = withProfiling(function sinkExperimentalHandler(sinkFn) {
25
+ bufferInteractionData = handler;
26
+ }
27
+ export function sinkExperimentalHandler(sinkFn) {
29
28
  installInteractionSink(sinkFn);
30
- });
31
- export const onExperimentalInteractionComplete = withProfiling(function onExperimentalInteractionComplete(interactionId, data, endTime = performance.now()) {
29
+ }
30
+ export function onExperimentalInteractionComplete(interactionId, data, endTime = performance.now()) {
32
31
  if (data.ufoName) {
33
32
  data.end = endTime;
34
33
  appendInteractionData(interactionId, data);
35
34
  clearInteractionBuffer();
36
35
  }
37
- });
36
+ }
38
37
  export class ExperimentalVCMetrics {
39
38
  constructor() {
40
39
  _defineProperty(this, "vcObserver", null);
41
- this.initialize = withProfiling(this.initialize.bind(this));
42
- this.start = withProfiling(this.start.bind(this));
43
40
  }
44
41
  initialize(options) {
45
42
  if (this.vcObserver === null) {
@@ -60,7 +57,7 @@ export class ExperimentalVCMetrics {
60
57
  }
61
58
  }
62
59
  export const experimentalVC = new ExperimentalVCMetrics();
63
- export const getExperimentalVCMetrics = withProfiling(async function getExperimentalVCMetrics(interaction) {
60
+ export async function getExperimentalVCMetrics(interaction) {
64
61
  if (experimentalVC.vcObserver) {
65
62
  var _interaction$apdex, _interaction$apdex$;
66
63
  const prefix = 'ufo-experimental';
@@ -86,4 +83,4 @@ export const getExperimentalVCMetrics = withProfiling(async function getExperime
86
83
  };
87
84
  }
88
85
  return null;
89
- });
86
+ }
@@ -1,11 +1,10 @@
1
- import { withProfiling } from '../../../self-measurements';
2
- export const sanitizeUfoName = withProfiling(function sanitizeUfoName(name) {
1
+ export function sanitizeUfoName(name) {
3
2
  return name.replace(/_/g, '-');
4
- });
5
- export const isSegmentLabel = withProfiling(function isSegmentLabel(obj) {
3
+ }
4
+ export function isSegmentLabel(obj) {
6
5
  return obj && typeof obj.name === 'string' && typeof obj.segmentId === 'string';
7
- });
8
- export const buildSegmentTree = withProfiling(function buildSegmentTree(labelStacks) {
6
+ }
7
+ export function buildSegmentTree(labelStacks) {
9
8
  const r = {
10
9
  n: 'segment-tree-root',
11
10
  c: {}
@@ -30,26 +29,26 @@ export const buildSegmentTree = withProfiling(function buildSegmentTree(labelSta
30
29
  return {
31
30
  r
32
31
  };
33
- });
34
- export const stringifyLabelStackFully = withProfiling(function stringifyLabelStackFully(labelStack) {
32
+ }
33
+ export function stringifyLabelStackFully(labelStack) {
35
34
  return labelStack.map(l => {
36
35
  if (isSegmentLabel(l)) {
37
36
  return `${l.name}:${l.segmentId}`;
38
37
  }
39
38
  return l.name;
40
39
  }).join('/');
41
- });
42
- const getLabelStackReference = withProfiling(function getLabelStackReference(labelStack) {
40
+ }
41
+ function getLabelStackReference(labelStack) {
43
42
  return labelStack.map(l => isSegmentLabel(l) ? l.segmentId : l.name).join('/');
44
- });
45
- export const labelStackStartWith = withProfiling(function labelStackStartWith(labelStack, startWith) {
43
+ }
44
+ export function labelStackStartWith(labelStack, startWith) {
46
45
  return stringifyLabelStackFully(labelStack).startsWith(stringifyLabelStackFully(startWith));
47
- });
48
- export const optimizeLabelStack = withProfiling(function optimizeLabelStack(labelStack, reactUFOVersion) {
46
+ }
47
+ export function optimizeLabelStack(labelStack, reactUFOVersion) {
49
48
  return reactUFOVersion === '2.0.0' ? getLabelStackReference(labelStack) : labelStack.map(ls => ({
50
49
  n: ls.name,
51
50
  ...(ls.segmentId ? {
52
51
  s: ls.segmentId
53
52
  } : {})
54
53
  }));
55
- });
54
+ }