@atlaskit/react-ufo 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (486) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +5 -0
  3. package/additional-payload/package.json +15 -0
  4. package/bundle-eval-timing/package.json +15 -0
  5. package/coinflip/package.json +15 -0
  6. package/common/package.json +5 -5
  7. package/config/package.json +15 -0
  8. package/create-payload/package.json +15 -0
  9. package/create-post-interaction-log-payload/package.json +15 -0
  10. package/custom-data/package.json +15 -0
  11. package/custom-mark/package.json +15 -0
  12. package/custom-spans/package.json +15 -0
  13. package/custom-timings/package.json +15 -0
  14. package/dist/cjs/additional-payload/index.js +25 -0
  15. package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +69 -0
  16. package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +53 -0
  17. package/dist/cjs/additional-payload/utils/lighthouse-metrics/const.js +10 -0
  18. package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +29 -0
  19. package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +25 -0
  20. package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +38 -0
  21. package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +37 -0
  22. package/dist/cjs/bundle-eval-timing/index.js +48 -0
  23. package/dist/cjs/coinflip/index.js +22 -0
  24. package/dist/cjs/common/common/types.js +5 -0
  25. package/dist/cjs/common/constants.js +7 -0
  26. package/dist/cjs/common/index.js +1 -0
  27. package/dist/cjs/common/vc/types.js +11 -0
  28. package/dist/cjs/config/index.js +222 -0
  29. package/dist/cjs/create-payload/common/types.js +1 -0
  30. package/dist/cjs/create-payload/common/utils/index.js +15 -0
  31. package/dist/cjs/create-payload/index.js +784 -0
  32. package/dist/cjs/create-post-interaction-log-payload/index.js +207 -0
  33. package/dist/cjs/custom-data/index.js +31 -0
  34. package/dist/cjs/custom-data/types.js +5 -0
  35. package/dist/cjs/custom-mark/index.js +45 -0
  36. package/dist/cjs/custom-spans/index.js +14 -0
  37. package/dist/cjs/custom-timings/index.js +65 -0
  38. package/dist/cjs/experience-trace-id-context/index.js +40 -0
  39. package/dist/cjs/experience-trace-id-context/types.js +1 -0
  40. package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +12 -0
  41. package/dist/cjs/feature-flags-accessed/common/constants.js +7 -0
  42. package/dist/cjs/feature-flags-accessed/common/types.js +5 -0
  43. package/dist/cjs/feature-flags-accessed/common/utils/index.js +38 -0
  44. package/dist/cjs/feature-flags-accessed/index.js +32 -0
  45. package/dist/cjs/generate-id/index.js +12 -0
  46. package/dist/cjs/global-error-handler/index.js +74 -0
  47. package/dist/cjs/hidden-timing/index.js +94 -0
  48. package/dist/cjs/initial-page-load-extra-timing/index.js +49 -0
  49. package/dist/cjs/interaction-context/index.js +14 -0
  50. package/dist/cjs/interaction-id-context/index.js +27 -0
  51. package/dist/cjs/interaction-metrics/common/constants.js +8 -0
  52. package/dist/cjs/interaction-metrics/index.js +815 -4
  53. package/dist/cjs/interaction-metrics/post-interaction-log.js +190 -0
  54. package/dist/cjs/interaction-metrics-init/index.js +89 -0
  55. package/dist/cjs/label/UFOLabel.js +45 -0
  56. package/dist/cjs/label/index.js +9 -0
  57. package/dist/cjs/load-hold/UFOLoadHold.js +76 -0
  58. package/dist/cjs/load-hold/index.js +9 -0
  59. package/dist/cjs/placeholder/Placeholder.js +34 -0
  60. package/dist/cjs/placeholder/index.js +9 -0
  61. package/dist/cjs/placeholder/loosely-lazy/index.js +19 -0
  62. package/dist/cjs/placeholder/loosely-lazy/lazy-suspense.js +80 -0
  63. package/dist/cjs/placeholder/loosely-lazy/types.js +5 -0
  64. package/dist/cjs/placeholder/loosely-lazy/wait-context.js +15 -0
  65. package/dist/cjs/resource-timing/common/types.js +1 -0
  66. package/dist/cjs/resource-timing/common/utils/config.js +70 -0
  67. package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +111 -0
  68. package/dist/cjs/resource-timing/index.js +26 -0
  69. package/dist/cjs/resource-timing/main.js +141 -0
  70. package/dist/cjs/resource-timing/utils.js +10 -0
  71. package/dist/cjs/round-number/index.js +11 -0
  72. package/dist/cjs/route-name/index.js +12 -0
  73. package/dist/cjs/route-name-context/index.js +11 -0
  74. package/dist/cjs/segment/index.js +9 -0
  75. package/dist/cjs/segment/segment-highlight.js +40 -0
  76. package/dist/cjs/segment/segment.js +247 -0
  77. package/dist/cjs/set-interaction-error/index.js +17 -0
  78. package/dist/cjs/short-id/index.js +15 -0
  79. package/dist/cjs/ssr/index.js +70 -0
  80. package/dist/cjs/trace-interaction/index.js +48 -0
  81. package/dist/cjs/trace-pageload/index.js +58 -0
  82. package/dist/cjs/trace-press/index.js +34 -0
  83. package/dist/cjs/trace-redirect/index.js +17 -0
  84. package/dist/cjs/trace-transition/index.js +60 -0
  85. package/dist/cjs/trace-transition/utils/generate-span-id/index.js +11 -0
  86. package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +11 -0
  87. package/dist/cjs/typing-performance-tracing/index.js +262 -0
  88. package/dist/cjs/use-press-tracing/index.js +19 -0
  89. package/dist/cjs/vc/index.js +15 -0
  90. package/dist/cjs/vc/vc-observer/attachAbortListeners.js +40 -0
  91. package/dist/cjs/vc/vc-observer/getViewport.js +27 -0
  92. package/dist/cjs/vc/vc-observer/index.js +562 -0
  93. package/dist/cjs/vc/vc-observer/media-wrapper/index.js +15 -0
  94. package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +16 -0
  95. package/dist/cjs/vc/vc-observer/observers/index.js +270 -0
  96. package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +183 -0
  97. package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +22 -0
  98. package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +20 -0
  99. package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +19 -0
  100. package/dist/cjs/vc/vc-observer/observers/types.js +5 -0
  101. package/dist/es2019/additional-payload/index.js +2 -0
  102. package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +63 -0
  103. package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +33 -0
  104. package/dist/es2019/additional-payload/utils/lighthouse-metrics/const.js +4 -0
  105. package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +23 -0
  106. package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +15 -0
  107. package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +23 -0
  108. package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +31 -0
  109. package/dist/es2019/bundle-eval-timing/index.js +43 -0
  110. package/dist/es2019/coinflip/index.js +16 -0
  111. package/dist/es2019/common/common/types.js +1 -0
  112. package/dist/es2019/common/constants.js +1 -0
  113. package/dist/es2019/common/vc/types.js +5 -0
  114. package/dist/es2019/config/index.js +215 -0
  115. package/dist/es2019/create-payload/common/types.js +0 -0
  116. package/dist/es2019/create-payload/common/utils/index.js +8 -0
  117. package/dist/es2019/create-payload/index.js +792 -0
  118. package/dist/es2019/create-post-interaction-log-payload/index.js +188 -0
  119. package/dist/es2019/custom-data/index.js +24 -0
  120. package/dist/es2019/custom-data/types.js +1 -0
  121. package/dist/es2019/custom-mark/index.js +38 -0
  122. package/dist/es2019/custom-spans/index.js +6 -0
  123. package/dist/es2019/custom-timings/index.js +57 -0
  124. package/dist/es2019/experience-trace-id-context/index.js +31 -0
  125. package/dist/es2019/experience-trace-id-context/types.js +0 -0
  126. package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +4 -0
  127. package/dist/es2019/feature-flags-accessed/common/constants.js +1 -0
  128. package/dist/es2019/feature-flags-accessed/common/types.js +1 -0
  129. package/dist/es2019/feature-flags-accessed/common/utils/index.js +24 -0
  130. package/dist/es2019/feature-flags-accessed/index.js +21 -0
  131. package/dist/es2019/generate-id/index.js +6 -0
  132. package/dist/es2019/global-error-handler/index.js +64 -0
  133. package/dist/es2019/hidden-timing/index.js +87 -0
  134. package/dist/es2019/initial-page-load-extra-timing/index.js +43 -0
  135. package/dist/es2019/interaction-context/index.js +6 -0
  136. package/dist/es2019/interaction-id-context/index.js +18 -0
  137. package/dist/es2019/interaction-metrics/common/constants.js +2 -0
  138. package/dist/es2019/interaction-metrics/index.js +741 -4
  139. package/dist/es2019/interaction-metrics/post-interaction-log.js +158 -0
  140. package/dist/es2019/interaction-metrics-init/index.js +72 -0
  141. package/dist/es2019/label/UFOLabel.js +34 -0
  142. package/dist/es2019/label/index.js +2 -0
  143. package/dist/es2019/load-hold/UFOLoadHold.js +66 -0
  144. package/dist/es2019/load-hold/index.js +2 -0
  145. package/dist/es2019/placeholder/Placeholder.js +25 -0
  146. package/dist/es2019/placeholder/index.js +2 -0
  147. package/dist/es2019/placeholder/loosely-lazy/index.js +2 -0
  148. package/dist/es2019/placeholder/loosely-lazy/lazy-suspense.js +63 -0
  149. package/dist/es2019/placeholder/loosely-lazy/types.js +1 -0
  150. package/dist/es2019/placeholder/loosely-lazy/wait-context.js +5 -0
  151. package/dist/es2019/resource-timing/common/types.js +0 -0
  152. package/dist/es2019/resource-timing/common/utils/config.js +44 -0
  153. package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +88 -0
  154. package/dist/es2019/resource-timing/index.js +3 -0
  155. package/dist/es2019/resource-timing/main.js +130 -0
  156. package/dist/es2019/resource-timing/utils.js +4 -0
  157. package/dist/es2019/round-number/index.js +4 -0
  158. package/dist/es2019/route-name/index.js +6 -0
  159. package/dist/es2019/route-name-context/index.js +5 -0
  160. package/dist/es2019/segment/index.js +2 -0
  161. package/dist/es2019/segment/segment-highlight.js +27 -0
  162. package/dist/es2019/segment/segment.js +218 -0
  163. package/dist/es2019/set-interaction-error/index.js +11 -0
  164. package/dist/es2019/short-id/index.js +8 -0
  165. package/dist/es2019/ssr/index.js +54 -0
  166. package/dist/es2019/trace-interaction/index.js +41 -0
  167. package/dist/es2019/trace-pageload/index.js +48 -0
  168. package/dist/es2019/trace-press/index.js +27 -0
  169. package/dist/es2019/trace-redirect/index.js +10 -0
  170. package/dist/es2019/trace-transition/index.js +48 -0
  171. package/dist/es2019/trace-transition/utils/generate-span-id/index.js +1 -0
  172. package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +5 -0
  173. package/dist/es2019/typing-performance-tracing/index.js +255 -0
  174. package/dist/es2019/use-press-tracing/index.js +12 -0
  175. package/dist/es2019/vc/index.js +8 -0
  176. package/dist/es2019/vc/vc-observer/attachAbortListeners.js +34 -0
  177. package/dist/es2019/vc/vc-observer/getViewport.js +18 -0
  178. package/dist/es2019/vc/vc-observer/index.js +522 -0
  179. package/dist/es2019/vc/vc-observer/media-wrapper/index.js +9 -0
  180. package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +10 -0
  181. package/dist/es2019/vc/vc-observer/observers/index.js +231 -0
  182. package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +146 -0
  183. package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +16 -0
  184. package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +14 -0
  185. package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +2 -0
  186. package/dist/es2019/vc/vc-observer/observers/types.js +1 -0
  187. package/dist/esm/additional-payload/index.js +2 -0
  188. package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +63 -0
  189. package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +47 -0
  190. package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/types.js +0 -0
  191. package/dist/esm/additional-payload/utils/lighthouse-metrics/const.js +4 -0
  192. package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +22 -0
  193. package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +19 -0
  194. package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +31 -0
  195. package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +31 -0
  196. package/dist/esm/bundle-eval-timing/index.js +41 -0
  197. package/dist/esm/coinflip/index.js +16 -0
  198. package/dist/esm/common/common/types.js +1 -0
  199. package/dist/esm/common/constants.js +1 -0
  200. package/dist/esm/common/index.js +0 -0
  201. package/dist/esm/common/vc/types.js +5 -0
  202. package/dist/esm/config/index.js +206 -0
  203. package/dist/esm/create-payload/common/types.js +0 -0
  204. package/dist/esm/create-payload/common/utils/index.js +8 -0
  205. package/dist/esm/create-payload/index.js +774 -0
  206. package/dist/esm/create-post-interaction-log-payload/index.js +200 -0
  207. package/dist/esm/custom-data/index.js +23 -0
  208. package/dist/esm/custom-data/types.js +1 -0
  209. package/dist/esm/custom-mark/index.js +36 -0
  210. package/dist/esm/custom-spans/index.js +8 -0
  211. package/dist/esm/custom-timings/index.js +56 -0
  212. package/dist/esm/experience-trace-id-context/index.js +34 -0
  213. package/dist/esm/experience-trace-id-context/types.js +0 -0
  214. package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +6 -0
  215. package/dist/esm/feature-flags-accessed/common/constants.js +1 -0
  216. package/dist/esm/feature-flags-accessed/common/types.js +1 -0
  217. package/dist/esm/feature-flags-accessed/common/utils/index.js +31 -0
  218. package/dist/esm/feature-flags-accessed/index.js +21 -0
  219. package/dist/esm/generate-id/index.js +6 -0
  220. package/dist/esm/global-error-handler/index.js +67 -0
  221. package/dist/esm/hidden-timing/index.js +87 -0
  222. package/dist/esm/initial-page-load-extra-timing/index.js +42 -0
  223. package/dist/esm/interaction-context/index.js +6 -0
  224. package/dist/esm/interaction-id-context/index.js +22 -0
  225. package/dist/esm/interaction-metrics/common/constants.js +2 -0
  226. package/dist/esm/interaction-metrics/index.js +778 -3
  227. package/dist/esm/interaction-metrics/post-interaction-log.js +184 -0
  228. package/dist/esm/interaction-metrics-init/index.js +77 -0
  229. package/dist/esm/label/UFOLabel.js +36 -0
  230. package/dist/esm/label/index.js +2 -0
  231. package/dist/esm/load-hold/UFOLoadHold.js +66 -0
  232. package/dist/esm/load-hold/index.js +2 -0
  233. package/dist/esm/placeholder/Placeholder.js +25 -0
  234. package/dist/esm/placeholder/index.js +2 -0
  235. package/dist/esm/placeholder/loosely-lazy/index.js +2 -0
  236. package/dist/esm/placeholder/loosely-lazy/lazy-suspense.js +70 -0
  237. package/dist/esm/placeholder/loosely-lazy/types.js +1 -0
  238. package/dist/esm/placeholder/loosely-lazy/wait-context.js +9 -0
  239. package/dist/esm/resource-timing/common/types.js +0 -0
  240. package/dist/esm/resource-timing/common/utils/config.js +62 -0
  241. package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +104 -0
  242. package/dist/esm/resource-timing/index.js +3 -0
  243. package/dist/esm/resource-timing/main.js +134 -0
  244. package/dist/esm/resource-timing/utils.js +4 -0
  245. package/dist/esm/round-number/index.js +5 -0
  246. package/dist/esm/route-name/index.js +6 -0
  247. package/dist/esm/route-name-context/index.js +5 -0
  248. package/dist/esm/segment/index.js +2 -0
  249. package/dist/esm/segment/segment-highlight.js +30 -0
  250. package/dist/esm/segment/segment.js +235 -0
  251. package/dist/esm/set-interaction-error/index.js +11 -0
  252. package/dist/esm/short-id/index.js +9 -0
  253. package/dist/esm/ssr/index.js +59 -0
  254. package/dist/esm/trace-interaction/index.js +41 -0
  255. package/dist/esm/trace-pageload/index.js +50 -0
  256. package/dist/esm/trace-press/index.js +27 -0
  257. package/dist/esm/trace-redirect/index.js +10 -0
  258. package/dist/esm/trace-transition/index.js +49 -0
  259. package/dist/esm/trace-transition/utils/generate-span-id/index.js +5 -0
  260. package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +5 -0
  261. package/dist/esm/typing-performance-tracing/index.js +255 -0
  262. package/dist/esm/use-press-tracing/index.js +12 -0
  263. package/dist/esm/vc/index.js +9 -0
  264. package/dist/esm/vc/vc-observer/attachAbortListeners.js +34 -0
  265. package/dist/esm/vc/vc-observer/getViewport.js +20 -0
  266. package/dist/esm/vc/vc-observer/index.js +555 -0
  267. package/dist/esm/vc/vc-observer/media-wrapper/index.js +7 -0
  268. package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +10 -0
  269. package/dist/esm/vc/vc-observer/observers/index.js +263 -0
  270. package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +176 -0
  271. package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +16 -0
  272. package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +14 -0
  273. package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +2 -0
  274. package/dist/esm/vc/vc-observer/observers/types.js +1 -0
  275. package/dist/types/additional-payload/index.d.ts +2 -0
  276. package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +8 -0
  277. package/dist/types/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +2 -0
  278. package/dist/types/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +3 -0
  279. package/dist/types/additional-payload/utils/lighthouse-metrics/const.d.ts +5 -0
  280. package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +7 -0
  281. package/dist/types/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +5 -0
  282. package/dist/types/additional-payload/utils/lighthouse-metrics/utils/buffer/index.d.ts +13 -0
  283. package/dist/types/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -0
  284. package/dist/types/bundle-eval-timing/index.d.ts +16 -0
  285. package/dist/types/coinflip/index.d.ts +8 -0
  286. package/dist/types/common/common/types.d.ts +201 -0
  287. package/dist/types/common/constants.d.ts +1 -0
  288. package/dist/types/common/index.d.ts +5 -0
  289. package/dist/types/common/vc/types.d.ts +91 -0
  290. package/dist/types/config/index.d.ts +91 -0
  291. package/dist/types/create-payload/common/types.d.ts +4 -0
  292. package/dist/types/create-payload/common/utils/index.d.ts +3 -0
  293. package/dist/types/create-payload/index.d.ts +2969 -0
  294. package/dist/types/create-post-interaction-log-payload/index.d.ts +45 -0
  295. package/dist/types/custom-data/index.d.ts +5 -0
  296. package/dist/types/custom-data/types.d.ts +4 -0
  297. package/dist/types/custom-mark/index.d.ts +10 -0
  298. package/dist/types/custom-spans/index.d.ts +1 -0
  299. package/dist/types/custom-timings/index.d.ts +19 -0
  300. package/dist/types/experience-trace-id-context/index.d.ts +10 -0
  301. package/dist/types/experience-trace-id-context/types.d.ts +8 -0
  302. package/dist/types/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +4 -0
  303. package/dist/types/feature-flags-accessed/common/constants.d.ts +1 -0
  304. package/dist/types/feature-flags-accessed/common/types.d.ts +2 -0
  305. package/dist/types/feature-flags-accessed/common/utils/index.d.ts +3 -0
  306. package/dist/types/feature-flags-accessed/index.d.ts +14 -0
  307. package/dist/types/generate-id/index.d.ts +2 -0
  308. package/dist/types/global-error-handler/index.d.ts +3 -0
  309. package/dist/types/hidden-timing/index.d.ts +7 -0
  310. package/dist/types/initial-page-load-extra-timing/index.d.ts +9 -0
  311. package/dist/types/interaction-context/index.d.ts +33 -0
  312. package/dist/types/interaction-id-context/index.d.ts +9 -0
  313. package/dist/types/interaction-metrics/common/constants.d.ts +3 -0
  314. package/dist/types/interaction-metrics/index.d.ts +66 -2
  315. package/dist/types/interaction-metrics/post-interaction-log.d.ts +69 -0
  316. package/dist/types/interaction-metrics-init/index.d.ts +11 -0
  317. package/dist/types/label/UFOLabel.d.ts +13 -0
  318. package/dist/types/label/index.d.ts +2 -0
  319. package/dist/types/load-hold/UFOLoadHold.d.ts +53 -0
  320. package/dist/types/load-hold/index.d.ts +2 -0
  321. package/dist/types/placeholder/Placeholder.d.ts +13 -0
  322. package/dist/types/placeholder/index.d.ts +2 -0
  323. package/dist/types/placeholder/loosely-lazy/index.d.ts +3 -0
  324. package/dist/types/placeholder/loosely-lazy/lazy-suspense.d.ts +6 -0
  325. package/dist/types/placeholder/loosely-lazy/types.d.ts +20 -0
  326. package/dist/types/placeholder/loosely-lazy/wait-context.d.ts +3 -0
  327. package/dist/types/resource-timing/common/types.d.ts +41 -0
  328. package/dist/types/resource-timing/common/utils/config.d.ts +3 -0
  329. package/dist/types/resource-timing/common/utils/resource-timing-buffer.d.ts +11 -0
  330. package/dist/types/resource-timing/index.d.ts +4 -0
  331. package/dist/types/resource-timing/main.d.ts +2 -0
  332. package/dist/types/resource-timing/utils.d.ts +1 -0
  333. package/dist/types/round-number/index.d.ts +1 -0
  334. package/dist/types/route-name/index.d.ts +4 -0
  335. package/dist/types/route-name-context/index.d.ts +5 -0
  336. package/dist/types/segment/index.d.ts +2 -0
  337. package/dist/types/segment/segment-highlight.d.ts +6 -0
  338. package/dist/types/segment/segment.d.ts +8 -0
  339. package/dist/types/set-interaction-error/index.d.ts +4 -0
  340. package/dist/types/short-id/index.d.ts +1 -0
  341. package/dist/types/ssr/index.d.ts +21 -0
  342. package/dist/types/trace-interaction/index.d.ts +2 -0
  343. package/dist/types/trace-pageload/index.d.ts +2 -0
  344. package/dist/types/trace-press/index.d.ts +1 -0
  345. package/dist/types/trace-redirect/index.d.ts +1 -0
  346. package/dist/types/trace-transition/index.d.ts +2 -0
  347. package/dist/types/trace-transition/utils/generate-span-id/index.d.ts +1 -0
  348. package/dist/types/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -0
  349. package/dist/types/typing-performance-tracing/index.d.ts +2 -0
  350. package/dist/types/use-press-tracing/index.d.ts +1 -0
  351. package/dist/types/vc/index.d.ts +2 -0
  352. package/dist/types/vc/vc-observer/attachAbortListeners.d.ts +6 -0
  353. package/dist/types/vc/vc-observer/getViewport.d.ts +2 -0
  354. package/dist/types/vc/vc-observer/index.d.ts +98 -0
  355. package/dist/types/vc/vc-observer/media-wrapper/index.d.ts +7 -0
  356. package/dist/types/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -0
  357. package/dist/types/vc/vc-observer/observers/index.d.ts +39 -0
  358. package/dist/types/vc/vc-observer/observers/ssr-placeholders/index.d.ts +23 -0
  359. package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.d.ts +1 -0
  360. package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.d.ts +1 -0
  361. package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.d.ts +2 -0
  362. package/dist/types/vc/vc-observer/observers/types.d.ts +11 -0
  363. package/dist/types-ts4.5/additional-payload/index.d.ts +2 -0
  364. package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +8 -0
  365. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +2 -0
  366. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +3 -0
  367. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/const.d.ts +5 -0
  368. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +7 -0
  369. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +5 -0
  370. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/buffer/index.d.ts +13 -0
  371. package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -0
  372. package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +16 -0
  373. package/dist/types-ts4.5/coinflip/index.d.ts +8 -0
  374. package/dist/types-ts4.5/common/common/types.d.ts +201 -0
  375. package/dist/types-ts4.5/common/constants.d.ts +1 -0
  376. package/dist/types-ts4.5/common/index.d.ts +5 -0
  377. package/dist/types-ts4.5/common/vc/types.d.ts +91 -0
  378. package/dist/types-ts4.5/config/index.d.ts +95 -0
  379. package/dist/types-ts4.5/create-payload/common/types.d.ts +4 -0
  380. package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +3 -0
  381. package/dist/types-ts4.5/create-payload/index.d.ts +2969 -0
  382. package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +45 -0
  383. package/dist/types-ts4.5/custom-data/index.d.ts +5 -0
  384. package/dist/types-ts4.5/custom-data/types.d.ts +4 -0
  385. package/dist/types-ts4.5/custom-mark/index.d.ts +10 -0
  386. package/dist/types-ts4.5/custom-spans/index.d.ts +1 -0
  387. package/dist/types-ts4.5/custom-timings/index.d.ts +19 -0
  388. package/dist/types-ts4.5/experience-trace-id-context/index.d.ts +10 -0
  389. package/dist/types-ts4.5/experience-trace-id-context/types.d.ts +8 -0
  390. package/dist/types-ts4.5/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +4 -0
  391. package/dist/types-ts4.5/feature-flags-accessed/common/constants.d.ts +1 -0
  392. package/dist/types-ts4.5/feature-flags-accessed/common/types.d.ts +2 -0
  393. package/dist/types-ts4.5/feature-flags-accessed/common/utils/index.d.ts +3 -0
  394. package/dist/types-ts4.5/feature-flags-accessed/index.d.ts +14 -0
  395. package/dist/types-ts4.5/generate-id/index.d.ts +2 -0
  396. package/dist/types-ts4.5/global-error-handler/index.d.ts +3 -0
  397. package/dist/types-ts4.5/hidden-timing/index.d.ts +7 -0
  398. package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +9 -0
  399. package/dist/types-ts4.5/interaction-context/index.d.ts +33 -0
  400. package/dist/types-ts4.5/interaction-id-context/index.d.ts +9 -0
  401. package/dist/types-ts4.5/interaction-metrics/common/constants.d.ts +3 -0
  402. package/dist/types-ts4.5/interaction-metrics/index.d.ts +66 -2
  403. package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +69 -0
  404. package/dist/types-ts4.5/interaction-metrics-init/index.d.ts +11 -0
  405. package/dist/types-ts4.5/label/UFOLabel.d.ts +13 -0
  406. package/dist/types-ts4.5/label/index.d.ts +2 -0
  407. package/dist/types-ts4.5/load-hold/UFOLoadHold.d.ts +53 -0
  408. package/dist/types-ts4.5/load-hold/index.d.ts +2 -0
  409. package/dist/types-ts4.5/placeholder/Placeholder.d.ts +13 -0
  410. package/dist/types-ts4.5/placeholder/index.d.ts +2 -0
  411. package/dist/types-ts4.5/placeholder/loosely-lazy/index.d.ts +3 -0
  412. package/dist/types-ts4.5/placeholder/loosely-lazy/lazy-suspense.d.ts +6 -0
  413. package/dist/types-ts4.5/placeholder/loosely-lazy/types.d.ts +20 -0
  414. package/dist/types-ts4.5/placeholder/loosely-lazy/wait-context.d.ts +3 -0
  415. package/dist/types-ts4.5/resource-timing/common/types.d.ts +41 -0
  416. package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +3 -0
  417. package/dist/types-ts4.5/resource-timing/common/utils/resource-timing-buffer.d.ts +11 -0
  418. package/dist/types-ts4.5/resource-timing/index.d.ts +4 -0
  419. package/dist/types-ts4.5/resource-timing/main.d.ts +2 -0
  420. package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -0
  421. package/dist/types-ts4.5/round-number/index.d.ts +1 -0
  422. package/dist/types-ts4.5/route-name/index.d.ts +4 -0
  423. package/dist/types-ts4.5/route-name-context/index.d.ts +5 -0
  424. package/dist/types-ts4.5/segment/index.d.ts +2 -0
  425. package/dist/types-ts4.5/segment/segment-highlight.d.ts +6 -0
  426. package/dist/types-ts4.5/segment/segment.d.ts +8 -0
  427. package/dist/types-ts4.5/set-interaction-error/index.d.ts +4 -0
  428. package/dist/types-ts4.5/short-id/index.d.ts +1 -0
  429. package/dist/types-ts4.5/ssr/index.d.ts +21 -0
  430. package/dist/types-ts4.5/trace-interaction/index.d.ts +2 -0
  431. package/dist/types-ts4.5/trace-pageload/index.d.ts +2 -0
  432. package/dist/types-ts4.5/trace-press/index.d.ts +1 -0
  433. package/dist/types-ts4.5/trace-redirect/index.d.ts +1 -0
  434. package/dist/types-ts4.5/trace-transition/index.d.ts +2 -0
  435. package/dist/types-ts4.5/trace-transition/utils/generate-span-id/index.d.ts +1 -0
  436. package/dist/types-ts4.5/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -0
  437. package/dist/types-ts4.5/typing-performance-tracing/index.d.ts +2 -0
  438. package/dist/types-ts4.5/use-press-tracing/index.d.ts +1 -0
  439. package/dist/types-ts4.5/vc/index.d.ts +2 -0
  440. package/dist/types-ts4.5/vc/vc-observer/attachAbortListeners.d.ts +6 -0
  441. package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -0
  442. package/dist/types-ts4.5/vc/vc-observer/index.d.ts +98 -0
  443. package/dist/types-ts4.5/vc/vc-observer/media-wrapper/index.d.ts +7 -0
  444. package/dist/types-ts4.5/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -0
  445. package/dist/types-ts4.5/vc/vc-observer/observers/index.d.ts +39 -0
  446. package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/index.d.ts +23 -0
  447. package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.d.ts +1 -0
  448. package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.d.ts +1 -0
  449. package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.d.ts +2 -0
  450. package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +11 -0
  451. package/experience-trace-id-context/package.json +15 -0
  452. package/feature-flags-accessed/package.json +15 -0
  453. package/generate-id/package.json +15 -0
  454. package/global-error-handler/package.json +15 -0
  455. package/hidden-timing/package.json +15 -0
  456. package/initial-page-load-extra-timing/package.json +15 -0
  457. package/interaction-context/package.json +15 -0
  458. package/interaction-id-context/package.json +15 -0
  459. package/interaction-metrics-init/package.json +15 -0
  460. package/label/package.json +15 -0
  461. package/load-hold/package.json +15 -0
  462. package/package.json +55 -3
  463. package/placeholder/package.json +15 -0
  464. package/resource-timing/package.json +15 -0
  465. package/round-number/package.json +15 -0
  466. package/route-name/package.json +15 -0
  467. package/route-name-context/package.json +15 -0
  468. package/segment/package.json +15 -0
  469. package/set-interaction-error/package.json +15 -0
  470. package/short-id/package.json +15 -0
  471. package/ssr/package.json +15 -0
  472. package/ssr-scripts/package.json +15 -0
  473. package/trace-interaction/package.json +15 -0
  474. package/trace-pageload/package.json +15 -0
  475. package/trace-press/package.json +15 -0
  476. package/trace-redirect/package.json +15 -0
  477. package/trace-transition/package.json +15 -0
  478. package/typing-performance-tracing/package.json +15 -0
  479. package/use-press-tracing/package.json +15 -0
  480. package/vc/media/package.json +15 -0
  481. package/vc/package.json +15 -0
  482. package/dist/types/common/types.d.ts +0 -17
  483. package/dist/types-ts4.5/common/types.d.ts +0 -17
  484. /package/dist/cjs/{common → additional-payload/utils/lighthouse-metrics/cls}/types.js +0 -0
  485. /package/dist/es2019/{common → additional-payload/utils/lighthouse-metrics/cls}/types.js +0 -0
  486. /package/dist/{esm/common/types.js → es2019/common/index.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#156392](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156392)
8
+ [`c4b79c6ef2fe1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c4b79c6ef2fe1) -
9
+ previous update should've been a major version, this update is a patch however for fixing late
10
+ mutation logic
11
+
12
+ ### Minor Changes
13
+
14
+ - [#156171](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156171)
15
+ [`cac81bd740336`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cac81bd740336) -
16
+ Re-exporting atlaskit/react-ufo within atlassian/react-ufo
17
+
18
+ ### Patch Changes
19
+
20
+ - [#156442](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156442)
21
+ [`e74a468fad66a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e74a468fad66a) -
22
+ add switch for compact payload
23
+ - [#156476](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156476)
24
+ [`c06bb2cd9e5d1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c06bb2cd9e5d1) -
25
+ make time window for late mutations and rerenders to be configurable
26
+
27
+ ## 1.1.0
28
+
29
+ ### Minor Changes
30
+
31
+ - [#155735](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155735)
32
+ [`e5a96535fa143`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e5a96535fa143) -
33
+ addCustomSpans accepts optional custom LabelStak object
34
+
3
35
  ## 1.0.1
4
36
 
5
37
  ### Patch Changes
package/README.md CHANGED
@@ -1,3 +1,8 @@
1
1
  # React UFO for Atlaskit
2
2
 
3
3
  Parts of React UFO that need to be scoped within @atlaskit
4
+
5
+ <https://hello.atlassian.net/wiki/spaces/UFO/blog/2022/12/16/2280380649/react-UFO+A+deeper+understanding+of+performance>
6
+
7
+ <https://hello.atlassian.net/wiki/spaces/UFO/pages/2305847386/react-ufo+UFO+v2>
8
+
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/additional-payload",
3
+ "main": "../dist/cjs/additional-payload/index.js",
4
+ "module": "../dist/esm/additional-payload/index.js",
5
+ "module:es2019": "../dist/es2019/additional-payload/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/additional-payload/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/additional-payload/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/bundle-eval-timing",
3
+ "main": "../dist/cjs/bundle-eval-timing/index.js",
4
+ "module": "../dist/esm/bundle-eval-timing/index.js",
5
+ "module:es2019": "../dist/es2019/bundle-eval-timing/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/bundle-eval-timing/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/bundle-eval-timing/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/coinflip",
3
+ "main": "../dist/cjs/coinflip/index.js",
4
+ "module": "../dist/esm/coinflip/index.js",
5
+ "module:es2019": "../dist/es2019/coinflip/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/coinflip/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/coinflip/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo/common",
3
- "main": "../dist/cjs/common/types.js",
4
- "module": "../dist/esm/common/types.js",
5
- "module:es2019": "../dist/es2019/common/types.js",
3
+ "main": "../dist/cjs/common/index.js",
4
+ "module": "../dist/esm/common/index.js",
5
+ "module:es2019": "../dist/es2019/common/index.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/common/types.d.ts",
7
+ "types": "../dist/types/common/index.d.ts",
8
8
  "typesVersions": {
9
9
  ">=4.5 <5.4": {
10
10
  "*": [
11
- "../dist/types-ts4.5/common/types.d.ts"
11
+ "../dist/types-ts4.5/common/index.d.ts"
12
12
  ]
13
13
  }
14
14
  }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/config",
3
+ "main": "../dist/cjs/config/index.js",
4
+ "module": "../dist/esm/config/index.js",
5
+ "module:es2019": "../dist/es2019/config/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/config/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/config/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/create-payload",
3
+ "main": "../dist/cjs/create-payload/index.js",
4
+ "module": "../dist/esm/create-payload/index.js",
5
+ "module:es2019": "../dist/es2019/create-payload/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/create-payload/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/create-payload/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/create-post-interaction-log-payload",
3
+ "main": "../dist/cjs/create-post-interaction-log-payload/index.js",
4
+ "module": "../dist/esm/create-post-interaction-log-payload/index.js",
5
+ "module:es2019": "../dist/es2019/create-post-interaction-log-payload/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/create-post-interaction-log-payload/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/custom-data",
3
+ "main": "../dist/cjs/custom-data/index.js",
4
+ "module": "../dist/esm/custom-data/index.js",
5
+ "module:es2019": "../dist/es2019/custom-data/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/custom-data/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/custom-data/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/custom-mark",
3
+ "main": "../dist/cjs/custom-mark/index.js",
4
+ "module": "../dist/esm/custom-mark/index.js",
5
+ "module:es2019": "../dist/es2019/custom-mark/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/custom-mark/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/custom-mark/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/custom-spans",
3
+ "main": "../dist/cjs/custom-spans/index.js",
4
+ "module": "../dist/esm/custom-spans/index.js",
5
+ "module:es2019": "../dist/es2019/custom-spans/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/custom-spans/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/custom-spans/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/react-ufo/custom-timings",
3
+ "main": "../dist/cjs/custom-timings/index.js",
4
+ "module": "../dist/esm/custom-timings/index.js",
5
+ "module:es2019": "../dist/es2019/custom-timings/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/custom-timings/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/custom-timings/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "getCacheHitRatio", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _cacheHitRatio.getCacheHitRatio;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "getLighthouseMetrics", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _lighthouseMetrics.getLighthouseMetrics;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "startLighthouseObserver", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _lighthouseMetrics.startLighthouseObserver;
22
+ }
23
+ });
24
+ var _lighthouseMetrics = require("./utils/lighthouse-metrics");
25
+ var _cacheHitRatio = require("./utils/cache-hit-ratio");
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getCacheHitRatio = void 0;
7
+ /* Borrowed from https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/performance/browser-metrics/src/plugins/timings/resource.ts */
8
+ var cacheableTypes = ['script', 'link'];
9
+ var CACHE_NETWORK = 'network';
10
+ var CACHE_MEMORY = 'memory';
11
+ var CACHE_DISK = 'disk';
12
+ var calculateTransferType = function calculateTransferType(type, duration, size) {
13
+ if (!cacheableTypes.includes(type)) {
14
+ return CACHE_NETWORK;
15
+ }
16
+ if ((size === undefined || size === 0) && duration === 0) {
17
+ return CACHE_MEMORY;
18
+ }
19
+ if (size === 0 && duration > 0) {
20
+ return CACHE_DISK;
21
+ }
22
+ if (size === undefined) {
23
+ return null;
24
+ }
25
+ return CACHE_NETWORK;
26
+ };
27
+ var getCacheHitRatio = exports.getCacheHitRatio = function getCacheHitRatio(_ref) {
28
+ var start = _ref.start;
29
+ var fromCache = 0;
30
+ var preloadFromCache = 0;
31
+ var total = 0;
32
+ var totalPreload = 0;
33
+
34
+ // initial load only
35
+ if (start !== 0) {
36
+ return {};
37
+ }
38
+ try {
39
+ for (var _i = 0, _arr = performance.getEntriesByType('resource'); _i < _arr.length; _i++) {
40
+ var entry = _arr[_i];
41
+ // The BM3 resource timing collector checks for whether the timing information is available,
42
+ // but we can make the assumption that it is for this Jira specific collector.
43
+ var transferType = calculateTransferType(entry.initiatorType, entry.duration, entry.transferSize);
44
+ var isPreload = entry.initiatorType === 'link';
45
+ if (transferType === 'disk' || transferType === 'memory') {
46
+ fromCache += 1;
47
+ if (isPreload) {
48
+ preloadFromCache += 1;
49
+ }
50
+ }
51
+ if (transferType !== null) {
52
+ total += 1;
53
+ if (isPreload) {
54
+ totalPreload += 1;
55
+ }
56
+ }
57
+ }
58
+ var result = {};
59
+ if (total > 0) {
60
+ result.cacheHitRatio = fromCache / total;
61
+ }
62
+ if (totalPreload > 0) {
63
+ result.preloadCacheHitRatio = preloadFromCache / totalPreload;
64
+ }
65
+ return result;
66
+ } catch (e) {
67
+ return {};
68
+ }
69
+ };
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getCLS = void 0;
7
+ 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; } } }; }
8
+ 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; } }
9
+ 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; }
10
+ var getCLS = exports.getCLS = function getCLS(start, stop, buffer) {
11
+ var layoutShifts = buffer.getAll().filter(function (entry) {
12
+ return entry.startTime >= start && entry.startTime <= stop;
13
+ });
14
+ var sessionWindows = [];
15
+ var currentWindow = null;
16
+
17
+ // Group layout shifts into session windows
18
+ var _iterator = _createForOfIteratorHelper(layoutShifts),
19
+ _step;
20
+ try {
21
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
22
+ var shift = _step.value;
23
+ var startTime = shift.startTime;
24
+ var endTime = shift.startTime + shift.duration;
25
+ var score = shift.value;
26
+ if (currentWindow === null || startTime - currentWindow.endTime > 1000 || endTime - currentWindow.startTime > 5000) {
27
+ // Start a new session window
28
+ currentWindow = {
29
+ startTime: startTime,
30
+ endTime: endTime,
31
+ score: score
32
+ };
33
+ sessionWindows.push(currentWindow);
34
+ } else {
35
+ // Add layout shift to current session window
36
+ currentWindow.endTime = endTime;
37
+ currentWindow.score += score;
38
+ }
39
+ }
40
+
41
+ // Find session window with highest cumulative score
42
+ } catch (err) {
43
+ _iterator.e(err);
44
+ } finally {
45
+ _iterator.f();
46
+ }
47
+ var maxScore = sessionWindows.reduce(function (max, sessionWindow) {
48
+ return sessionWindow.score > max ? sessionWindow.score : max;
49
+ }, 0);
50
+
51
+ // Return score of largest burst as CLS metric
52
+ return Math.round(maxScore * 10000) / 10000;
53
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PerformanceObserverEntryTypes = void 0;
7
+ var PerformanceObserverEntryTypes = exports.PerformanceObserverEntryTypes = {
8
+ LayoutShift: 'layout-shift',
9
+ LongTask: 'longtask'
10
+ };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getLighthouseMetrics = void 0;
7
+ exports.startLighthouseObserver = startLighthouseObserver;
8
+ var _cls = require("./cls");
9
+ var _const = require("./const");
10
+ var _tbt = require("./tbt");
11
+ var _buffer = require("./utils/buffer");
12
+ var _observer = require("./utils/observer");
13
+ function startLighthouseObserver() {
14
+ (0, _observer.startLSObserver)();
15
+ (0, _observer.startLTObserver)();
16
+ }
17
+ var getLighthouseMetrics = exports.getLighthouseMetrics = function getLighthouseMetrics(_ref) {
18
+ var start = _ref.start,
19
+ stop = _ref.stop;
20
+ var tbt = (0, _tbt.getTBT)(start, stop, _buffer.EntriesBuffer[_const.PerformanceObserverEntryTypes.LongTask]);
21
+
22
+ // no round as CLS is usually 0-1
23
+ var cls = (0, _cls.getCLS)(start, stop, _buffer.EntriesBuffer[_const.PerformanceObserverEntryTypes.LayoutShift]);
24
+ return {
25
+ 'metric:tbt': Math.round(tbt.total),
26
+ 'metric:tbt:observed': Math.round(tbt.observed),
27
+ 'metric:cls': cls
28
+ };
29
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getTBT = void 0;
7
+ var MAX_ACCEPTABLE_TASK_DURATION = 50;
8
+ var getTBT = exports.getTBT = function getTBT(start, stop, buffer) {
9
+ return buffer.getAll().filter(function (entry) {
10
+ return 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);
11
+ }).reduce(function (tbt, entry) {
12
+ var longTaskStop = entry.startTime + entry.duration;
13
+ var intersectStart = Math.max(entry.startTime + MAX_ACCEPTABLE_TASK_DURATION, start);
14
+ var intersectStop = Math.min(longTaskStop, stop);
15
+ var longTaskIncluded = Math.max(intersectStop - intersectStart, 0);
16
+ // eslint-disable-next-line no-param-reassign
17
+ tbt.observed += entry.duration - MAX_ACCEPTABLE_TASK_DURATION;
18
+ // eslint-disable-next-line no-param-reassign
19
+ tbt.total += longTaskIncluded;
20
+ return tbt;
21
+ }, {
22
+ total: 0,
23
+ observed: 0
24
+ });
25
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EntriesBuffer = exports.BufferWithMaxLength = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+ var _const = require("../../const");
12
+ var _EntriesBuffer;
13
+ var BufferWithMaxLength = exports.BufferWithMaxLength = /*#__PURE__*/function () {
14
+ function BufferWithMaxLength() {
15
+ var maxLength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1000;
16
+ (0, _classCallCheck2.default)(this, BufferWithMaxLength);
17
+ (0, _defineProperty2.default)(this, "buffer", []);
18
+ (0, _defineProperty2.default)(this, "full", false);
19
+ this.maxLength = maxLength;
20
+ }
21
+ (0, _createClass2.default)(BufferWithMaxLength, [{
22
+ key: "push",
23
+ value: function push(item) {
24
+ if (this.full || this.maxLength === this.buffer.length) {
25
+ this.full = true;
26
+ this.buffer.shift();
27
+ }
28
+ this.buffer.push(item);
29
+ }
30
+ }, {
31
+ key: "getAll",
32
+ value: function getAll() {
33
+ return this.buffer;
34
+ }
35
+ }]);
36
+ return BufferWithMaxLength;
37
+ }();
38
+ var EntriesBuffer = exports.EntriesBuffer = (_EntriesBuffer = {}, (0, _defineProperty2.default)(_EntriesBuffer, _const.PerformanceObserverEntryTypes.LongTask, new BufferWithMaxLength()), (0, _defineProperty2.default)(_EntriesBuffer, _const.PerformanceObserverEntryTypes.LayoutShift, new BufferWithMaxLength()), _EntriesBuffer);
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.startLTObserver = exports.startLSObserver = void 0;
7
+ var _const = require("../../const");
8
+ var _buffer = require("../buffer");
9
+ var pe = null;
10
+ var getObserver = function getObserver() {
11
+ if (pe !== null) {
12
+ return pe;
13
+ }
14
+ pe = new PerformanceObserver(function (list) {
15
+ list.getEntries().forEach(function (entry) {
16
+ if (entry.entryType === _const.PerformanceObserverEntryTypes.LayoutShift) {
17
+ _buffer.EntriesBuffer[_const.PerformanceObserverEntryTypes.LayoutShift].push(entry);
18
+ }
19
+ if (entry.entryType === _const.PerformanceObserverEntryTypes.LongTask) {
20
+ _buffer.EntriesBuffer[_const.PerformanceObserverEntryTypes.LongTask].push(entry);
21
+ }
22
+ });
23
+ });
24
+ return pe;
25
+ };
26
+ var startLSObserver = exports.startLSObserver = function startLSObserver() {
27
+ getObserver().observe({
28
+ type: _const.PerformanceObserverEntryTypes.LayoutShift,
29
+ buffered: true
30
+ });
31
+ };
32
+ var startLTObserver = exports.startLTObserver = function startLTObserver() {
33
+ getObserver().observe({
34
+ type: _const.PerformanceObserverEntryTypes.LongTask,
35
+ buffered: true
36
+ });
37
+ };
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.configure = configure;
7
+ exports.getBundleEvalTimings = getBundleEvalTimings;
8
+ var _roundNumber = require("../round-number");
9
+ var config = null;
10
+ function configure(bundleEvalTimingConfiguration) {
11
+ config = bundleEvalTimingConfiguration;
12
+ }
13
+ var getPerformanceObject = function getPerformanceObject() {
14
+ var _window;
15
+ return ((_window = window) !== null && _window !== void 0 ? _window : {}).performance;
16
+ };
17
+ function getBundleEvalTimings(interactionStartTime) {
18
+ if (config == null) {
19
+ return {};
20
+ }
21
+ var started = {};
22
+ var timings = {};
23
+ var cachedConfig = config;
24
+ var performance = getPerformanceObject();
25
+ performance === null || performance === void 0 || performance.getEntriesByType('mark').forEach(function (mark) {
26
+ var result = cachedConfig.mapPerformanceMark(mark.name);
27
+ if (!result) {
28
+ return;
29
+ }
30
+ var type = result.type,
31
+ name = result.name;
32
+ if (type === 'start' && mark.startTime >= interactionStartTime) {
33
+ started[name] = mark;
34
+ return;
35
+ }
36
+ if (type === 'end' && started[name]) {
37
+ timings[name] = {
38
+ startTime: (0, _roundNumber.roundEpsilon)(started[name].startTime - interactionStartTime),
39
+ duration: (0, _roundNumber.roundEpsilon)(mark.startTime - started[name].startTime)
40
+ };
41
+ delete started[name];
42
+ }
43
+ });
44
+ if (Object.keys(timings).length === 0) {
45
+ return {};
46
+ }
47
+ return timings;
48
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = coinflip;
7
+ /**
8
+ * A random function that passes one in rate times.
9
+ * E.g. coinflip(2) is the same as if you flipped a coin.
10
+ * It will pass 50% of the time
11
+ * @param rate The change that it will pass (1 in <rate> times)
12
+ * @returns bool, if it passes or not
13
+ */
14
+ function coinflip(rate) {
15
+ if (rate === 0) {
16
+ return false;
17
+ } else if (rate === 1) {
18
+ return true;
19
+ } else {
20
+ return Math.random() * rate <= 1;
21
+ }
22
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.REACT_UFO_VERSION = void 0;
7
+ var REACT_UFO_VERSION = exports.REACT_UFO_VERSION = '1.0.1';
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AbortEvent = void 0;
7
+ var AbortEvent = exports.AbortEvent = {
8
+ wheel: 'wheel',
9
+ keydown: 'keydown',
10
+ resize: 'resize'
11
+ };