@atlaskit/react-ufo 3.6.5 → 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 +16 -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 +24 -37
  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 +23 -36
  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 +23 -36
  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 -4
  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
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { markProfilingEnd, markProfilingStart, withProfiling } from '../../self-measurements';
3
2
  import EntriesTimeline from './entries-timeline';
4
3
  import getElementName from './get-element-name';
5
4
  import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
@@ -17,7 +16,6 @@ export default class VCObserverNew {
17
16
  var _config$selectorConfi;
18
17
  _defineProperty(this, "viewportObserver", null);
19
18
  _defineProperty(this, "windowEventObserver", null);
20
- const operationTimer = markProfilingStart('VCObserverNew constructor');
21
19
  this.entriesTimeline = new EntriesTimeline();
22
20
  this.selectorConfig = (_config$selectorConfi = config.selectorConfig) !== null && _config$selectorConfi !== void 0 ? _config$selectorConfi : DEFAULT_SELECTOR_CONFIG;
23
21
  this.viewportObserver = new ViewportObserver({
@@ -63,13 +61,6 @@ export default class VCObserverNew {
63
61
  });
64
62
  }
65
63
  });
66
- this.start = withProfiling(this.start.bind(this), ['vc']);
67
- this.stop = withProfiling(this.stop.bind(this), ['vc']);
68
- this.getVCResult = withProfiling(this.getVCResult.bind(this), ['vc']);
69
- this.getElementName = withProfiling(this.getElementName.bind(this), ['vc']);
70
- markProfilingEnd(operationTimer, {
71
- tags: ['vc']
72
- });
73
64
  }
