@atlaskit/react-ufo 3.4.14 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +6 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/cjs/assets/index.js +17 -14
- package/dist/cjs/assets/utils.js +9 -8
- package/dist/cjs/bundle-eval-timing/index.js +8 -8
- package/dist/cjs/coinflip/index.js +5 -3
- package/dist/cjs/common/constants.js +3 -2
- package/dist/cjs/common/react-ufo-payload-schema.js +5 -0
- package/dist/cjs/config/index.js +30 -42
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +29 -39
- package/dist/cjs/create-payload/common/utils/index.js +16 -20
- package/dist/cjs/create-payload/index.js +150 -140
- package/dist/cjs/create-payload/utils/get-interaction-status.js +5 -3
- package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +5 -3
- package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +5 -3
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +10 -8
- package/dist/cjs/create-post-interaction-log-payload/index.js +15 -13
- package/dist/cjs/custom-data/index.js +4 -3
- package/dist/cjs/custom-mark/index.js +4 -3
- package/dist/cjs/custom-spans/index.js +4 -3
- package/dist/cjs/custom-timings/index.js +6 -6
- package/dist/cjs/experience-trace-id-context/index.js +15 -14
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/cjs/feature-flags-accessed/index.js +3 -2
- package/dist/cjs/generate-id/index.js +5 -3
- package/dist/cjs/global-error-handler/index.js +14 -13
- package/dist/cjs/initial-page-load-extra-timing/index.js +6 -6
- package/dist/cjs/interaction-metrics/index.js +110 -145
- package/dist/cjs/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/cjs/interaction-metrics-init/index.js +17 -10
- package/dist/cjs/interaction-metrics-init/schedule-idle-callback.js +8 -4
- package/dist/cjs/resource-timing/common/utils/config.js +10 -10
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/cjs/resource-timing/main.js +27 -20
- package/dist/cjs/resource-timing/utils.js +4 -3
- package/dist/cjs/round-number/index.js +3 -2
- package/dist/cjs/route-name/index.js +5 -3
- package/dist/cjs/segment/schedule-on-paint.js +8 -5
- package/dist/cjs/segment/segment.js +9 -5
- package/dist/cjs/self-measurements/index.js +261 -0
- package/dist/cjs/set-interaction-error/index.js +4 -3
- package/dist/cjs/short-id/index.js +5 -3
- package/dist/cjs/ssr/index.js +18 -21
- package/dist/cjs/trace-interaction/index.js +7 -5
- package/dist/cjs/trace-pageload/index.js +7 -6
- package/dist/cjs/trace-press/index.js +5 -3
- package/dist/cjs/trace-redirect/index.js +5 -3
- package/dist/cjs/trace-transition/index.js +6 -4
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/cjs/vc/index.js +17 -6
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +41 -26
- package/dist/cjs/vc/vc-observer/getViewport.js +6 -6
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/cjs/vc/vc-observer/index.js +170 -133
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/cjs/vc/vc-observer/observers/index.js +82 -25
- package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +5 -8
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/cjs/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +5 -3
- package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +13 -11
- package/dist/cjs/vc/vc-observer-new/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +20 -12
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +27 -26
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +27 -14
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +50 -40
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/cjs/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +16 -13
- package/dist/cjs/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/cjs/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +16 -13
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/es2019/assets/index.js +19 -14
- package/dist/es2019/assets/utils.js +11 -9
- package/dist/es2019/bundle-eval-timing/index.js +7 -6
- package/dist/es2019/coinflip/index.js +5 -2
- package/dist/es2019/common/constants.js +3 -2
- package/dist/es2019/common/react-ufo-payload-schema.js +1 -0
- package/dist/es2019/config/index.js +29 -28
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +18 -15
- package/dist/es2019/create-payload/common/utils/index.js +15 -14
- package/dist/es2019/create-payload/index.js +87 -71
- package/dist/es2019/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +4 -2
- package/dist/es2019/create-post-interaction-log-payload/index.js +14 -12
- package/dist/es2019/custom-data/index.js +3 -2
- package/dist/es2019/custom-mark/index.js +3 -2
- package/dist/es2019/custom-spans/index.js +3 -2
- package/dist/es2019/custom-timings/index.js +5 -4
- package/dist/es2019/experience-trace-id-context/index.js +16 -13
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +6 -3
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +14 -7
- package/dist/es2019/feature-flags-accessed/index.js +3 -2
- package/dist/es2019/generate-id/index.js +4 -2
- package/dist/es2019/global-error-handler/index.js +15 -12
- package/dist/es2019/initial-page-load-extra-timing/index.js +5 -4
- package/dist/es2019/interaction-metrics/index.js +109 -108
- package/dist/es2019/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/es2019/interaction-metrics-init/index.js +17 -10
- package/dist/es2019/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/es2019/resource-timing/common/utils/config.js +10 -7
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +14 -11
- package/dist/es2019/resource-timing/main.js +33 -18
- package/dist/es2019/resource-timing/utils.js +3 -2
- package/dist/es2019/round-number/index.js +3 -2
- package/dist/es2019/route-name/index.js +4 -2
- package/dist/es2019/segment/schedule-on-paint.js +7 -4
- package/dist/es2019/segment/segment.js +9 -5
- package/dist/es2019/self-measurements/index.js +213 -0
- package/dist/es2019/set-interaction-error/index.js +3 -2
- package/dist/es2019/short-id/index.js +4 -2
- package/dist/es2019/ssr/index.js +21 -16
- package/dist/es2019/trace-interaction/index.js +6 -4
- package/dist/es2019/trace-pageload/index.js +6 -4
- package/dist/es2019/trace-press/index.js +4 -2
- package/dist/es2019/trace-redirect/index.js +4 -2
- package/dist/es2019/trace-transition/index.js +5 -3
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +4 -1
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/es2019/vc/index.js +16 -4
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +41 -25
- package/dist/es2019/vc/vc-observer/getViewport.js +5 -4
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +28 -10
- package/dist/es2019/vc/vc-observer/index.js +158 -116
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/es2019/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/es2019/vc/vc-observer/observers/index.js +80 -25
- package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -7
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/es2019/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/es2019/vc/vc-observer-new/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +3 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +14 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +6 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +21 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +10 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/task-yield.js +5 -2
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/es2019/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -13
- package/dist/es2019/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/es2019/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/esm/assets/index.js +17 -14
- package/dist/esm/assets/utils.js +10 -8
- package/dist/esm/bundle-eval-timing/index.js +7 -6
- package/dist/esm/coinflip/index.js +5 -2
- package/dist/esm/common/constants.js +3 -2
- package/dist/esm/common/react-ufo-payload-schema.js +1 -0
- package/dist/esm/config/index.js +29 -28
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +28 -35
- package/dist/esm/create-payload/common/utils/index.js +15 -14
- package/dist/esm/create-payload/index.js +149 -139
- package/dist/esm/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/esm/create-payload/utils/get-vc-metrics.js +9 -7
- package/dist/esm/create-post-interaction-log-payload/index.js +14 -12
- package/dist/esm/custom-data/index.js +3 -2
- package/dist/esm/custom-mark/index.js +3 -2
- package/dist/esm/custom-spans/index.js +3 -2
- package/dist/esm/custom-timings/index.js +5 -4
- package/dist/esm/experience-trace-id-context/index.js +15 -14
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/esm/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/esm/feature-flags-accessed/index.js +3 -2
- package/dist/esm/generate-id/index.js +4 -2
- package/dist/esm/global-error-handler/index.js +14 -13
- package/dist/esm/initial-page-load-extra-timing/index.js +5 -4
- package/dist/esm/interaction-metrics/index.js +109 -108
- package/dist/esm/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/esm/interaction-metrics-init/index.js +17 -10
- package/dist/esm/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/esm/resource-timing/common/utils/config.js +9 -8
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/esm/resource-timing/main.js +27 -20
- package/dist/esm/resource-timing/utils.js +3 -2
- package/dist/esm/round-number/index.js +3 -2
- package/dist/esm/route-name/index.js +4 -2
- package/dist/esm/segment/schedule-on-paint.js +7 -4
- package/dist/esm/segment/segment.js +9 -5
- package/dist/esm/self-measurements/index.js +246 -0
- package/dist/esm/set-interaction-error/index.js +3 -2
- package/dist/esm/short-id/index.js +4 -2
- package/dist/esm/ssr/index.js +17 -16
- package/dist/esm/trace-interaction/index.js +6 -4
- package/dist/esm/trace-pageload/index.js +6 -4
- package/dist/esm/trace-press/index.js +4 -2
- package/dist/esm/trace-redirect/index.js +4 -2
- package/dist/esm/trace-transition/index.js +5 -3
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/esm/vc/index.js +16 -4
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +40 -25
- package/dist/esm/vc/vc-observer/getViewport.js +5 -4
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/esm/vc/vc-observer/index.js +170 -133
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/esm/vc/vc-observer/observers/index.js +82 -25
- package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -7
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/esm/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/esm/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/esm/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/esm/vc/vc-observer-new/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +19 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +26 -24
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +26 -13
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +49 -39
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -7
- package/dist/esm/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types/assets/index.d.ts +3 -1
- package/dist/types/assets/utils.d.ts +1 -1
- package/dist/types/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types/coinflip/index.d.ts +2 -1
- package/dist/types/common/index.d.ts +2 -1
- package/dist/types/common/react-ufo-payload-schema.d.ts +175 -0
- package/dist/types/common/vc/types.d.ts +20 -10
- package/dist/types/config/index.d.ts +14 -16
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types/create-payload/index.d.ts +1250 -1537
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types/custom-data/index.d.ts +1 -1
- package/dist/types/custom-mark/index.d.ts +1 -1
- package/dist/types/custom-spans/index.d.ts +1 -1
- package/dist/types/custom-timings/index.d.ts +2 -2
- package/dist/types/generate-id/index.d.ts +2 -1
- package/dist/types/hidden-timing/index.d.ts +1 -1
- package/dist/types/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types/interaction-context/index.d.ts +3 -3
- package/dist/types/interaction-metrics/index.d.ts +42 -42
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types/resource-timing/utils.d.ts +1 -1
- package/dist/types/round-number/index.d.ts +1 -1
- package/dist/types/route-name/index.d.ts +4 -3
- package/dist/types/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types/self-measurements/index.d.ts +57 -0
- package/dist/types/set-interaction-error/index.d.ts +1 -1
- package/dist/types/short-id/index.d.ts +2 -1
- package/dist/types/ssr/index.d.ts +5 -5
- package/dist/types/trace-interaction/index.d.ts +2 -1
- package/dist/types/trace-pageload/index.d.ts +3 -2
- package/dist/types/trace-press/index.d.ts +2 -1
- package/dist/types/trace-redirect/index.d.ts +2 -1
- package/dist/types/trace-transition/index.d.ts +2 -1
- package/dist/types/vc/index.d.ts +2 -2
- package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types/vc/vc-observer/index.d.ts +4 -4
- package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types-ts4.5/assets/index.d.ts +3 -1
- package/dist/types-ts4.5/assets/utils.d.ts +1 -1
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/coinflip/index.d.ts +2 -1
- package/dist/types-ts4.5/common/index.d.ts +2 -1
- package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +177 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +20 -10
- package/dist/types-ts4.5/config/index.d.ts +14 -20
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types-ts4.5/create-payload/index.d.ts +1250 -1537
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types-ts4.5/custom-data/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-mark/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-spans/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-timings/index.d.ts +2 -2
- package/dist/types-ts4.5/generate-id/index.d.ts +2 -1
- package/dist/types-ts4.5/hidden-timing/index.d.ts +1 -1
- package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/interaction-context/index.d.ts +3 -3
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +42 -42
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types-ts4.5/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -1
- package/dist/types-ts4.5/round-number/index.d.ts +1 -1
- package/dist/types-ts4.5/route-name/index.d.ts +4 -3
- package/dist/types-ts4.5/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types-ts4.5/self-measurements/index.d.ts +57 -0
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +1 -1
- package/dist/types-ts4.5/short-id/index.d.ts +2 -1
- package/dist/types-ts4.5/ssr/index.d.ts +5 -5
- package/dist/types-ts4.5/trace-interaction/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-pageload/index.d.ts +3 -2
- package/dist/types-ts4.5/trace-press/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-redirect/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-transition/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/package.json +12 -12
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../self-measurements';
|
|
3
3
|
const ANCESTOR_LOOKUP_LIMIT = 10;
|
|
4
4
|
export class SSRPlaceholderHandlers {
|
|
5
5
|
constructor() {
|
|
@@ -7,7 +7,7 @@ export class SSRPlaceholderHandlers {
|
|
|
7
7
|
_defineProperty(this, "callbacks", new Map());
|
|
8
8
|
_defineProperty(this, "getSizeCallbacks", new Map());
|
|
9
9
|
_defineProperty(this, "reactValidateCallbacks", new Map());
|
|
10
|
-
_defineProperty(this, "EQUALITY_THRESHOLD",
|
|
10
|
+
_defineProperty(this, "EQUALITY_THRESHOLD", 1);
|
|
11
11
|
_defineProperty(this, "intersectionObserverCallback", ({
|
|
12
12
|
target,
|
|
13
13
|
boundingClientRect
|
|
@@ -60,6 +60,7 @@ export class SSRPlaceholderHandlers {
|
|
|
60
60
|
this.reactValidateCallbacks.delete(staticKey);
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
+
const operationTimer = markProfilingStart('SSRPlaceholderHandlers constructor');
|
|
63
64
|
if (typeof IntersectionObserver === 'function') {
|
|
64
65
|
// Only instantiate the IntersectionObserver if it's supported
|
|
65
66
|
this.intersectionObserver = new IntersectionObserver(entries => entries.filter(entry => entry.intersectionRatio > 0).forEach(this.intersectionObserverCallback));
|
|
@@ -95,6 +96,20 @@ export class SSRPlaceholderHandlers {
|
|
|
95
96
|
delete window.__SSR_PLACEHOLDERS_DIMENSIONS__;
|
|
96
97
|
}
|
|
97
98
|
}
|
|
99
|
+
this.clear = withProfiling(this.clear.bind(this), ['vc']);
|
|
100
|
+
this.isPlaceholder = withProfiling(this.isPlaceholder.bind(this), ['vc']);
|
|
101
|
+
this.isPlaceholderReplacement = withProfiling(this.isPlaceholderReplacement.bind(this), ['vc']);
|
|
102
|
+
this.isPlaceholderIgnored = withProfiling(this.isPlaceholderIgnored.bind(this), ['vc']);
|
|
103
|
+
this.findNearestPlaceholderContainerIfIgnored = withProfiling(this.findNearestPlaceholderContainerIfIgnored.bind(this), ['vc']);
|
|
104
|
+
this.checkIfExistedAndSizeMatching = withProfiling(this.checkIfExistedAndSizeMatching.bind(this), ['vc']);
|
|
105
|
+
this.getSize = withProfiling(this.getSize.bind(this), ['vc']);
|
|
106
|
+
this.validateReactComponentMatchToPlaceholder = withProfiling(this.validateReactComponentMatchToPlaceholder.bind(this), ['vc']);
|
|
107
|
+
this.hasSameSizePosition = withProfiling(this.hasSameSizePosition.bind(this), ['vc']);
|
|
108
|
+
this.isDummyRect = withProfiling(this.isDummyRect.bind(this), ['vc']);
|
|
109
|
+
this.intersectionObserverCallback = withProfiling(this.intersectionObserverCallback.bind(this), ['vc']);
|
|
110
|
+
markProfilingEnd(operationTimer, {
|
|
111
|
+
tags: ['vc']
|
|
112
|
+
});
|
|
98
113
|
}
|
|
99
114
|
clear() {
|
|
100
115
|
this.staticPlaceholders = new Map();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { withProfiling } from '../../../self-measurements';
|
|
3
3
|
import { ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
4
4
|
const legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view', 'editor-container-mutation'];
|
|
5
5
|
export class FY25_01Classifier extends ViewportUpdateClassifier {
|
|
@@ -14,12 +14,11 @@ export class FY25_01Classifier extends ViewportUpdateClassifier {
|
|
|
14
14
|
entries.reduce((acc = 0, v) => {
|
|
15
15
|
let VCRatio = v[1] / totalPainted + acc;
|
|
16
16
|
const time = v[0];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
17
|
+
|
|
18
|
+
// @todo apply fix to include small changes into accumulator
|
|
19
|
+
const preciseCurrRatio = Math.round(100 * (v[1] / totalPainted));
|
|
20
|
+
const preciseAccRatio = Math.round(acc * 100);
|
|
21
|
+
VCRatio = (preciseCurrRatio + preciseAccRatio) / 100;
|
|
23
22
|
VCParts.forEach(value => {
|
|
24
23
|
if ((VC[value] === null || VC[value] === undefined) && VCRatio >= value / 100) {
|
|
25
24
|
var _componentsLog$time;
|
|
@@ -52,6 +51,7 @@ export class FY25_01Classifier extends ViewportUpdateClassifier {
|
|
|
52
51
|
}
|
|
53
52
|
}]);
|
|
54
53
|
this.mergeConfig();
|
|
54
|
+
this.VCCalculationMethod = withProfiling(this.VCCalculationMethod.bind(this), ['vc']);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
export const revFY25_01Classifier = new FY25_01Classifier();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { withProfiling } from '../../../self-measurements';
|
|
2
3
|
import { FY25_01Classifier } from './fy25_01';
|
|
3
4
|
export class FY25_02Classifier extends FY25_01Classifier {
|
|
4
5
|
// @todo remove it once fixed as described: https://product-fabric.atlassian.net/browse/AFO-3443
|
|
@@ -30,6 +31,7 @@ export class FY25_02Classifier extends FY25_01Classifier {
|
|
|
30
31
|
}]);
|
|
31
32
|
_defineProperty(this, "removedFilters", []);
|
|
32
33
|
this.mergeConfig();
|
|
34
|
+
this.filterComponentsLog = withProfiling(this.filterComponentsLog.bind(this), ['vc']);
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
export const revFY25_02Classifier = new FY25_02Classifier();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import { withProfiling } from '../../../self-measurements';
|
|
2
3
|
import { revFY25_01Classifier } from './fy25_01';
|
|
3
4
|
import { revFY25_02Classifier } from './fy25_02';
|
|
4
|
-
export const getRevisions = ()
|
|
5
|
+
export const getRevisions = withProfiling(function getRevisions() {
|
|
5
6
|
if (fg('platform_ufo_disable_ttvc_v1')) {
|
|
6
7
|
return [{
|
|
7
8
|
name: 'fy25.02',
|
|
@@ -15,4 +16,4 @@ export const getRevisions = () => {
|
|
|
15
16
|
name: 'fy25.02',
|
|
16
17
|
classifier: revFY25_02Classifier
|
|
17
18
|
}];
|
|
18
|
-
};
|
|
19
|
+
}, ['vc']);
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
2
3
|
export default class EntriesTimeline {
|
|
3
4
|
constructor() {
|
|
4
5
|
_defineProperty(this, "unorderedEntries", []);
|
|
5
6
|
_defineProperty(this, "sortedEntriesCache", new Map());
|
|
7
|
+
const operationTimer = markProfilingStart('EntriesTimeline constructor');
|
|
6
8
|
this.unorderedEntries = [];
|
|
9
|
+
this.push = withProfiling(this.push.bind(this), ['vc']);
|
|
10
|
+
this.getCacheKey = withProfiling(this.getCacheKey.bind(this), ['vc']);
|
|
11
|
+
this.getOrderedEntries = withProfiling(this.getOrderedEntries.bind(this), ['vc']);
|
|
12
|
+
this.clear = withProfiling(this.clear.bind(this), ['vc']);
|
|
13
|
+
markProfilingEnd(operationTimer, {
|
|
14
|
+
tags: ['vc']
|
|
15
|
+
});
|
|
7
16
|
}
|
|
8
17
|
push(entry) {
|
|
9
18
|
this.unorderedEntries.push(entry);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { withProfiling } from '../../self-measurements';
|
|
1
2
|
const nameCache = new WeakMap();
|
|
2
|
-
|
|
3
|
+
const getElementName = withProfiling(function getElementName(selectorConfig, element) {
|
|
3
4
|
if (!(element instanceof HTMLElement)) {
|
|
4
5
|
return 'error';
|
|
5
6
|
}
|
|
@@ -64,4 +65,5 @@ export default function getElementName(selectorConfig, element) {
|
|
|
64
65
|
const name = `${tagName}${attributes || classList}`;
|
|
65
66
|
nameCache.set(element, name);
|
|
66
67
|
return name;
|
|
67
|
-
}
|
|
68
|
+
}, ['vc']);
|
|
69
|
+
export default getElementName;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
import { withProfiling } from '../../self-measurements';
|
|
1
2
|
const nameCache = new WeakMap();
|
|
2
|
-
function getAttributeSelector(element, attributeName) {
|
|
3
|
+
const getAttributeSelector = withProfiling(function getAttributeSelector(element, attributeName) {
|
|
3
4
|
const attrValue = element.getAttribute(attributeName);
|
|
4
5
|
if (!attrValue) {
|
|
5
6
|
return '';
|
|
6
7
|
}
|
|
7
8
|
return `[${attributeName}="${attrValue}"]`;
|
|
8
|
-
}
|
|
9
|
-
function isValidSelector(selector) {
|
|
9
|
+
}, ['vc']);
|
|
10
|
+
const isValidSelector = withProfiling(function isValidSelector(selector) {
|
|
10
11
|
try {
|
|
11
12
|
document.querySelector(selector);
|
|
12
13
|
return true;
|
|
13
14
|
} catch (err) {
|
|
14
15
|
return false;
|
|
15
16
|
}
|
|
16
|
-
}
|
|
17
|
-
function isSelectorUnique(selector) {
|
|
17
|
+
}, ['vc']);
|
|
18
|
+
const isSelectorUnique = withProfiling(function isSelectorUnique(selector) {
|
|
18
19
|
return document.querySelectorAll(selector).length === 1;
|
|
19
|
-
}
|
|
20
|
-
function getUniqueSelector(selectorConfig, element) {
|
|
20
|
+
}, ['vc']);
|
|
21
|
+
const getUniqueSelector = withProfiling(function getUniqueSelector(selectorConfig, element) {
|
|
21
22
|
let currentElement = element;
|
|
22
23
|
const parts = [];
|
|
23
24
|
const MAX_DEPTH = 3;
|
|
@@ -59,8 +60,8 @@ function getUniqueSelector(selectorConfig, element) {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
return potentialSelector;
|
|
62
|
-
}
|
|
63
|
-
|
|
63
|
+
}, ['vc']);
|
|
64
|
+
const getElementName = withProfiling(function getElementName(selectorConfig, element) {
|
|
64
65
|
if (!(element instanceof HTMLElement)) {
|
|
65
66
|
return 'error';
|
|
66
67
|
}
|
|
@@ -71,4 +72,5 @@ export default function getElementName(selectorConfig, element) {
|
|
|
71
72
|
const uniqueSelector = getUniqueSelector(selectorConfig, element);
|
|
72
73
|
nameCache.set(element, uniqueSelector);
|
|
73
74
|
return uniqueSelector;
|
|
74
|
-
}
|
|
75
|
+
}, ['vc']);
|
|
76
|
+
export default getElementName;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../self-measurements';
|
|
2
3
|
import EntriesTimeline from './entries-timeline';
|
|
3
4
|
import getElementName from './get-element-name';
|
|
4
5
|
import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
@@ -16,6 +17,7 @@ export default class VCObserverNew {
|
|
|
16
17
|
var _config$selectorConfi;
|
|
17
18
|
_defineProperty(this, "viewportObserver", null);
|
|
18
19
|
_defineProperty(this, "windowEventObserver", null);
|
|
20
|
+
const operationTimer = markProfilingStart('VCObserverNew constructor');
|
|
19
21
|
this.entriesTimeline = new EntriesTimeline();
|
|
20
22
|
this.selectorConfig = (_config$selectorConfi = config.selectorConfig) !== null && _config$selectorConfi !== void 0 ? _config$selectorConfi : DEFAULT_SELECTOR_CONFIG;
|
|
21
23
|
this.viewportObserver = new ViewportObserver({
|
|
@@ -61,6 +63,13 @@ export default class VCObserverNew {
|
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
});
|
|
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
|
+
});
|
|
64
73
|
}
|
|
65
74
|
start({
|
|
66
75
|
startTime
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { withProfiling } from '../../../self-measurements';
|
|
1
2
|
import calculateTTVCPercentiles from './percentile-calc';
|
|
2
3
|
import getViewportHeight from './utils/get-viewport-height';
|
|
3
4
|
import getViewportWidth from './utils/get-viewport-width';
|
|
4
5
|
export default class AbstractVCCalculatorBase {
|
|
5
6
|
constructor(revisionNo) {
|
|
6
7
|
this.revisionNo = revisionNo;
|
|
8
|
+
this.calculate = withProfiling(this.calculate.bind(this), ['vc']);
|
|
7
9
|
}
|
|
8
10
|
async calculate({
|
|
9
11
|
startTime,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
1
2
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
2
3
|
import isViewportEntryData from '../utils/is-viewport-entry-data';
|
|
3
4
|
const ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
|
|
@@ -11,6 +12,8 @@ export const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-ta
|
|
|
11
12
|
export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
12
13
|
constructor() {
|
|
13
14
|
super(REVISION_NO);
|
|
15
|
+
this.isEntryIncluded = withProfiling(this.isEntryIncluded.bind(this), ['vc']);
|
|
16
|
+
this.isVCClean = withProfiling(this.isVCClean.bind(this), ['vc']);
|
|
14
17
|
}
|
|
15
18
|
isEntryIncluded(entry) {
|
|
16
19
|
if (!CONSIDERED_ENTRY_TYPE.includes(entry.type)) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
|
|
1
2
|
import taskYield from '../../utils/task-yield';
|
|
2
3
|
|
|
3
4
|
// 24-bit color value
|
|
@@ -25,6 +26,7 @@ export class ViewportCanvas {
|
|
|
25
26
|
* @throws {Error} If canvas context cannot be obtained
|
|
26
27
|
*/
|
|
27
28
|
constructor(viewport, scaleFactor = 1) {
|
|
29
|
+
const operationTimer = markProfilingStart('ViewportCanvas constructor');
|
|
28
30
|
this.scaleFactor = scaleFactor;
|
|
29
31
|
this.colorCounter = 1;
|
|
30
32
|
this.colorTimeMap = new Map();
|
|
@@ -54,6 +56,14 @@ export class ViewportCanvas {
|
|
|
54
56
|
this.ctx = ctx;
|
|
55
57
|
this.ctx.globalCompositeOperation = 'source-over';
|
|
56
58
|
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
|
+
});
|
|
57
67
|
}
|
|
58
68
|
getScaledDimensions() {
|
|
59
69
|
return {
|
|
@@ -148,7 +158,7 @@ export class ViewportCanvas {
|
|
|
148
158
|
* @param number - The input number to be split into RGB components.
|
|
149
159
|
* @returns The RGB color string in the format "rgb(r, g, b)".
|
|
150
160
|
*/
|
|
151
|
-
export function getRGBComponents(n) {
|
|
161
|
+
export const getRGBComponents = withProfiling(function getRGBComponents(n) {
|
|
152
162
|
// Ensure the input is within the valid range for a 24-bit color
|
|
153
163
|
if (n < 0 || n > 0xffffff) {
|
|
154
164
|
throw new Error('Input number must be between 0 and 16777215 (inclusive).');
|
|
@@ -163,7 +173,7 @@ export function getRGBComponents(n) {
|
|
|
163
173
|
// Extract red component (bits 16-23)
|
|
164
174
|
const red = n >> 16 & 0xff;
|
|
165
175
|
return `rgb(${red}, ${green}, ${blue})`;
|
|
166
|
-
}
|
|
176
|
+
}, ['vc']);
|
|
167
177
|
|
|
168
178
|
/**
|
|
169
179
|
* Calculates the number of pixels drawn for each color in the image data.
|
|
@@ -172,7 +182,7 @@ export function getRGBComponents(n) {
|
|
|
172
182
|
* @param arraySize - The amount of timestamps that were drawn in the viewport
|
|
173
183
|
* @returns A Map containing color to pixel count mappings.
|
|
174
184
|
*/
|
|
175
|
-
export async function calculateDrawnPixelsRaw(imageData, scaleFactor, arraySize) {
|
|
185
|
+
export const calculateDrawnPixelsRaw = withProfiling(async function calculateDrawnPixelsRaw(imageData, scaleFactor, arraySize) {
|
|
176
186
|
const data = imageData.data;
|
|
177
187
|
const arr = new Uint32Array(arraySize);
|
|
178
188
|
for (let i = 0; i < data.length; i += 4) {
|
|
@@ -192,4 +202,4 @@ export async function calculateDrawnPixelsRaw(imageData, scaleFactor, arraySize)
|
|
|
192
202
|
}
|
|
193
203
|
}
|
|
194
204
|
return arr;
|
|
195
|
-
}
|
|
205
|
+
}, ['vc']);
|
package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
2
3
|
import { ViewportCanvas } from './canvas-pixel';
|
|
3
|
-
|
|
4
|
+
const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles({
|
|
4
5
|
viewport,
|
|
5
6
|
orderedEntries,
|
|
6
7
|
percentiles,
|
|
@@ -26,8 +27,9 @@ export default async function calculateTTVCPercentiles({
|
|
|
26
27
|
const canvasDimenstions = canvas.getScaledDimensions();
|
|
27
28
|
const totalPixels = canvasDimenstions.width * canvasDimenstions.height;
|
|
28
29
|
return calculatePercentiles(timePixelCounts, elementMap, percentiles, totalPixels, startTime);
|
|
29
|
-
}
|
|
30
|
-
export
|
|
30
|
+
}, ['vc']);
|
|
31
|
+
export default calculateTTVCPercentiles;
|
|
32
|
+
export const calculatePercentiles = withProfiling(function calculatePercentiles(timePixelCounts, elementMap, unorderedPercentiles, totalPixels, startTime) {
|
|
31
33
|
const results = {};
|
|
32
34
|
let cumulativePixels = 0;
|
|
33
35
|
const percentiles = unorderedPercentiles.sort((a, b) => a - b);
|
|
@@ -69,4 +71,4 @@ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPerce
|
|
|
69
71
|
previousResult = results[`${percentile}`];
|
|
70
72
|
}
|
|
71
73
|
return results;
|
|
72
|
-
}
|
|
74
|
+
}, ['vc']);
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
|
|
1
2
|
import isViewportEntryData from '../../utils/is-viewport-entry-data';
|
|
2
3
|
import taskYield from '../../utils/task-yield';
|
|
3
4
|
const MAX_HEATMAP_SIZE = 1000;
|
|
4
|
-
function createEmptyHeatmapEntry() {
|
|
5
|
+
const createEmptyHeatmapEntry = withProfiling(function createEmptyHeatmapEntry() {
|
|
5
6
|
return {
|
|
6
7
|
head: null,
|
|
7
8
|
previousEntries: []
|
|
8
9
|
};
|
|
9
|
-
}
|
|
10
|
-
function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
10
|
+
}, ['vc']);
|
|
11
|
+
const createEmptyMap = withProfiling(function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
11
12
|
return Array.from({
|
|
12
13
|
length: heatmapHeight
|
|
13
14
|
}).map(() => Array.from({
|
|
14
15
|
length: heatmapWidth
|
|
15
16
|
}).map(createEmptyHeatmapEntry));
|
|
16
|
-
}
|
|
17
|
-
function isRectInside(a, b) {
|
|
17
|
+
}, ['vc']);
|
|
18
|
+
const isRectInside = withProfiling(function isRectInside(a, b) {
|
|
18
19
|
if (!a || !b) {
|
|
19
20
|
return false;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
// Check if all corners of rectangle a are within the bounds of rectangle b
|
|
23
24
|
return a.left >= b.left && a.right <= b.right && a.top >= b.top && a.bottom <= b.bottom;
|
|
24
|
-
}
|
|
25
|
+
}, ['vc']);
|
|
25
26
|
export default class Heatmap {
|
|
26
27
|
/**
|
|
27
28
|
* Heatmap Width
|
|
@@ -39,6 +40,8 @@ export default class Heatmap {
|
|
|
39
40
|
viewport,
|
|
40
41
|
heatmapSize
|
|
41
42
|
}) {
|
|
43
|
+
const operationTimer = markProfilingStart('Heatmap constructor');
|
|
44
|
+
|
|
42
45
|
// TODO timeOrigin? do we need? for SSR??
|
|
43
46
|
this.viewport = viewport;
|
|
44
47
|
const safeSize = Math.min(heatmapSize, MAX_HEATMAP_SIZE);
|
|
@@ -65,6 +68,15 @@ export default class Heatmap {
|
|
|
65
68
|
this.scaleY = this.height / viewport.height;
|
|
66
69
|
this.heatmapAreaSize = this.width * this.height;
|
|
67
70
|
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
|
+
});
|
|
68
80
|
}
|
|
69
81
|
getHeatmap() {
|
|
70
82
|
return this.map;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
|
|
1
2
|
import isViewportEntryData from '../../utils/is-viewport-entry-data';
|
|
2
3
|
import taskYield from '../../utils/task-yield';
|
|
3
4
|
const MAX_HEATMAP_SIZE = 1000;
|
|
4
|
-
function createEmptyHeatmapEntry() {
|
|
5
|
+
const createEmptyHeatmapEntry = withProfiling(function createEmptyHeatmapEntry() {
|
|
5
6
|
return {
|
|
6
7
|
head: null,
|
|
7
8
|
previousEntries: []
|
|
8
9
|
};
|
|
9
|
-
}
|
|
10
|
-
function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
10
|
+
}, ['vc']);
|
|
11
|
+
const createEmptyMap = withProfiling(function createEmptyMap(heatmapWidth, heatmapHeight) {
|
|
11
12
|
return Array.from({
|
|
12
13
|
length: heatmapHeight
|
|
13
14
|
}).map(() => Array.from({
|
|
14
15
|
length: heatmapWidth
|
|
15
16
|
}).map(createEmptyHeatmapEntry));
|
|
16
|
-
}
|
|
17
|
-
function isRectInside(a, b) {
|
|
17
|
+
}, ['vc']);
|
|
18
|
+
const isRectInside = withProfiling(function isRectInside(a, b) {
|
|
18
19
|
if (!a || !b) {
|
|
19
20
|
return false;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
// Check if all corners of rectangle a are within the bounds of rectangle b
|
|
23
24
|
return a.left >= b.left && a.right <= b.right && a.top >= b.top && a.bottom <= b.bottom;
|
|
24
|
-
}
|
|
25
|
+
}, ['vc']);
|
|
25
26
|
class Heatmap {
|
|
26
27
|
/**
|
|
27
28
|
* Heatmap Width
|
|
@@ -39,6 +40,8 @@ class Heatmap {
|
|
|
39
40
|
viewport,
|
|
40
41
|
heatmapSize
|
|
41
42
|
}) {
|
|
43
|
+
const operationTimer = markProfilingStart('Heatmap constructor');
|
|
44
|
+
|
|
42
45
|
// TODO timeOrigin? do we need? for SSR??
|
|
43
46
|
this.viewport = viewport;
|
|
44
47
|
const safeSize = Math.min(heatmapSize, MAX_HEATMAP_SIZE);
|
|
@@ -65,6 +68,15 @@ class Heatmap {
|
|
|
65
68
|
this.scaleY = this.height / viewport.height;
|
|
66
69
|
this.heatmapAreaSize = this.width * this.height;
|
|
67
70
|
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
|
+
});
|
|
68
80
|
}
|
|
69
81
|
getHeatmap() {
|
|
70
82
|
return this.map;
|
|
@@ -246,7 +258,7 @@ class Heatmap {
|
|
|
246
258
|
return result;
|
|
247
259
|
}
|
|
248
260
|
}
|
|
249
|
-
|
|
261
|
+
const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles({
|
|
250
262
|
orderedEntries,
|
|
251
263
|
viewport,
|
|
252
264
|
percentiles,
|
|
@@ -259,4 +271,5 @@ export default async function calculateTTVCPercentiles({
|
|
|
259
271
|
await heatmap.applyEntriesToHeatmap(orderedEntries);
|
|
260
272
|
const vcDetails = await heatmap.getVCPercentMetrics(percentiles, startTime);
|
|
261
273
|
return vcDetails;
|
|
262
|
-
}
|
|
274
|
+
}, ['vc']);
|
|
275
|
+
export default calculateTTVCPercentiles;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
1
2
|
import calcUsingCanvas from './canvas-heatmap';
|
|
2
3
|
import caclUsingOldHeatmap from './heatmap';
|
|
3
4
|
import calcUsingRectSweepingLine from './rect-sweeping-line';
|
|
4
|
-
|
|
5
|
+
const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles(arg) {
|
|
5
6
|
const algo = 'canvas_heatmap';
|
|
6
7
|
if (algo === 'canvas_heatmap') {
|
|
7
8
|
const vcDetails = await calcUsingCanvas(arg);
|
|
@@ -16,4 +17,5 @@ export default async function calculateTTVCPercentiles(arg) {
|
|
|
16
17
|
return vcDetails;
|
|
17
18
|
}
|
|
18
19
|
throw new Error('unexpected Error algo not chosen correctly');
|
|
19
|
-
}
|
|
20
|
+
}, ['vc']);
|
|
21
|
+
export default calculateTTVCPercentiles;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
1
2
|
/**
|
|
2
3
|
* Calculate the union areas of all rectangles using Sweep Line Algorithm
|
|
3
4
|
*
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
* @param rectangles
|
|
9
10
|
* @returns
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
const calculateUnionArea = withProfiling(function calculateUnionArea(rectangles) {
|
|
12
13
|
// Step 1: Create sweep line events
|
|
13
14
|
const events = createSweepLineEvents(rectangles);
|
|
14
15
|
|
|
@@ -27,8 +28,9 @@ export default function calculateUnionArea(rectangles) {
|
|
|
27
28
|
updateActiveIntervals(activeIntervals, event);
|
|
28
29
|
}
|
|
29
30
|
return totalArea;
|
|
30
|
-
}
|
|
31
|
-
|
|
31
|
+
}, ['vc']);
|
|
32
|
+
export default calculateUnionArea;
|
|
33
|
+
const createSweepLineEvents = withProfiling(function createSweepLineEvents(rectangles) {
|
|
32
34
|
const events = [];
|
|
33
35
|
for (const rect of rectangles) {
|
|
34
36
|
// Create start and end events for each rectangle
|
|
@@ -47,8 +49,8 @@ function createSweepLineEvents(rectangles) {
|
|
|
47
49
|
}
|
|
48
50
|
// Sort events by x-coordinate (and type as tiebreaker)
|
|
49
51
|
return events.sort((a, b) => a.x === b.x ? a.type === 'end' ? 1 : -1 : a.x - b.x);
|
|
50
|
-
}
|
|
51
|
-
function calculateActiveHeight(intervals) {
|
|
52
|
+
}, ['vc']);
|
|
53
|
+
const calculateActiveHeight = withProfiling(function calculateActiveHeight(intervals) {
|
|
52
54
|
if (intervals.size === 0) {
|
|
53
55
|
return 0;
|
|
54
56
|
}
|
|
@@ -82,8 +84,8 @@ function calculateActiveHeight(intervals) {
|
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
return totalHeight;
|
|
85
|
-
}
|
|
86
|
-
function updateActiveIntervals(intervals, event) {
|
|
87
|
+
}, ['vc']);
|
|
88
|
+
const updateActiveIntervals = withProfiling(function updateActiveIntervals(intervals, event) {
|
|
87
89
|
const key = `${event.top},${event.bottom}`;
|
|
88
90
|
if (event.type === 'start') {
|
|
89
91
|
intervals.set(key, (intervals.get(key) || 0) + 1);
|
|
@@ -95,4 +97,4 @@ function updateActiveIntervals(intervals, event) {
|
|
|
95
97
|
intervals.delete(key);
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
}
|
|
100
|
+
}, ['vc']);
|
package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
1
2
|
import isViewportEntryData from '../../utils/is-viewport-entry-data';
|
|
2
3
|
import taskYield from '../../utils/task-yield';
|
|
3
4
|
import calculateUnionArea from './calc-union-area';
|
|
4
|
-
|
|
5
|
+
const calculateTTVCPercentiles = withProfiling(async function calculateTTVCPercentiles({
|
|
5
6
|
orderedEntries,
|
|
6
7
|
viewport,
|
|
7
8
|
percentiles,
|
|
@@ -56,4 +57,5 @@ export default async function calculateTTVCPercentiles({
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
return checkpoints;
|
|
59
|
-
}
|
|
60
|
+
}, ['vc']);
|
|
61
|
+
export default calculateTTVCPercentiles;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
const getViewportHeight = withProfiling(function getViewportHeight(document = window.document) {
|
|
2
3
|
let documentHeight;
|
|
3
4
|
try {
|
|
4
5
|
documentHeight = document.documentElement.clientHeight || 0;
|
|
@@ -6,4 +7,5 @@ export default function getViewportHeight(document = window.document) {
|
|
|
6
7
|
documentHeight = 0;
|
|
7
8
|
}
|
|
8
9
|
return Math.max(documentHeight, window.innerHeight || 0);
|
|
9
|
-
}
|
|
10
|
+
}, ['vc']);
|
|
11
|
+
export default getViewportHeight;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
const getViewportWidth = withProfiling(function getViewportWidth(document = window.document) {
|
|
2
3
|
let documentWidth;
|
|
3
4
|
try {
|
|
4
5
|
documentWidth = document.documentElement.clientWidth || 0;
|
|
@@ -6,4 +7,5 @@ export default function getViewportWidth(document = window.document) {
|
|
|
6
7
|
documentWidth = 0;
|
|
7
8
|
}
|
|
8
9
|
return Math.max(documentWidth, window.innerWidth || 0);
|
|
9
|
-
}
|
|
10
|
+
}, ['vc']);
|
|
11
|
+
export default getViewportWidth;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
const isViewportEntryData = withProfiling(function isViewportEntryData(data) {
|
|
2
3
|
if (data) {
|
|
3
4
|
const hasElementName = typeof data.elementName === 'string';
|
|
4
5
|
const hasRect = typeof data.rect !== 'undefined';
|
|
@@ -7,4 +8,5 @@ export default function isViewportEntryData(data) {
|
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
10
|
return false;
|
|
10
|
-
}
|
|
11
|
+
}, ['vc']);
|
|
12
|
+
export default isViewportEntryData;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
|
|
1
3
|
// See https://developer.mozilla.org/en-US/docs/Web/API/Prioritized_Task_Scheduling_API
|
|
2
|
-
|
|
4
|
+
const taskYield = withProfiling(async function taskYield() {
|
|
3
5
|
// This is using globalThis to allow the yield task to be used outside of a browser env
|
|
4
6
|
if ('scheduler' in globalThis &&
|
|
5
7
|
// @ts-ignore
|
|
@@ -14,4 +16,5 @@ export default async function taskYield() {
|
|
|
14
16
|
});
|
|
15
17
|
setTimeout(resolve, 0);
|
|
16
18
|
await p;
|
|
17
|
-
}
|
|
19
|
+
}, ['vc']);
|
|
20
|
+
export default taskYield;
|