@atlaskit/react-ufo 3.4.14 → 3.5.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.
- package/CHANGELOG.md +8 -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 +25 -19
- 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 +6 -3
- package/dist/cjs/segment/segment.js +7 -3
- 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 -22
- 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 +172 -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 -3
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +16 -0
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +2 -0
- 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 +31 -17
- 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 +5 -2
- package/dist/es2019/segment/segment.js +7 -3
- 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 -21
- 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 +160 -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 -2
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +16 -0
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +2 -0
- 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 +25 -19
- 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 +5 -2
- package/dist/esm/segment/segment.js +7 -3
- 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 -21
- 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 +172 -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 -2
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +16 -0
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +2 -0
- 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 +10 -1
|
@@ -5,6 +5,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { shouldHandleEditorLnv } from '../../../config';
|
|
8
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
8
9
|
import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
|
|
9
10
|
import { EditorLnvHandler } from './editor-lnv';
|
|
10
11
|
import isNonVisualStyleMutation from './non-visual-styles/is-non-visual-style-mutation';
|
|
@@ -14,7 +15,7 @@ var state = {
|
|
|
14
15
|
waitingForFirstRender: 2,
|
|
15
16
|
ignoring: 3
|
|
16
17
|
};
|
|
17
|
-
function isElementVisible(target) {
|
|
18
|
+
var isElementVisible = withProfiling(function isElementVisible(target) {
|
|
18
19
|
if (!target || typeof target.checkVisibility !== 'function') {
|
|
19
20
|
return true;
|
|
20
21
|
}
|
|
@@ -24,13 +25,13 @@ function isElementVisible(target) {
|
|
|
24
25
|
visibilityProperty: true
|
|
25
26
|
});
|
|
26
27
|
return isVisible;
|
|
27
|
-
}
|
|
28
|
-
function isInsideEditorContainer(target) {
|
|
28
|
+
}, ['vc']);
|
|
29
|
+
var isInsideEditorContainer = withProfiling(function isInsideEditorContainer(target) {
|
|
29
30
|
if (!target || typeof target.closest !== 'function') {
|
|
30
31
|
return false;
|
|
31
32
|
}
|
|
32
33
|
return Boolean(target.closest('.ProseMirror'));
|
|
33
|
-
}
|
|
34
|
+
}, ['vc']);
|
|
34
35
|
export var Observers = /*#__PURE__*/function () {
|
|
35
36
|
function Observers(opts) {
|
|
36
37
|
var _this = this;
|
|
@@ -56,20 +57,51 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
56
57
|
_defineProperty(this, "subscribeResults", function (cb) {
|
|
57
58
|
_this.callbacks.add(cb);
|
|
58
59
|
});
|
|
59
|
-
_defineProperty(this, "observeElement", function (node, mutation, type, ignoreReason) {
|
|
60
|
+
_defineProperty(this, "observeElement", function (node, mutation, type, ignoreReason, attributeName) {
|
|
60
61
|
var _this$intersectionObs;
|
|
62
|
+
var oldValue = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
|
|
63
|
+
var newValue = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
|
|
61
64
|
(_this$intersectionObs = _this.intersectionObserver) === null || _this$intersectionObs === void 0 || _this$intersectionObs.observe(node);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
if (fg('platform_ufo_log_attr_mutation_values')) {
|
|
66
|
+
_this.observedMutations.set(node, {
|
|
67
|
+
mutation: mutation,
|
|
68
|
+
ignoreReason: ignoreReason,
|
|
69
|
+
type: type,
|
|
70
|
+
attributeName: attributeName,
|
|
71
|
+
oldValue: oldValue,
|
|
72
|
+
newValue: newValue
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
_this.observedMutations.set(node, {
|
|
76
|
+
mutation: mutation,
|
|
77
|
+
ignoreReason: ignoreReason,
|
|
78
|
+
type: type
|
|
79
|
+
});
|
|
80
|
+
}
|
|
67
81
|
});
|
|
82
|
+
var operationTimer = markProfilingStart('Observers constructor');
|
|
68
83
|
this.selectorConfig = _objectSpread(_objectSpread({}, this.selectorConfig), opts.selectorConfig);
|
|
69
84
|
this.intersectionObserver = this.getIntersectionObserver();
|
|
70
85
|
this.mutationObserver = this.getMutationObserver();
|
|
71
86
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers();
|
|
72
87
|
this.editorLnvHandler = new EditorLnvHandler();
|
|
88
|
+
this.isBrowserSupported = withProfiling(this.isBrowserSupported.bind(this), ['vc']);
|
|
89
|
+
this.observe = withProfiling(this.observe.bind(this), ['vc']);
|
|
90
|
+
this.disconnect = withProfiling(this.disconnect.bind(this), ['vc']);
|
|
91
|
+
this.subscribeResults = withProfiling(this.subscribeResults.bind(this), ['vc']);
|
|
92
|
+
this.getTotalTime = withProfiling(this.getTotalTime.bind(this), ['vc']);
|
|
93
|
+
this.setReactRootElement = withProfiling(this.setReactRootElement.bind(this), ['vc']);
|
|
94
|
+
this.setReactRootRenderStart = withProfiling(this.setReactRootRenderStart.bind(this), ['vc']);
|
|
95
|
+
this.setReactRootRenderStop = withProfiling(this.setReactRootRenderStop.bind(this), ['vc']);
|
|
96
|
+
this.observeElement = withProfiling(this.observeElement.bind(this), ['vc']);
|
|
97
|
+
this.getMutationObserver = withProfiling(this.getMutationObserver.bind(this), ['vc']);
|
|
98
|
+
this.getElementName = withProfiling(this.getElementName.bind(this), ['vc']);
|
|
99
|
+
this.getIntersectionObserver = withProfiling(this.getIntersectionObserver.bind(this), ['vc']);
|
|
100
|
+
this.measureStart = withProfiling(this.measureStart.bind(this), ['vc']);
|
|
101
|
+
this.measureStop = withProfiling(this.measureStop.bind(this), ['vc']);
|
|
102
|
+
markProfilingEnd(operationTimer, {
|
|
103
|
+
tags: ['vc']
|
|
104
|
+
});
|
|
73
105
|
}
|
|
74
106
|
return _createClass(Observers, [{
|
|
75
107
|
key: "isBrowserSupported",
|
|
@@ -135,8 +167,12 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
135
167
|
key: "getMutationObserver",
|
|
136
168
|
value: function getMutationObserver() {
|
|
137
169
|
var _this2 = this;
|
|
170
|
+
if (!this.isBrowserSupported()) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
138
173
|
var shouldHandleEditorLnvLocal = shouldHandleEditorLnv();
|
|
139
|
-
return
|
|
174
|
+
return new MutationObserver(function (mutations) {
|
|
175
|
+
var operationTimer = markProfilingStart('mutationObserverCallback');
|
|
140
176
|
_this2.measureStart();
|
|
141
177
|
mutations.forEach(function (mutation) {
|
|
142
178
|
// patching element if timestamp not automatically added
|
|
@@ -205,34 +241,48 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
205
241
|
});
|
|
206
242
|
} else if (mutation.type === 'attributes') {
|
|
207
243
|
if (mutation.target instanceof HTMLElement) {
|
|
244
|
+
var attributeName = mutation.attributeName;
|
|
208
245
|
if (fg('platform_ufo_vc_ignore_same_value_mutation')) {
|
|
209
246
|
var _mutation$oldValue;
|
|
210
247
|
/*
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
248
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
249
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
250
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
251
|
+
and whether or not they are the same doesn't really matter.
|
|
252
|
+
And Custom elements should work the same way as MutationObserver."
|
|
253
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
254
|
+
*/
|
|
218
255
|
var oldValue = (_mutation$oldValue = mutation.oldValue) !== null && _mutation$oldValue !== void 0 ? _mutation$oldValue : undefined;
|
|
219
|
-
var newValue =
|
|
256
|
+
var newValue = attributeName ? mutation.target.getAttribute(attributeName) : undefined;
|
|
220
257
|
if (oldValue !== newValue) {
|
|
221
258
|
if (isNonVisualStyleMutation(mutation)) {
|
|
222
259
|
ignoreReason = 'non-visual-style';
|
|
223
260
|
}
|
|
224
|
-
|
|
261
|
+
if (fg('platform_ufo_vc_fix_ignore_image_mutation')) {
|
|
262
|
+
if (isContainedWithinMediaWrapper(mutation.target)) {
|
|
263
|
+
ignoreReason = 'image';
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName, oldValue, newValue);
|
|
225
267
|
}
|
|
226
268
|
} else {
|
|
227
269
|
if (isNonVisualStyleMutation(mutation)) {
|
|
228
270
|
ignoreReason = 'non-visual-style';
|
|
229
271
|
}
|
|
230
|
-
|
|
272
|
+
if (fg('platform_ufo_vc_fix_ignore_image_mutation')) {
|
|
273
|
+
if (isContainedWithinMediaWrapper(mutation.target)) {
|
|
274
|
+
ignoreReason = 'image';
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
_this2.observeElement(mutation.target, mutation, 'attr', ignoreReason, attributeName);
|
|
231
278
|
}
|
|
232
279
|
}
|
|
233
280
|
}
|
|
234
281
|
});
|
|
235
|
-
|
|
282
|
+
markProfilingEnd(operationTimer, {
|
|
283
|
+
tags: ['vc']
|
|
284
|
+
});
|
|
285
|
+
});
|
|
236
286
|
}
|
|
237
287
|
}, {
|
|
238
288
|
key: "getElementName",
|
|
@@ -265,7 +315,11 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
265
315
|
key: "getIntersectionObserver",
|
|
266
316
|
value: function getIntersectionObserver() {
|
|
267
317
|
var _this3 = this;
|
|
268
|
-
|
|
318
|
+
if (!this.isBrowserSupported()) {
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
return new IntersectionObserver(function (entries) {
|
|
322
|
+
var operationTimer = markProfilingStart('intersectionObserverCallback');
|
|
269
323
|
_this3.measureStart();
|
|
270
324
|
entries.forEach(function (_ref2) {
|
|
271
325
|
var isIntersecting = _ref2.isIntersecting,
|
|
@@ -296,7 +350,7 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
296
350
|
} catch (e) {
|
|
297
351
|
elementName = 'error';
|
|
298
352
|
}
|
|
299
|
-
callback(data.mutation.timestamp || performance.now(), ir, elementName, target, data.type, data.ignoreReason);
|
|
353
|
+
callback(data.mutation.timestamp || performance.now(), ir, elementName, target, data.type, data.ignoreReason, data.attributeName, data.oldValue, data.newValue);
|
|
300
354
|
});
|
|
301
355
|
_this3.elementsInView.add(target);
|
|
302
356
|
} else {
|
|
@@ -304,7 +358,10 @@ export var Observers = /*#__PURE__*/function () {
|
|
|
304
358
|
}
|
|
305
359
|
});
|
|
306
360
|
_this3.measureStop();
|
|
307
|
-
|
|
361
|
+
markProfilingEnd(operationTimer, {
|
|
362
|
+
tags: ['vc']
|
|
363
|
+
});
|
|
364
|
+
});
|
|
308
365
|
}
|
|
309
366
|
}, {
|
|
310
367
|
key: "measureStart",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Checks if a mutation record represents a non-visual style change
|
|
@@ -10,7 +11,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
10
11
|
* - The changed attribute is either 'class' or 'style'
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
var isNonVisualStyleMutation = withProfiling(function isNonVisualStyleMutation(_ref) {
|
|
14
15
|
var target = _ref.target,
|
|
15
16
|
attributeName = _ref.attributeName;
|
|
16
17
|
var isNonVisualStyleMutationEnabled = fg('platform_ufo_non_visual_style_mutation');
|
|
@@ -27,4 +28,5 @@ export default function isNonVisualStyleMutation(_ref) {
|
|
|
27
28
|
return false;
|
|
28
29
|
}
|
|
29
30
|
return true;
|
|
30
|
-
}
|
|
31
|
+
}, ['vc']);
|
|
32
|
+
export default isNonVisualStyleMutation;
|
|
@@ -2,6 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../self-measurements';
|
|
5
6
|
var ANCESTOR_LOOKUP_LIMIT = 10;
|
|
6
7
|
export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
7
8
|
function SSRPlaceholderHandlers() {
|
|
@@ -63,6 +64,7 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
|
63
64
|
_this.reactValidateCallbacks.delete(staticKey);
|
|
64
65
|
}
|
|
65
66
|
});
|
|
67
|
+
var operationTimer = markProfilingStart('SSRPlaceholderHandlers constructor');
|
|
66
68
|
if (typeof IntersectionObserver === 'function') {
|
|
67
69
|
// Only instantiate the IntersectionObserver if it's supported
|
|
68
70
|
this.intersectionObserver = new IntersectionObserver(function (entries) {
|
|
@@ -102,6 +104,20 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
|
|
|
102
104
|
delete window.__SSR_PLACEHOLDERS_DIMENSIONS__;
|
|
103
105
|
}
|
|
104
106
|
}
|
|
107
|
+
this.clear = withProfiling(this.clear.bind(this), ['vc']);
|
|
108
|
+
this.isPlaceholder = withProfiling(this.isPlaceholder.bind(this), ['vc']);
|
|
109
|
+
this.isPlaceholderReplacement = withProfiling(this.isPlaceholderReplacement.bind(this), ['vc']);
|
|
110
|
+
this.isPlaceholderIgnored = withProfiling(this.isPlaceholderIgnored.bind(this), ['vc']);
|
|
111
|
+
this.findNearestPlaceholderContainerIfIgnored = withProfiling(this.findNearestPlaceholderContainerIfIgnored.bind(this), ['vc']);
|
|
112
|
+
this.checkIfExistedAndSizeMatching = withProfiling(this.checkIfExistedAndSizeMatching.bind(this), ['vc']);
|
|
113
|
+
this.getSize = withProfiling(this.getSize.bind(this), ['vc']);
|
|
114
|
+
this.validateReactComponentMatchToPlaceholder = withProfiling(this.validateReactComponentMatchToPlaceholder.bind(this), ['vc']);
|
|
115
|
+
this.hasSameSizePosition = withProfiling(this.hasSameSizePosition.bind(this), ['vc']);
|
|
116
|
+
this.isDummyRect = withProfiling(this.isDummyRect.bind(this), ['vc']);
|
|
117
|
+
this.intersectionObserverCallback = withProfiling(this.intersectionObserverCallback.bind(this), ['vc']);
|
|
118
|
+
markProfilingEnd(operationTimer, {
|
|
119
|
+
tags: ['vc']
|
|
120
|
+
});
|
|
105
121
|
}
|
|
106
122
|
return _createClass(SSRPlaceholderHandlers, [{
|
|
107
123
|
key: "clear",
|
|
@@ -7,6 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
8
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { withProfiling } from '../../../self-measurements';
|
|
10
11
|
import { ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
11
12
|
var legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view', 'editor-container-mutation'];
|
|
12
13
|
export var FY25_01Classifier = /*#__PURE__*/function (_ViewportUpdateClassi) {
|
|
@@ -25,6 +26,7 @@ export var FY25_01Classifier = /*#__PURE__*/function (_ViewportUpdateClassi) {
|
|
|
25
26
|
}
|
|
26
27
|
}]);
|
|
27
28
|
_this.mergeConfig();
|
|
29
|
+
_this.VCCalculationMethod = withProfiling(_this.VCCalculationMethod.bind(_this), ['vc']);
|
|
28
30
|
return _this;
|
|
29
31
|
}
|
|
30
32
|
_inherits(FY25_01Classifier, _ViewportUpdateClassi);
|
|
@@ -7,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
+
import { withProfiling } from '../../../self-measurements';
|
|
10
11
|
import { FY25_01Classifier } from './fy25_01';
|
|
11
12
|
export var FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
|
|
12
13
|
function FY25_02Classifier() {
|
|
@@ -25,6 +26,7 @@ export var FY25_02Classifier = /*#__PURE__*/function (_FY25_01Classifier) {
|
|
|
25
26
|
}]);
|
|
26
27
|
_defineProperty(_this, "removedFilters", []);
|
|
27
28
|
_this.mergeConfig();
|
|
29
|
+
_this.filterComponentsLog = withProfiling(_this.filterComponentsLog.bind(_this), ['vc']);
|
|
28
30
|
return _this;
|
|
29
31
|
}
|
|
30
32
|
_inherits(FY25_02Classifier, _FY25_01Classifier);
|
|
@@ -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 var getRevisions = function getRevisions() {
|
|
5
|
+
export var 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 var getRevisions = function getRevisions() {
|
|
|
15
16
|
name: 'fy25.02',
|
|
16
17
|
classifier: revFY25_02Classifier
|
|
17
18
|
}];
|
|
18
|
-
};
|
|
19
|
+
}, ['vc']);
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
4
5
|
var EntriesTimeline = /*#__PURE__*/function () {
|
|
5
6
|
function EntriesTimeline() {
|
|
6
7
|
_classCallCheck(this, EntriesTimeline);
|
|
7
8
|
_defineProperty(this, "unorderedEntries", []);
|
|
8
9
|
_defineProperty(this, "sortedEntriesCache", new Map());
|
|
10
|
+
var operationTimer = markProfilingStart('EntriesTimeline constructor');
|
|
9
11
|
this.unorderedEntries = [];
|
|
12
|
+
this.push = withProfiling(this.push.bind(this), ['vc']);
|
|
13
|
+
this.getCacheKey = withProfiling(this.getCacheKey.bind(this), ['vc']);
|
|
14
|
+
this.getOrderedEntries = withProfiling(this.getOrderedEntries.bind(this), ['vc']);
|
|
15
|
+
this.clear = withProfiling(this.clear.bind(this), ['vc']);
|
|
16
|
+
markProfilingEnd(operationTimer, {
|
|
17
|
+
tags: ['vc']
|
|
18
|
+
});
|
|
10
19
|
}
|
|
11
20
|
return _createClass(EntriesTimeline, [{
|
|
12
21
|
key: "push",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { withProfiling } from '../../self-measurements';
|
|
1
2
|
var nameCache = new WeakMap();
|
|
2
|
-
|
|
3
|
+
var getElementName = withProfiling(function getElementName(selectorConfig, element) {
|
|
3
4
|
if (!(element instanceof HTMLElement)) {
|
|
4
5
|
return 'error';
|
|
5
6
|
}
|
|
@@ -65,4 +66,5 @@ export default function getElementName(selectorConfig, element) {
|
|
|
65
66
|
var name = "".concat(tagName).concat(attributes || classList);
|
|
66
67
|
nameCache.set(element, name);
|
|
67
68
|
return name;
|
|
68
|
-
}
|
|
69
|
+
}, ['vc']);
|
|
70
|
+
export default getElementName;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
import { withProfiling } from '../../self-measurements';
|
|
1
2
|
var nameCache = new WeakMap();
|
|
2
|
-
function getAttributeSelector(element, attributeName) {
|
|
3
|
+
var getAttributeSelector = withProfiling(function getAttributeSelector(element, attributeName) {
|
|
3
4
|
var attrValue = element.getAttribute(attributeName);
|
|
4
5
|
if (!attrValue) {
|
|
5
6
|
return '';
|
|
6
7
|
}
|
|
7
8
|
return "[".concat(attributeName, "=\"").concat(attrValue, "\"]");
|
|
8
|
-
}
|
|
9
|
-
function isValidSelector(selector) {
|
|
9
|
+
}, ['vc']);
|
|
10
|
+
var 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
|
+
var isSelectorUnique = withProfiling(function isSelectorUnique(selector) {
|
|
18
19
|
return document.querySelectorAll(selector).length === 1;
|
|
19
|
-
}
|
|
20
|
-
function getUniqueSelector(selectorConfig, element) {
|
|
20
|
+
}, ['vc']);
|
|
21
|
+
var getUniqueSelector = withProfiling(function getUniqueSelector(selectorConfig, element) {
|
|
21
22
|
var currentElement = element;
|
|
22
23
|
var parts = [];
|
|
23
24
|
var MAX_DEPTH = 3;
|
|
@@ -59,8 +60,8 @@ function getUniqueSelector(selectorConfig, element) {
|
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
return potentialSelector;
|
|
62
|
-
}
|
|
63
|
-
|
|
63
|
+
}, ['vc']);
|
|
64
|
+
var 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
|
var uniqueSelector = getUniqueSelector(selectorConfig, element);
|
|
72
73
|
nameCache.set(element, uniqueSelector);
|
|
73
74
|
return uniqueSelector;
|
|
74
|
-
}
|
|
75
|
+
}, ['vc']);
|
|
76
|
+
export default getElementName;
|
|
@@ -3,6 +3,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../self-measurements';
|
|
6
7
|
import EntriesTimeline from './entries-timeline';
|
|
7
8
|
import _getElementName from './get-element-name';
|
|
8
9
|
import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
@@ -22,6 +23,7 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
22
23
|
_classCallCheck(this, VCObserverNew);
|
|
23
24
|
_defineProperty(this, "viewportObserver", null);
|
|
24
25
|
_defineProperty(this, "windowEventObserver", null);
|
|
26
|
+
var operationTimer = markProfilingStart('VCObserverNew constructor');
|
|
25
27
|
this.entriesTimeline = new EntriesTimeline();
|
|
26
28
|
this.selectorConfig = (_config$selectorConfi = config.selectorConfig) !== null && _config$selectorConfi !== void 0 ? _config$selectorConfi : DEFAULT_SELECTOR_CONFIG;
|
|
27
29
|
this.viewportObserver = new ViewportObserver({
|
|
@@ -64,6 +66,13 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
});
|
|
69
|
+
this.start = withProfiling(this.start.bind(this), ['vc']);
|
|
70
|
+
this.stop = withProfiling(this.stop.bind(this), ['vc']);
|
|
71
|
+
this.getVCResult = withProfiling(this.getVCResult.bind(this), ['vc']);
|
|
72
|
+
this.getElementName = withProfiling(this.getElementName.bind(this), ['vc']);
|
|
73
|
+
markProfilingEnd(operationTimer, {
|
|
74
|
+
tags: ['vc']
|
|
75
|
+
});
|
|
67
76
|
}
|
|
68
77
|
return _createClass(VCObserverNew, [{
|
|
69
78
|
key: "start",
|
|
@@ -2,6 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
import { withProfiling } from '../../../self-measurements';
|
|
5
6
|
import calculateTTVCPercentiles from './percentile-calc';
|
|
6
7
|
import getViewportHeight from './utils/get-viewport-height';
|
|
7
8
|
import getViewportWidth from './utils/get-viewport-width';
|
|
@@ -9,6 +10,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
9
10
|
function AbstractVCCalculatorBase(revisionNo) {
|
|
10
11
|
_classCallCheck(this, AbstractVCCalculatorBase);
|
|
11
12
|
this.revisionNo = revisionNo;
|
|
13
|
+
this.calculate = withProfiling(this.calculate.bind(this), ['vc']);
|
|
12
14
|
}
|
|
13
15
|
return _createClass(AbstractVCCalculatorBase, [{
|
|
14
16
|
key: "calculate",
|
|
@@ -5,6 +5,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
6
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
8
9
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
9
10
|
import isViewportEntryData from '../utils/is-viewport-entry-data';
|
|
10
11
|
var ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
|
|
@@ -17,8 +18,12 @@ var CONSIDERED_ENTRY_TYPE = ['mutation:child-element', 'mutation:element', 'muta
|
|
|
17
18
|
export var KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS = ['data-drop-target-for-element', 'draggable'];
|
|
18
19
|
var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
19
20
|
function VCCalculator_FY25_03() {
|
|
21
|
+
var _this;
|
|
20
22
|
_classCallCheck(this, VCCalculator_FY25_03);
|
|
21
|
-
|
|
23
|
+
_this = _callSuper(this, VCCalculator_FY25_03, [REVISION_NO]);
|
|
24
|
+
_this.isEntryIncluded = withProfiling(_this.isEntryIncluded.bind(_this), ['vc']);
|
|
25
|
+
_this.isVCClean = withProfiling(_this.isVCClean.bind(_this), ['vc']);
|
|
26
|
+
return _this;
|
|
22
27
|
}
|
|
23
28
|
_inherits(VCCalculator_FY25_03, _AbstractVCCalculator);
|
|
24
29
|
return _createClass(VCCalculator_FY25_03, [{
|
package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js
CHANGED
|
@@ -2,6 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../../self-measurements';
|
|
5
6
|
import taskYield from '../../utils/task-yield';
|
|
6
7
|
|
|
7
8
|
// 24-bit color value
|
|
@@ -31,6 +32,7 @@ export var ViewportCanvas = /*#__PURE__*/function () {
|
|
|
31
32
|
function ViewportCanvas(viewport) {
|
|
32
33
|
var scaleFactor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
33
34
|
_classCallCheck(this, ViewportCanvas);
|
|
35
|
+
var operationTimer = markProfilingStart('ViewportCanvas constructor');
|
|
34
36
|
this.scaleFactor = scaleFactor;
|
|
35
37
|
this.colorCounter = 1;
|
|
36
38
|
this.colorTimeMap = new Map();
|
|
@@ -60,6 +62,14 @@ export var ViewportCanvas = /*#__PURE__*/function () {
|
|
|
60
62
|
this.ctx = ctx;
|
|
61
63
|
this.ctx.globalCompositeOperation = 'source-over';
|
|
62
64
|
this.clear();
|
|
65
|
+
this.getScaledDimensions = withProfiling(this.getScaledDimensions.bind(this), ['vc']);
|
|
66
|
+
this.clear = withProfiling(this.clear.bind(this), ['vc']);
|
|
67
|
+
this.generateColor = withProfiling(this.generateColor.bind(this), ['vc']);
|
|
68
|
+
this.drawRect = withProfiling(this.drawRect.bind(this), ['vc']);
|
|
69
|
+
this.getPixelCounts = withProfiling(this.getPixelCounts.bind(this), ['vc']);
|
|
70
|
+
markProfilingEnd(operationTimer, {
|
|
71
|
+
tags: ['vc']
|
|
72
|
+
});
|
|
63
73
|
}
|
|
64
74
|
return _createClass(ViewportCanvas, [{
|
|
65
75
|
key: "getScaledDimensions",
|
|
@@ -195,7 +205,7 @@ export var ViewportCanvas = /*#__PURE__*/function () {
|
|
|
195
205
|
* @param number - The input number to be split into RGB components.
|
|
196
206
|
* @returns The RGB color string in the format "rgb(r, g, b)".
|
|
197
207
|
*/
|
|
198
|
-
export function getRGBComponents(n) {
|
|
208
|
+
export var getRGBComponents = withProfiling(function getRGBComponents(n) {
|
|
199
209
|
// Ensure the input is within the valid range for a 24-bit color
|
|
200
210
|
if (n < 0 || n > 0xffffff) {
|
|
201
211
|
throw new Error('Input number must be between 0 and 16777215 (inclusive).');
|
|
@@ -210,7 +220,7 @@ export function getRGBComponents(n) {
|
|
|
210
220
|
// Extract red component (bits 16-23)
|
|
211
221
|
var red = n >> 16 & 0xff;
|
|
212
222
|
return "rgb(".concat(red, ", ").concat(green, ", ").concat(blue, ")");
|
|
213
|
-
}
|
|
223
|
+
}, ['vc']);
|
|
214
224
|
|
|
215
225
|
/**
|
|
216
226
|
* Calculates the number of pixels drawn for each color in the image data.
|
|
@@ -219,11 +229,8 @@ export function getRGBComponents(n) {
|
|
|
219
229
|
* @param arraySize - The amount of timestamps that were drawn in the viewport
|
|
220
230
|
* @returns A Map containing color to pixel count mappings.
|
|
221
231
|
*/
|
|
222
|
-
export
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
function _calculateDrawnPixelsRaw() {
|
|
226
|
-
_calculateDrawnPixelsRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(imageData, scaleFactor, arraySize) {
|
|
232
|
+
export var calculateDrawnPixelsRaw = withProfiling( /*#__PURE__*/function () {
|
|
233
|
+
var _calculateDrawnPixelsRaw = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(imageData, scaleFactor, arraySize) {
|
|
227
234
|
var data, arr, i, color, colorIndex;
|
|
228
235
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
229
236
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -265,5 +272,8 @@ function _calculateDrawnPixelsRaw() {
|
|
|
265
272
|
}
|
|
266
273
|
}, _callee2);
|
|
267
274
|
}));
|
|
268
|
-
|
|
269
|
-
|
|
275
|
+
function calculateDrawnPixelsRaw(_x, _x2, _x3) {
|
|
276
|
+
return _calculateDrawnPixelsRaw.apply(this, arguments);
|
|
277
|
+
}
|
|
278
|
+
return calculateDrawnPixelsRaw;
|
|
279
|
+
}(), ['vc']);
|
package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js
CHANGED
|
@@ -5,28 +5,26 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
|
|
|
5
5
|
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; } }
|
|
6
6
|
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; }
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
8
9
|
import { ViewportCanvas } from './canvas-pixel';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function _calculateTTVCPercentiles() {
|
|
13
|
-
_calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
14
|
-
var viewport, orderedEntries, percentiles, startTime, canvas, elementMap, _iterator2, _step2, entry, rect, elementName, timePixelCounts, canvasDimenstions, totalPixels;
|
|
10
|
+
var calculateTTVCPercentiles = withProfiling( /*#__PURE__*/function () {
|
|
11
|
+
var _calculateTTVCPercentiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
12
|
+
var viewport, orderedEntries, percentiles, startTime, canvas, elementMap, _iterator, _step, entry, rect, elementName, timePixelCounts, canvasDimenstions, totalPixels;
|
|
15
13
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
14
|
while (1) switch (_context.prev = _context.next) {
|
|
17
15
|
case 0:
|
|
18
16
|
viewport = _ref.viewport, orderedEntries = _ref.orderedEntries, percentiles = _ref.percentiles, startTime = _ref.startTime;
|
|
19
17
|
canvas = new ViewportCanvas(viewport, fg('platform_ufo_canvas_heatmap_full_precision') ? 1 : 0.25);
|
|
20
18
|
elementMap = new Map();
|
|
21
|
-
|
|
19
|
+
_iterator = _createForOfIteratorHelper(orderedEntries);
|
|
22
20
|
_context.prev = 4;
|
|
23
|
-
|
|
21
|
+
_iterator.s();
|
|
24
22
|
case 6:
|
|
25
|
-
if ((
|
|
23
|
+
if ((_step = _iterator.n()).done) {
|
|
26
24
|
_context.next = 17;
|
|
27
25
|
break;
|
|
28
26
|
}
|
|
29
|
-
entry =
|
|
27
|
+
entry = _step.value;
|
|
30
28
|
if ('rect' in entry.data) {
|
|
31
29
|
_context.next = 10;
|
|
32
30
|
break;
|
|
@@ -49,10 +47,10 @@ function _calculateTTVCPercentiles() {
|
|
|
49
47
|
case 19:
|
|
50
48
|
_context.prev = 19;
|
|
51
49
|
_context.t0 = _context["catch"](4);
|
|
52
|
-
|
|
50
|
+
_iterator.e(_context.t0);
|
|
53
51
|
case 22:
|
|
54
52
|
_context.prev = 22;
|
|
55
|
-
|
|
53
|
+
_iterator.f();
|
|
56
54
|
return _context.finish(22);
|
|
57
55
|
case 25:
|
|
58
56
|
_context.next = 27;
|
|
@@ -68,9 +66,13 @@ function _calculateTTVCPercentiles() {
|
|
|
68
66
|
}
|
|
69
67
|
}, _callee, null, [[4, 19, 22, 25]]);
|
|
70
68
|
}));
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
function calculateTTVCPercentiles(_x) {
|
|
70
|
+
return _calculateTTVCPercentiles.apply(this, arguments);
|
|
71
|
+
}
|
|
72
|
+
return calculateTTVCPercentiles;
|
|
73
|
+
}(), ['vc']);
|
|
74
|
+
export default calculateTTVCPercentiles;
|
|
75
|
+
export var calculatePercentiles = withProfiling(function calculatePercentiles(timePixelCounts, elementMap, unorderedPercentiles, totalPixels, startTime) {
|
|
74
76
|
var results = {};
|
|
75
77
|
var cumulativePixels = 0;
|
|
76
78
|
var percentiles = unorderedPercentiles.sort(function (a, b) {
|
|
@@ -87,13 +89,13 @@ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPerce
|
|
|
87
89
|
});
|
|
88
90
|
var percentileIndex = 0;
|
|
89
91
|
var domElementsBuffer = new Set();
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
+
var _iterator2 = _createForOfIteratorHelper(sortedEntries),
|
|
93
|
+
_step2;
|
|
92
94
|
try {
|
|
93
|
-
for (
|
|
94
|
-
var
|
|
95
|
-
time =
|
|
96
|
-
pixelCount =
|
|
95
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
96
|
+
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
97
|
+
time = _step2$value[0],
|
|
98
|
+
pixelCount = _step2$value[1];
|
|
97
99
|
cumulativePixels += pixelCount;
|
|
98
100
|
var percentCovered = cumulativePixels / totalPixels * 100;
|
|
99
101
|
var elementNames = elementMap.get(time) || new Set();
|
|
@@ -117,9 +119,9 @@ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPerce
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
} catch (err) {
|
|
120
|
-
|
|
122
|
+
_iterator2.e(err);
|
|
121
123
|
} finally {
|
|
122
|
-
|
|
124
|
+
_iterator2.f();
|
|
123
125
|
}
|
|
124
126
|
var previousResult = {
|
|
125
127
|
t: 0,
|
|
@@ -133,4 +135,4 @@ export function calculatePercentiles(timePixelCounts, elementMap, unorderedPerce
|
|
|
133
135
|
previousResult = results["".concat(percentile)];
|
|
134
136
|
}
|
|
135
137
|
return results;
|
|
136
|
-
}
|
|
138
|
+
}, ['vc']);
|