74
65
  start({
75
66
  startTime
@@ -1,11 +1,9 @@
1
- import { withProfiling } from '../../../self-measurements';
2
1
  import calculateTTVCPercentiles from './percentile-calc';
3
2
  import getViewportHeight from './utils/get-viewport-height';
4
3
  import getViewportWidth from './utils/get-viewport-width';
5
4
  export default class AbstractVCCalculatorBase {
6
5
  constructor(revisionNo) {
7
6
  this.revisionNo = revisionNo;
8
- this.calculate = withProfiling(this.calculate.bind(this), ['vc']);
9
7
  }
10
8
  async calculate({
11
9
  startTime,
@@ -1,4 +1,3 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
1
  import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
3
2
  import isViewportEntryData from '../utils/is-viewport-entry-data';
4
3
  const ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
@@ -12,8 +11,6 @@ export const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-ta
12
11
  export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
13
12
  constructor() {
14
13
  super(REVISION_NO);
15
- this.isEntryIncluded = withProfiling(this.isEntryIncluded.bind(this), ['vc']);
16
- this.isVCClean = withProfiling(this.isVCClean.bind(this), ['vc']);
17
14
  }
18
15
  isEntryIncluded(entry) {
19
16
  if (!CONSIDERED_ENTRY_TYPE.includes(entry.type)) {
@@ -1,4 +1,3 @@
1
- import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
2
1
  import taskYield from '../../utils/task-yield';
3
2
 
4
3
  // 24-bit color value
@@ -26,7 +25,6 @@ export class ViewportCanvas {
26
25
  * @throws {Error} If canvas context cannot be obtained
27
26
  */
28
27
  constructor(viewport, scaleFactor = 1) {
29
- const operationTimer = markProfilingStart('ViewportCanvas constructor');
30
28
  this.scaleFactor = scaleFactor;
31
29
  this.colorCounter = 1;
32
30
  this.colorTimeMap = new Map();
@@ -56,14 +54,6 @@ export class ViewportCanvas {
56
54
  this.ctx = ctx;
57
55
  this.ctx.globalCompositeOperation = 'source-over';
58
56
  this.clear();
59
- this.getScaledDimensions = withProfiling(this.getScaledDimensions.bind(this), ['vc']);
60
- this.clear = withProfiling(this.clear.bind(this), ['vc']);
61
- this.generateColor = withProfiling(this.generateColor.bind(this), ['vc']);
62
- this.drawRect = withProfiling(this.drawRect.bind(this), ['vc']);
63
- this.getPixelCounts = withProfiling(this.getPixelCounts.bind(this), ['vc']);
64
- markProfilingEnd(operationTimer, {
65
- tags: ['vc']
66
- });
67
57
  }
68
58
  getScaledDimensions() {
69
59
  return {
@@ -158,7 +148,7 @@ export class ViewportCanvas {
158
148
  * @param number - The input number to be split into RGB components.
159
149
  * @returns The RGB color string in the format "rgb(r, g, b)".
160
150
  */
161
- export const getRGBComponents = withProfiling(function getRGBComponents(n) {
151
+ export function getRGBComponents(n) {
162
152
  // Ensure the input is within the valid range for a 24-bit color
163
153
  if (n < 0 || n > 0xffffff) {
164
154
  throw new Error('Input number must be between 0 and 16777215 (inclusive).');
@@ -173,7 +163,7 @@ export const getRGBComponents = withProfiling(function getRGBComponents(n) {
173
163
  // Extract red component (bits 16-23)
174
164
  const red = n >> 16 & 0xff;
175
165
  return `rgb(${red}, ${green}, ${blue})`;
176
- }, ['vc']);
166
+ }
177
167
 
178
168
  /**
179
169
  * Calculates the number of pixels drawn for each color in the image data.
@@ -182,7 +172,7 @@ export const getRGBComponents = withProfiling(function getRGBComponents(n) {
182
172
  * @param arraySize - The amount of timestamps that were drawn in the viewport
183
173
  * @returns A Map containing color to pixel count mappings.
184
174
  */
185
- export const calculateDrawnPixelsRaw = withProfiling(async function calculateDrawnPixelsRaw(imageData, scaleFactor, arraySize) {
175
+ export async function calculateDrawnPixelsRaw(imageData, scaleFactor, arraySize) {
186
176
  const data = imageData.data;
187
177
  const arr = new Uint32Array(arraySize);
188
178
  for (let i = 0; i < data.length; i += 4) {
@@ -202,4 +192,4 @@ export const calculateDrawnPixelsRaw = withProfiling(async function calculateDra
202
192
  }
203
193
  }
204
194
  return arr;
205
- }, ['vc']);
195
+ }
@@ -1,7 +1,6 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
- import { withProfiling } from '../../../../../self-measurements';
3
2
  import { ViewportCanvas } from './canvas-pixel';
4
- const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles({
3
+ async function calculateTTVCPercentiles({
5
4
  viewport,
6
5
  orderedEntries,
7
6
  percentiles,
@@ -27,9 +26,9 @@ const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPerce
27
26
  const canvasDimenstions = canvas.getScaledDimensions();
28
27
  const totalPixels = canvasDimenstions.width * canvasDimenstions.height;
29
28
  return calculatePercentiles(timePixelCounts, elementMap, percentiles, totalPixels, startTime);
30
- }, ['vc']);
29
+ }
31
30
  export default calculateTTVCPercentiles;
32
- export const calculatePercentiles = withProfiling(function calculatePercentiles(timePixelCounts, elementMap, unorderedPercentiles, totalPixels, startTime) {
31
+ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPercentiles, totalPixels, startTime) {
33
32
  const results = {};
34
33
  let cumulativePixels = 0;
35
34
  const percentiles = unorderedPercentiles.sort((a, b) => a - b);
@@ -71,4 +70,4 @@ export const calculatePercentiles = withProfiling(function calculatePercentiles(
71
70
  previousResult = results[`${percentile}`];
72
71
  }
73
72
  return results;
74
- }, ['vc']);
73
+ }
@@ -1,28 +1,27 @@
1
- import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
2
1
  import isViewportEntryData from '../../utils/is-viewport-entry-data';
3
2
  import taskYield from '../../utils/task-yield';
4
3
  const MAX_HEATMAP_SIZE = 1000;
5
- const createEmptyHeatmapEntry = withProfiling(function createEmptyHeatmapEntry() {
4
+ function createEmptyHeatmapEntry() {
6
5
  return {
7
6
  head: null,
8
7
  previousEntries: []
9
8
  };
10
- }, ['vc']);
11
- const createEmptyMap = withProfiling(function createEmptyMap(heatmapWidth, heatmapHeight) {
9
+ }
10
+ function createEmptyMap(heatmapWidth, heatmapHeight) {
12
11
  return Array.from({
13
12
  length: heatmapHeight
14
13
  }).map(() => Array.from({
15
14
  length: heatmapWidth
16
15
  }).map(createEmptyHeatmapEntry));
17
- }, ['vc']);
18
- const isRectInside = withProfiling(function isRectInside(a, b) {
16
+ }
17
+ function isRectInside(a, b) {
19
18
  if (!a || !b) {
20
19
  return false;
21
20
  }
22
21
 
23
22
  // Check if all corners of rectangle a are within the bounds of rectangle b
24
23
  return a.left >= b.left && a.right <= b.right && a.top >= b.top && a.bottom <= b.bottom;
25
- }, ['vc']);
24
+ }
26
25
  export default class Heatmap {
27
26
  /**
28
27
  * Heatmap Width
@@ -40,8 +39,6 @@ export default class Heatmap {
40
39
  viewport,
41
40
  heatmapSize
42
41
  }) {
43
- const operationTimer = markProfilingStart('Heatmap constructor');
44
-
45
42
  // TODO timeOrigin? do we need? for SSR??
46
43
  this.viewport = viewport;
47
44
  const safeSize = Math.min(heatmapSize, MAX_HEATMAP_SIZE);
@@ -68,15 +65,6 @@ export default class Heatmap {
68
65
  this.scaleY = this.height / viewport.height;
69
66
  this.heatmapAreaSize = this.width * this.height;
70
67
  this.map = createEmptyMap(this.width, this.height);
71
- this.getHeatmap = withProfiling(this.getHeatmap.bind(this), ['vc']);
72
- this.getCell = withProfiling(this.getCell.bind(this), ['vc']);
73
- this.mapDOMRectToHeatmap = withProfiling(this.mapDOMRectToHeatmap.bind(this), ['vc']);
74
- this.getRatio = withProfiling(this.getRatio.bind(this), ['vc']);
75
- this.applyEntriesToHeatmap = withProfiling(this.applyEntriesToHeatmap.bind(this), ['vc']);
76
- this.getVCPercentMetrics = withProfiling(this.getVCPercentMetrics.bind(this), ['vc']);
77
- markProfilingEnd(operationTimer, {
78
- tags: ['vc']
79
- });
80
68
  }
81
69
  getHeatmap() {
82
70
  return this.map;
@@ -1,28 +1,27 @@
1
- import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
2
1
  import isViewportEntryData from '../../utils/is-viewport-entry-data';
3
2
  import taskYield from '../../utils/task-yield';
4
3
  const MAX_HEATMAP_SIZE = 1000;
5
- const createEmptyHeatmapEntry = withProfiling(function createEmptyHeatmapEntry() {
4
+ function createEmptyHeatmapEntry() {
6
5
  return {
7
6
  head: null,
8
7
  previousEntries: []
9
8
  };
10
- }, ['vc']);
11
- const createEmptyMap = withProfiling(function createEmptyMap(heatmapWidth, heatmapHeight) {
9
+ }
10
+ function createEmptyMap(heatmapWidth, heatmapHeight) {
12
11
  return Array.from({
13
12
  length: heatmapHeight
14
13
  }).map(() => Array.from({
15
14
  length: heatmapWidth
16
15
  }).map(createEmptyHeatmapEntry));
17
- }, ['vc']);
18
- const isRectInside = withProfiling(function isRectInside(a, b) {
16
+ }
17
+ function isRectInside(a, b) {
19
18
  if (!a || !b) {
20
19
  return false;
21
20
  }
22
21
 
23
22
  // Check if all corners of rectangle a are within the bounds of rectangle b
24
23
  return a.left >= b.left && a.right <= b.right && a.top >= b.top && a.bottom <= b.bottom;
25
- }, ['vc']);
24
+ }
26
25
  class Heatmap {
27
26
  /**
28
27
  * Heatmap Width
@@ -40,8 +39,6 @@ class Heatmap {
40
39
  viewport,
41
40
  heatmapSize
42
41
  }) {
43
- const operationTimer = markProfilingStart('Heatmap constructor');
44
-
45
42
  // TODO timeOrigin? do we need? for SSR??
46
43
  this.viewport = viewport;
47
44
  const safeSize = Math.min(heatmapSize, MAX_HEATMAP_SIZE);
@@ -68,15 +65,6 @@ class Heatmap {
68
65
  this.scaleY = this.height / viewport.height;
69
66
  this.heatmapAreaSize = this.width * this.height;
70
67
  this.map = createEmptyMap(this.width, this.height);
71
- this.getHeatmap = withProfiling(this.getHeatmap.bind(this), ['vc']);
72
- this.getCell = withProfiling(this.getCell.bind(this), ['vc']);
73
- this.mapDOMRectToHeatmap = withProfiling(this.mapDOMRectToHeatmap.bind(this), ['vc']);
74
- this.getRatio = withProfiling(this.getRatio.bind(this), ['vc']);
75
- this.applyEntriesToHeatmap = withProfiling(this.applyEntriesToHeatmap.bind(this), ['vc']);
76
- this.getVCPercentMetrics = withProfiling(this.getVCPercentMetrics.bind(this), ['vc']);
77
- markProfilingEnd(operationTimer, {
78
- tags: ['vc']
79
- });
80
68
  }
81
69
  getHeatmap() {
82
70
  return this.map;
@@ -258,7 +246,7 @@ class Heatmap {
258
246
  return result;
259
247
  }
260
248
  }
261
- const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles({
249
+ async function calculateTTVCPercentiles({
262
250
  orderedEntries,
263
251
  viewport,
264
252
  percentiles,
@@ -271,5 +259,5 @@ const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPerce
271
259
  await heatmap.applyEntriesToHeatmap(orderedEntries);
272
260
  const vcDetails = await heatmap.getVCPercentMetrics(percentiles, startTime);
273
261
  return vcDetails;
274
- }, ['vc']);
262
+ }
275
263
  export default calculateTTVCPercentiles;
@@ -1,8 +1,7 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
1
  import calcUsingCanvas from './canvas-heatmap';
3
2
  import caclUsingOldHeatmap from './heatmap';
4
3
  import calcUsingRectSweepingLine from './rect-sweeping-line';
5
- const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles(arg) {
4
+ async function calculateTTVCPercentiles(arg) {
6
5
  const algo = 'canvas_heatmap';
7
6
  if (algo === 'canvas_heatmap') {
8
7
  const vcDetails = await calcUsingCanvas(arg);
@@ -17,5 +16,5 @@ const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPerce
17
16
  return vcDetails;
18
17
  }
19
18
  throw new Error('unexpected Error algo not chosen correctly');
20
- }, ['vc']);
19
+ }
21
20
  export default calculateTTVCPercentiles;
@@ -1,4 +1,3 @@
1
- import { withProfiling } from '../../../../../self-measurements';
2
1
  /**
3
2
  * Calculate the union areas of all rectangles using Sweep Line Algorithm
4
3
  *
@@ -9,7 +8,7 @@ import { withProfiling } from '../../../../../self-measurements';
9
8
  * @param rectangles
10
9
  * @returns
11
10
  */
12
- const calculateUnionArea = withProfiling(function calculateUnionArea(rectangles) {
11
+ function calculateUnionArea(rectangles) {
13
12
  // Step 1: Create sweep line events
14
13
  const events = createSweepLineEvents(rectangles);
15
14
 
@@ -28,9 +27,9 @@ const calculateUnionArea = withProfiling(function calculateUnionArea(rectangles)
28
27
  updateActiveIntervals(activeIntervals, event);
29
28
  }
30
29
  return totalArea;
31
- }, ['vc']);
30
+ }
32
31
  export default calculateUnionArea;
33
- const createSweepLineEvents = withProfiling(function createSweepLineEvents(rectangles) {
32
+ function createSweepLineEvents(rectangles) {
34
33
  const events = [];
35
34
  for (const rect of rectangles) {
36
35
  // Create start and end events for each rectangle
@@ -49,8 +48,8 @@ const createSweepLineEvents = withProfiling(function createSweepLineEvents(recta
49
48
  }
50
49
  // Sort events by x-coordinate (and type as tiebreaker)
51
50
  return events.sort((a, b) => a.x === b.x ? a.type === 'end' ? 1 : -1 : a.x - b.x);
52
- }, ['vc']);
53
- const calculateActiveHeight = withProfiling(function calculateActiveHeight(intervals) {
51
+ }
52
+ function calculateActiveHeight(intervals) {
54
53
  if (intervals.size === 0) {
55
54
  return 0;
56
55
  }
@@ -84,8 +83,8 @@ const calculateActiveHeight = withProfiling(function calculateActiveHeight(inter
84
83
  }
85
84
  }
86
85
  return totalHeight;
87
- }, ['vc']);
88
- const updateActiveIntervals = withProfiling(function updateActiveIntervals(intervals, event) {
86
+ }
87
+ function updateActiveIntervals(intervals, event) {
89
88
  const key = `${event.top},${event.bottom}`;
90
89
  if (event.type === 'start') {
91
90
  intervals.set(key, (intervals.get(key) || 0) + 1);
@@ -97,4 +96,4 @@ const updateActiveIntervals = withProfiling(function updateActiveIntervals(inter
97
96
  intervals.delete(key);
98
97
  }
99
98
  }
100
- }, ['vc']);
99
+ }
@@ -1,8 +1,7 @@
1
- import { withProfiling } from '../../../../../self-measurements';
2
1
  import isViewportEntryData from '../../utils/is-viewport-entry-data';
3
2
  import taskYield from '../../utils/task-yield';
4
3
  import calculateUnionArea from './calc-union-area';
5
- const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles({
4
+ async function calculateTTVCPercentiles({
6
5
  orderedEntries,
7
6
  viewport,
8
7
  percentiles,
@@ -57,5 +56,5 @@ const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPerce
57
56
  }
58
57
  }
59
58
  return checkpoints;
60
- }, ['vc']);
59
+ }
61
60
  export default calculateTTVCPercentiles;
@@ -1,5 +1,4 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
- const getViewportHeight = withProfiling(function getViewportHeight(document = window.document) {
1
+ function getViewportHeight(document = window.document) {
3
2
  let documentHeight;
4
3
  try {
5
4
  documentHeight = document.documentElement.clientHeight || 0;
@@ -7,5 +6,5 @@ const getViewportHeight = withProfiling(function getViewportHeight(document = wi
7
6
  documentHeight = 0;
8
7
  }
9
8
  return Math.max(documentHeight, window.innerHeight || 0);
10
- }, ['vc']);
9
+ }
11
10
  export default getViewportHeight;
@@ -1,5 +1,4 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
- const getViewportWidth = withProfiling(function getViewportWidth(document = window.document) {
1
+ function getViewportWidth(document = window.document) {
3
2
  let documentWidth;
4
3
  try {
5
4
  documentWidth = document.documentElement.clientWidth || 0;
@@ -7,5 +6,5 @@ const getViewportWidth = withProfiling(function getViewportWidth(document = wind
7
6
  documentWidth = 0;
8
7
  }
9
8
  return Math.max(documentWidth, window.innerWidth || 0);
10
- }, ['vc']);
9
+ }
11
10
  export default getViewportWidth;
@@ -1,5 +1,4 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
- const isViewportEntryData = withProfiling(function isViewportEntryData(data) {
1
+ function isViewportEntryData(data) {
3
2
  if (data) {
4
3
  const hasElementName = typeof data.elementName === 'string';
5
4
  const hasRect = typeof data.rect !== 'undefined';
@@ -8,5 +7,5 @@ const isViewportEntryData = withProfiling(function isViewportEntryData(data) {
8
7
  }
9
8
  }
10
9
  return false;
11
- }, ['vc']);
10
+ }
12
11
  export default isViewportEntryData;
@@ -1,7 +1,5 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
-
3
1
  // See https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API
4
- const taskYield = withProfiling(async function taskYield() {
2
+ async function taskYield() {
5
3
  // This is using globalThis to allow the yield task to be used outside of a browser env
6
4
  if ('scheduler' in globalThis &&
7
5
  // @ts-ignore
@@ -16,5 +14,5 @@ const taskYield = withProfiling(async function taskYield() {
16
14
  });
17
15
  setTimeout(resolve, 0);
18
16
  await p;
19
- }, ['vc']);
17
+ }
20
18
  export default taskYield;
@@ -1,10 +1,9 @@
1
- import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
2
1
  import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
3
2
  import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
4
3
  import { createIntersectionObserver } from './intersection-observer';
5
4
  import createMutationObserver from './mutation-observer';
6
5
  import createPerformanceObserver from './performance-observer';
7
- const isElementVisible = withProfiling(function isElementVisible(element) {
6
+ function isElementVisible(element) {
8
7
  if (!(element instanceof HTMLElement)) {
9
8
  return true;
10
9
  }
@@ -20,25 +19,23 @@ const isElementVisible = withProfiling(function isElementVisible(element) {
20
19
  // there is no support for checkVisibility
21
20
  return true;
22
21
  }
23
- }, ['vc']);
24
- const sameRectSize = withProfiling(function sameRectSize(a, b) {
22
+ }
23
+ function sameRectSize(a, b) {
25
24
  if (!a || !b) {
26
25
  return false;
27
26
  }
28
27
  return a.width === b.width && a.height === b.height;
29
- }, ['vc']);
30
- const sameRectDimensions = withProfiling(function sameRectDimensions(a, b) {
28
+ }
29
+ function sameRectDimensions(a, b) {
31
30
  if (!a || !b) {
32
31
  return false;
33
32
  }
34
33
  return a.width === b.width && a.height === b.height && a.x === b.x && a.y === b.y;
35
- }, ['vc']);
34
+ }
36
35
  export default class ViewportObserver {
37
36
  constructor({
38
- onChange: _onChange
37
+ onChange: onChange
39
38
  }) {
40
- const onChange = withProfiling(_onChange, ['vc']);
41
- const operationTimer = markProfilingStart('ViewportObserver constructor');
42
39
  this.mapVisibleNodeRects = new WeakMap();
43
40
  this.intersectionObserver = createIntersectionObserver({
44
41
  onEntry: ({
@@ -167,11 +164,6 @@ export default class ViewportObserver {
167
164
  }
168
165
  }
169
166
  });
170
- this.start = withProfiling(this.start.bind(this), ['vc']);
171
- this.stop = withProfiling(this.stop.bind(this), ['vc']);
172
- markProfilingEnd(operationTimer, {
173
- tags: ['vc']
174
- });
175
167
  }
176
168
  start() {
177
169
  var _this$mutationObserve, _this$performanceObse;
@@ -1,15 +1,15 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
- const isValidEntry = withProfiling(function isValidEntry(entry) {
1
+ function isValidEntry(entry) {
3
2
  return entry.isIntersecting && entry.intersectionRect.width > 0 && entry.intersectionRect.height > 0;
4
- }, ['vc']);
5
- export function createIntersectionObserver(args) {
3
+ }
4
+ export function createIntersectionObserver({
5
+ onEntry,
6
+ onObserved
7
+ }) {
6
8
  if (!window || typeof window.IntersectionObserver !== 'function') {
7
9
  return null;
8
10
  }
9
- const onEntry = withProfiling(args.onEntry, ['vc']);
10
- const onObserved = typeof args.onObserved === 'function' ? withProfiling(args.onObserved, ['vc']) : undefined;
11
11
  const callbacksPerElement = new WeakMap();
12
- const intersectionObserverCallback = withProfiling(function intersectionObserverCallback(entries) {
12
+ const intersectionObserverCallback = entries => {
13
13
  const validEntries = [];
14
14
  const startTime = performance.now();
15
15
  entries.forEach(entry => {
@@ -51,7 +51,7 @@ export function createIntersectionObserver(args) {
51
51
  time: startTime,
52
52
  elements: validEntries
53
53
  });
54
- });
54
+ };
55
55
  const observer = new IntersectionObserver(intersectionObserverCallback);
56
56
  return {
57
57
  disconnect: () => {
@@ -1,12 +1,12 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
- const createMutationObserver = withProfiling(function createMutationObserver(props) {
1
+ function createMutationObserver({
2
+ onAttributeMutation,
3
+ onChildListMutation,
4
+ onMutationFinished
5
+ }) {
3
6
  if (!window || typeof window.IntersectionObserver !== 'function') {
4
7
  return null;
5
8
  }
6
- const onAttributeMutation = withProfiling(props.onAttributeMutation, ['vc']);
7
- const onChildListMutation = withProfiling(props.onChildListMutation, ['vc']);
8
- const onMutationFinished = typeof props.onMutationFinished === 'function' ? withProfiling(props.onMutationFinished, ['vc']) : undefined;
9
- const mutationObserverCallback = withProfiling(function mutationObserverCallback(mutations) {
9
+ const mutationObserverCallback = mutations => {
10
10
  const addedNodes = [];
11
11
  const removedNodes = [];
12
12
  const targets = [];
@@ -17,13 +17,13 @@ const createMutationObserver = withProfiling(function createMutationObserver(pro
17
17
  if (mut.type === 'attributes') {
18
18
  var _mut$oldValue;
19
19
  /*
20
- "MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
21
- I think it might have been something along the lines that for consistency every setAttribute call should create a record.
22
- Conceptually there is after all a mutation: there is an old value replaced with a new one,
23
- and whether or not they are the same doesn't really matter.
24
- And Custom elements should work the same way as MutationObserver."
25
- https://github.com/whatwg/dom/issues/520#issuecomment-336574796
26
- */
20
+ "MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
21
+ I think it might have been something along the lines that for consistency every setAttribute call should create a record.
22
+ Conceptually there is after all a mutation: there is an old value replaced with a new one,
23
+ and whether or not they are the same doesn't really matter.
24
+ And Custom elements should work the same way as MutationObserver."
25
+ https://github.com/whatwg/dom/issues/520#issuecomment-336574796
26
+ */
27
27
  const oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
28
28
  const newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
29
29
  if (oldValue !== newValue) {
@@ -56,8 +56,8 @@ const createMutationObserver = withProfiling(function createMutationObserver(pro
56
56
  onMutationFinished === null || onMutationFinished === void 0 ? void 0 : onMutationFinished({
57
57
  targets
58
58
  });
59
- });
59
+ };
60
60
  const observer = new MutationObserver(mutationObserverCallback);
61
61
  return observer;
62
- }, ['vc']);
62
+ }
63
63
  export default createMutationObserver;
@@ -1,7 +1,5 @@
1
- import { withProfiling } from '../../../../self-measurements';
2
-
3
1
  // The LayoutShiftAttribution API is returning the numbers on physical dimension
4
- export const convertPhysicalToLogicalResolution = withProfiling(function convertPhysicalToLogicalResolution(rect) {
2
+ export function convertPhysicalToLogicalResolution(rect) {
5
3
  if (typeof window.devicePixelRatio !== 'number') {
6
4
  return rect;
7
5
  }
@@ -11,13 +9,14 @@ export const convertPhysicalToLogicalResolution = withProfiling(function convert
11
9
 
12
10
  // eslint-disable-next-line compat/compat
13
11
  return new DOMRect(rect.x / window.devicePixelRatio, rect.y / window.devicePixelRatio, rect.width / window.devicePixelRatio, rect.height / window.devicePixelRatio);
14
- }, ['vc']);
15
- const createPerformanceObserver = withProfiling(function createPerformanceObserver(args) {
12
+ }
13
+ function createPerformanceObserver({
14
+ onLayoutShift
15
+ }) {
16
16
  if (!window || typeof window.PerformanceObserver !== 'function') {
17
17
  return null;
18
18
  }
19
- const onLayoutShift = withProfiling(args.onLayoutShift, ['vc']);
20
- const performanceObserverCallback = withProfiling(function performanceObserverCallback(entries) {
19
+ const performanceObserverCallback = entries => {
21
20
  for (const entry of entries.getEntries()) {
22
21
  if (entry.entryType === 'layout-shift') {
23
22
  // Ignored via go/ees005
@@ -36,8 +35,8 @@ const createPerformanceObserver = withProfiling(function createPerformanceObserv
36
35
  });
37
36
  }
38
37
  }
39
- }, ['vc']);
38
+ };
40
39
  const observer = new PerformanceObserver(performanceObserverCallback);
41
40
  return observer;
42
- }, ['vc']);
41
+ }
43
42
  export default createPerformanceObserver;
@@ -1,15 +1,9 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { bind } from 'bind-event-listener';
3
- import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
4
3
  export default class WindowEventObserver {
5
4
  constructor(opts) {
6
5
  _defineProperty(this, "unbindFns", []);
7
- const operationTimer = markProfilingStart('WindowEventObserver constructor');
8
- this.onEvent = withProfiling(opts.onEvent, ['vc']);
9
- this.bindEvent = withProfiling(this.bindEvent.bind(this), ['vc']);
10
- this.start = withProfiling(this.start.bind(this), ['vc']);
11
- this.stop = withProfiling(this.stop.bind(this), ['vc']);
12
- markProfilingEnd(operationTimer);
6
+ this.onEvent = opts.onEvent;
13
7
  }
14
8
  bindEvent(type) {
15
9
  const unbindCallback = bind(window, {
@@ -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
  var cacheableTypes = ['script', 'link'];
4
3
  var CACHE_NETWORK = 'network';
5
4
  var CACHE_MEMORY = 'memory';
6
5
  var CACHE_DISK = 'disk';
7
- var 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 @@ var calculateTransferType = withProfiling(function calculateTransferType(type, d
18
17
  return null;
19
18
  }
20
19
  return CACHE_NETWORK;
21
- });
22
- export var getCacheHitRatio = withProfiling(function getCacheHitRatio(_ref) {
20
+ }
21
+ export function getCacheHitRatio(_ref) {
23
22
  var start = _ref.start;
24
23
  var fromCache = 0;
25
24
  var preloadFromCache = 0;
@@ -61,4 +60,4 @@ export var getCacheHitRatio = withProfiling(function getCacheHitRatio(_ref) {
61
60
  } catch (e) {
62
61
  return {};
63
62
  }
64
- });
63
+ }