@atlaskit/react-ufo 3.6.5 → 3.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +5 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +6 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +10 -10
- package/dist/cjs/assets/index.js +14 -17
- package/dist/cjs/assets/utils.js +13 -10
- package/dist/cjs/bundle-eval-timing/index.js +8 -8
- package/dist/cjs/coinflip/index.js +2 -3
- package/dist/cjs/config/index.js +42 -30
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +41 -29
- package/dist/cjs/create-payload/common/utils/index.js +20 -16
- package/dist/cjs/create-payload/index.js +120 -128
- package/dist/cjs/create-payload/utils/get-interaction-status.js +2 -3
- package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
- package/dist/cjs/create-payload/utils/get-react-ufo-payload-version.js +3 -4
- package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +2 -3
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +7 -8
- package/dist/cjs/create-post-interaction-log-payload/index.js +12 -13
- package/dist/cjs/custom-data/index.js +14 -6
- package/dist/cjs/custom-mark/index.js +3 -4
- package/dist/cjs/custom-spans/index.js +3 -4
- package/dist/cjs/custom-timings/index.js +6 -6
- package/dist/cjs/experience-trace-id-context/index.js +21 -16
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -4
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +12 -12
- package/dist/cjs/feature-flags-accessed/index.js +4 -4
- package/dist/cjs/generate-id/index.js +2 -3
- package/dist/cjs/global-error-handler/index.js +16 -15
- package/dist/cjs/initial-page-load-extra-timing/index.js +6 -6
- package/dist/cjs/interaction-metrics/index.js +146 -110
- package/dist/cjs/interaction-metrics/post-interaction-log.js +0 -10
- package/dist/cjs/interaction-metrics-init/index.js +15 -16
- package/dist/cjs/interaction-metrics-init/schedule-idle-callback.js +2 -3
- package/dist/cjs/resource-timing/common/utils/config.js +10 -10
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +14 -14
- package/dist/cjs/resource-timing/main.js +24 -37
- package/dist/cjs/resource-timing/utils.js +3 -4
- package/dist/cjs/round-number/index.js +3 -4
- package/dist/cjs/route-name/index.js +2 -3
- package/dist/cjs/segment/schedule-on-paint.js +2 -4
- package/dist/cjs/segment/segment.js +4 -5
- package/dist/cjs/set-interaction-error/index.js +3 -4
- package/dist/cjs/short-id/index.js +2 -3
- package/dist/cjs/ssr/index.js +21 -18
- package/dist/cjs/trace-interaction/index.js +4 -5
- package/dist/cjs/trace-pageload/index.js +6 -6
- package/dist/cjs/trace-press/index.js +2 -3
- package/dist/cjs/trace-redirect/index.js +2 -3
- package/dist/cjs/trace-transition/index.js +2 -3
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +3 -4
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +3 -4
- package/dist/cjs/vc/index.js +6 -17
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +3 -4
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +22 -13
- package/dist/cjs/vc/vc-observer/getViewport.js +6 -6
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +10 -20
- package/dist/cjs/vc/vc-observer/index.js +119 -145
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +3 -4
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +0 -17
- package/dist/cjs/vc/vc-observer/observers/index.js +2 -29
- package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -3
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +0 -2
- package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +0 -2
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -4
- package/dist/cjs/vc/vc-observer-new/entries-timeline/index.js +0 -9
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +2 -3
- package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +10 -11
- package/dist/cjs/vc/vc-observer-new/index.js +0 -9
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -6
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +12 -20
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +26 -26
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +13 -25
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +7 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +39 -48
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +7 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/task-yield.js +7 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +7 -15
- package/dist/cjs/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +7 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -15
- package/dist/cjs/vc/vc-observer-new/viewport-observer/performance-observer/index.js +9 -9
- package/dist/cjs/vc/vc-observer-new/window-event-observer/index.js +1 -7
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +4 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +2 -3
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +4 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +2 -3
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +8 -9
- package/dist/es2019/assets/index.js +14 -19
- package/dist/es2019/assets/utils.js +8 -10
- package/dist/es2019/bundle-eval-timing/index.js +6 -7
- package/dist/es2019/coinflip/index.js +2 -4
- package/dist/es2019/config/index.js +28 -29
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +15 -18
- package/dist/es2019/create-payload/common/utils/index.js +14 -15
- package/dist/es2019/create-payload/index.js +75 -84
- package/dist/es2019/create-payload/utils/get-interaction-status.js +2 -4
- package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
- package/dist/es2019/create-payload/utils/get-react-ufo-payload-version.js +2 -3
- package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +2 -3
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +2 -3
- package/dist/es2019/create-post-interaction-log-payload/index.js +12 -13
- package/dist/es2019/custom-data/index.js +13 -5
- package/dist/es2019/custom-mark/index.js +2 -3
- package/dist/es2019/custom-spans/index.js +2 -3
- package/dist/es2019/custom-timings/index.js +4 -5
- package/dist/es2019/experience-trace-id-context/index.js +14 -15
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +2 -3
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +10 -11
- package/dist/es2019/feature-flags-accessed/index.js +2 -3
- package/dist/es2019/generate-id/index.js +2 -3
- package/dist/es2019/global-error-handler/index.js +13 -14
- package/dist/es2019/initial-page-load-extra-timing/index.js +4 -5
- package/dist/es2019/interaction-metrics/index.js +108 -109
- package/dist/es2019/interaction-metrics/post-interaction-log.js +0 -10
- package/dist/es2019/interaction-metrics-init/index.js +14 -15
- package/dist/es2019/interaction-metrics-init/schedule-idle-callback.js +2 -3
- package/dist/es2019/resource-timing/common/utils/config.js +8 -9
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +12 -13
- package/dist/es2019/resource-timing/main.js +23 -36
- package/dist/es2019/resource-timing/utils.js +2 -3
- package/dist/es2019/round-number/index.js +2 -3
- package/dist/es2019/route-name/index.js +2 -3
- package/dist/es2019/segment/schedule-on-paint.js +2 -4
- package/dist/es2019/segment/segment.js +4 -5
- package/dist/es2019/set-interaction-error/index.js +2 -3
- package/dist/es2019/short-id/index.js +2 -3
- package/dist/es2019/ssr/index.js +16 -17
- package/dist/es2019/trace-interaction/index.js +4 -5
- package/dist/es2019/trace-pageload/index.js +4 -5
- package/dist/es2019/trace-press/index.js +2 -3
- package/dist/es2019/trace-redirect/index.js +2 -3
- package/dist/es2019/trace-transition/index.js +2 -3
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +2 -3
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +2 -3
- package/dist/es2019/vc/index.js +4 -16
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +2 -3
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +4 -5
- package/dist/es2019/vc/vc-observer/getViewport.js +4 -5
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +8 -20
- package/dist/es2019/vc/vc-observer/index.js +104 -134
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +2 -3
- package/dist/es2019/vc/vc-observer/observers/editor-lnv/index.js +0 -17
- package/dist/es2019/vc/vc-observer/observers/index.js +2 -29
- package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -4
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +0 -2
- package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +0 -2
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +2 -3
- package/dist/es2019/vc/vc-observer-new/entries-timeline/index.js +0 -9
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +2 -3
- package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +10 -11
- package/dist/es2019/vc/vc-observer-new/index.js +0 -9
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +0 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +4 -14
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +4 -5
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +8 -20
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +8 -9
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/task-yield.js +2 -4
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +7 -15
- package/dist/es2019/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +8 -8
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -15
- package/dist/es2019/vc/vc-observer-new/viewport-observer/performance-observer/index.js +8 -9
- package/dist/es2019/vc/vc-observer-new/window-event-observer/index.js +1 -7
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +4 -5
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +2 -3
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +4 -5
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +2 -3
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +0 -3
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +8 -9
- package/dist/esm/assets/index.js +14 -17
- package/dist/esm/assets/utils.js +8 -10
- package/dist/esm/bundle-eval-timing/index.js +6 -7
- package/dist/esm/coinflip/index.js +2 -4
- package/dist/esm/config/index.js +28 -29
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +36 -28
- package/dist/esm/create-payload/common/utils/index.js +14 -15
- package/dist/esm/create-payload/index.js +119 -127
- package/dist/esm/create-payload/utils/get-interaction-status.js +2 -4
- package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +2 -3
- package/dist/esm/create-payload/utils/get-react-ufo-payload-version.js +2 -3
- package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +2 -3
- package/dist/esm/create-payload/utils/get-vc-metrics.js +7 -8
- package/dist/esm/create-post-interaction-log-payload/index.js +12 -13
- package/dist/esm/custom-data/index.js +13 -5
- package/dist/esm/custom-mark/index.js +2 -3
- package/dist/esm/custom-spans/index.js +2 -3
- package/dist/esm/custom-timings/index.js +4 -5
- package/dist/esm/experience-trace-id-context/index.js +14 -15
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +2 -3
- package/dist/esm/feature-flags-accessed/common/utils/index.js +10 -11
- package/dist/esm/feature-flags-accessed/index.js +2 -3
- package/dist/esm/generate-id/index.js +2 -3
- package/dist/esm/global-error-handler/index.js +13 -14
- package/dist/esm/initial-page-load-extra-timing/index.js +4 -5
- package/dist/esm/interaction-metrics/index.js +108 -109
- package/dist/esm/interaction-metrics/post-interaction-log.js +0 -10
- package/dist/esm/interaction-metrics-init/index.js +14 -15
- package/dist/esm/interaction-metrics-init/schedule-idle-callback.js +2 -3
- package/dist/esm/resource-timing/common/utils/config.js +8 -9
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +12 -13
- package/dist/esm/resource-timing/main.js +23 -36
- package/dist/esm/resource-timing/utils.js +2 -3
- package/dist/esm/round-number/index.js +2 -3
- package/dist/esm/route-name/index.js +2 -3
- package/dist/esm/segment/schedule-on-paint.js +2 -4
- package/dist/esm/segment/segment.js +4 -5
- package/dist/esm/set-interaction-error/index.js +2 -3
- package/dist/esm/short-id/index.js +2 -3
- package/dist/esm/ssr/index.js +16 -17
- package/dist/esm/trace-interaction/index.js +4 -5
- package/dist/esm/trace-pageload/index.js +4 -5
- package/dist/esm/trace-press/index.js +2 -3
- package/dist/esm/trace-redirect/index.js +2 -3
- package/dist/esm/trace-transition/index.js +2 -3
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +2 -3
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +2 -3
- package/dist/esm/vc/index.js +4 -16
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +2 -3
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +21 -12
- package/dist/esm/vc/vc-observer/getViewport.js +4 -5
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +10 -20
- package/dist/esm/vc/vc-observer/index.js +119 -145
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +2 -3
- package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +0 -17
- package/dist/esm/vc/vc-observer/observers/index.js +2 -29
- package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +2 -4
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +0 -16
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +0 -2
- package/dist/esm/vc/vc-observer/revisions/fy25_02.js +0 -2
- package/dist/esm/vc/vc-observer/revisions/revisions.js +2 -3
- package/dist/esm/vc/vc-observer-new/entries-timeline/index.js +0 -9
- package/dist/esm/vc/vc-observer-new/get-element-name.js +2 -3
- package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +10 -11
- package/dist/esm/vc/vc-observer-new/index.js +0 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +0 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +1 -6
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +9 -19
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +24 -25
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +6 -18
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +13 -25
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +7 -8
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +39 -48
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +7 -8
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +2 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +2 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +2 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/task-yield.js +7 -9
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +7 -15
- package/dist/esm/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +7 -8
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +14 -15
- package/dist/esm/vc/vc-observer-new/viewport-observer/performance-observer/index.js +7 -9
- package/dist/esm/vc/vc-observer-new/window-event-observer/index.js +1 -7
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +2 -2
- package/dist/types/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +3 -3
- package/dist/types/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -2
- package/dist/types/assets/index.d.ts +1 -3
- package/dist/types/assets/utils.d.ts +4 -4
- package/dist/types/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types/coinflip/index.d.ts +1 -1
- package/dist/types/common/react-ufo-payload-schema.d.ts +1 -0
- package/dist/types/config/index.d.ts +16 -14
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +4 -5
- package/dist/types/create-payload/common/utils/index.d.ts +8 -7
- package/dist/types/create-payload/index.d.ts +1 -97
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +1 -1
- package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +1 -1
- package/dist/types/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
- package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +1 -1
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +2 -2
- package/dist/types/create-post-interaction-log-payload/index.d.ts +1 -1
- 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/experience-trace-id-context/index.d.ts +7 -7
- package/dist/types/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +1 -1
- package/dist/types/feature-flags-accessed/common/utils/index.d.ts +2 -2
- package/dist/types/feature-flags-accessed/index.d.ts +1 -1
- package/dist/types/generate-id/index.d.ts +1 -1
- package/dist/types/global-error-handler/index.d.ts +3 -3
- package/dist/types/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types/interaction-context/index.d.ts +1 -1
- package/dist/types/interaction-metrics/index.d.ts +44 -44
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +0 -1
- package/dist/types/interaction-metrics-init/index.d.ts +1 -1
- package/dist/types/interaction-metrics-init/schedule-idle-callback.d.ts +1 -1
- package/dist/types/resource-timing/common/utils/config.d.ts +2 -2
- package/dist/types/resource-timing/common/utils/resource-timing-buffer.d.ts +5 -5
- package/dist/types/resource-timing/main.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 +3 -3
- package/dist/types/segment/schedule-on-paint.d.ts +1 -1
- package/dist/types/set-interaction-error/index.d.ts +1 -1
- package/dist/types/short-id/index.d.ts +1 -1
- package/dist/types/ssr/index.d.ts +5 -5
- package/dist/types/trace-interaction/index.d.ts +1 -1
- package/dist/types/trace-pageload/index.d.ts +2 -2
- package/dist/types/trace-press/index.d.ts +1 -1
- package/dist/types/trace-redirect/index.d.ts +1 -1
- package/dist/types/trace-transition/index.d.ts +1 -1
- package/dist/types/trace-transition/utils/generate-span-id/index.d.ts +1 -1
- package/dist/types/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -1
- package/dist/types/vc/index.d.ts +2 -2
- package/dist/types/vc/vc-observer/attachAbortListeners.d.ts +2 -2
- package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +5 -5
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +1 -1
- package/dist/types/vc/vc-observer/index.d.ts +4 -4
- package/dist/types/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -1
- package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +4 -4
- package/dist/types/vc/vc-observer/revisions/revisions.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-element-name.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-unique-element-name.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/intersection-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +2 -2
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +2 -2
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +3 -3
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -2
- package/dist/types-ts4.5/assets/index.d.ts +1 -3
- package/dist/types-ts4.5/assets/utils.d.ts +4 -4
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/coinflip/index.d.ts +1 -1
- package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +1 -0
- package/dist/types-ts4.5/config/index.d.ts +20 -14
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +4 -5
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +8 -7
- package/dist/types-ts4.5/create-payload/index.d.ts +1 -97
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-react-ufo-payload-version.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +1 -1
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +2 -2
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +1 -1
- 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/experience-trace-id-context/index.d.ts +7 -7
- package/dist/types-ts4.5/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +1 -1
- package/dist/types-ts4.5/feature-flags-accessed/common/utils/index.d.ts +2 -2
- package/dist/types-ts4.5/feature-flags-accessed/index.d.ts +1 -1
- package/dist/types-ts4.5/generate-id/index.d.ts +1 -1
- package/dist/types-ts4.5/global-error-handler/index.d.ts +3 -3
- 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 +1 -1
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +44 -44
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +0 -1
- package/dist/types-ts4.5/interaction-metrics-init/index.d.ts +1 -1
- package/dist/types-ts4.5/interaction-metrics-init/schedule-idle-callback.d.ts +1 -1
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +2 -2
- package/dist/types-ts4.5/resource-timing/common/utils/resource-timing-buffer.d.ts +5 -5
- package/dist/types-ts4.5/resource-timing/main.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 +3 -3
- package/dist/types-ts4.5/segment/schedule-on-paint.d.ts +1 -1
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +1 -1
- package/dist/types-ts4.5/short-id/index.d.ts +1 -1
- package/dist/types-ts4.5/ssr/index.d.ts +5 -5
- package/dist/types-ts4.5/trace-interaction/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-pageload/index.d.ts +2 -2
- package/dist/types-ts4.5/trace-press/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-redirect/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-transition/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-transition/utils/generate-span-id/index.d.ts +1 -1
- package/dist/types-ts4.5/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/attachAbortListeners.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +5 -5
- 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 +1 -1
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/revisions/revisions.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-element-name.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-unique-element-name.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +1 -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/intersection-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +2 -2
- package/package.json +4 -4
- package/dist/cjs/self-measurements/index.js +0 -261
- package/dist/es2019/self-measurements/index.js +0 -213
- package/dist/esm/self-measurements/index.js +0 -246
- package/dist/types/self-measurements/index.d.ts +0 -57
- package/dist/types-ts4.5/self-measurements/index.d.ts +0 -57
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { getPageVisibilityState } from '../../../hidden-timing';
|
|
3
|
-
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
4
3
|
const UNUSED_SECTOR = 0;
|
|
5
4
|
export class MultiRevisionHeatmap {
|
|
6
5
|
constructor({
|
|
@@ -41,7 +40,6 @@ export class MultiRevisionHeatmap {
|
|
|
41
40
|
} = mappedValues;
|
|
42
41
|
return (r - l) * (b - t) / (this.arraySize.w * this.arraySize.h);
|
|
43
42
|
});
|
|
44
|
-
const operationTimer = markProfilingStart('MultiRevisionHeatmap constructor');
|
|
45
43
|
this.viewport = viewport;
|
|
46
44
|
this.revisions = revisions;
|
|
47
45
|
if (arraySize) {
|
|
@@ -56,16 +54,6 @@ export class MultiRevisionHeatmap {
|
|
|
56
54
|
this.componentsLogs[i] = {};
|
|
57
55
|
this.vcRatios[i] = {};
|
|
58
56
|
});
|
|
59
|
-
this.handleUpdate = withProfiling(this.handleUpdate.bind(this), ['vc']);
|
|
60
|
-
this.getData = withProfiling(this.getData.bind(this), ['vc']);
|
|
61
|
-
this.getPayloadShapedData = withProfiling(this.getPayloadShapedData.bind(this), ['vc']);
|
|
62
|
-
this.processData = withProfiling(this.processData.bind(this), ['vc']);
|
|
63
|
-
this.mapPixelsToHeatmap = withProfiling(this.mapPixelsToHeatmap.bind(this), ['vc']);
|
|
64
|
-
this.getElementRatio = withProfiling(this.getElementRatio.bind(this), ['vc']);
|
|
65
|
-
this.applyChangesToHeatMap = withProfiling(this.applyChangesToHeatMap.bind(this), ['vc']);
|
|
66
|
-
this.getIndex = withProfiling(this.getIndex.bind(this), ['vc']);
|
|
67
|
-
this.getCleanHeatmap = withProfiling(this.getCleanHeatmap.bind(this), ['vc']);
|
|
68
|
-
markProfilingEnd(operationTimer);
|
|
69
57
|
}
|
|
70
58
|
handleUpdate({
|
|
71
59
|
time,
|
|
@@ -249,11 +237,11 @@ export class MultiRevisionHeatmap {
|
|
|
249
237
|
getCleanHeatmap() {
|
|
250
238
|
return new Int32Array(this.arraySize.w * this.arraySize.h);
|
|
251
239
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
240
|
+
static makeVCReturnObj(VCParts) {
|
|
241
|
+
const vc = {};
|
|
242
|
+
VCParts.forEach(v => {
|
|
243
|
+
vc[v] = null;
|
|
244
|
+
});
|
|
245
|
+
return vc;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var _VCObserver;
|
|
3
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../self-measurements';
|
|
5
3
|
import { attachAbortListeners } from './attachAbortListeners';
|
|
6
4
|
import { getVCRevisionsData } from './getVCRevisionsData';
|
|
7
5
|
import { getViewportHeight, getViewportWidth } from './getViewport';
|
|
@@ -15,7 +13,7 @@ const abortReason = {
|
|
|
15
13
|
error: 'error'
|
|
16
14
|
};
|
|
17
15
|
const UNUSED_SECTOR = 0;
|
|
18
|
-
|
|
16
|
+
function filterComponentsLog(log) {
|
|
19
17
|
return Object.fromEntries(Object.entries(log).map(([timestamp, entries]) => [Number(timestamp), entries.map(entry => {
|
|
20
18
|
const {
|
|
21
19
|
__debug__element,
|
|
@@ -23,7 +21,7 @@ const filterComponentsLog = withProfiling(function filterComponentsLog(log) {
|
|
|
23
21
|
} = entry;
|
|
24
22
|
return rest;
|
|
25
23
|
})]));
|
|
26
|
-
}
|
|
24
|
+
}
|
|
27
25
|
export class VCObserver {
|
|
28
26
|
constructor(options) {
|
|
29
27
|
/* abort logic */
|
|
@@ -481,7 +479,6 @@ export class VCObserver {
|
|
|
481
479
|
}
|
|
482
480
|
this.unbind = unbinds;
|
|
483
481
|
});
|
|
484
|
-
const operationTimer = markProfilingStart('VCObserver constructor');
|
|
485
482
|
this.arraySize = options.heatmapSize || 200;
|
|
486
483
|
this.devToolsEnabled = options.devToolsEnabled || false;
|
|
487
484
|
this.oldDomUpdatesEnabled = options.oldDomUpdates || false;
|
|
@@ -502,32 +499,6 @@ export class VCObserver {
|
|
|
502
499
|
devToolsEnabled: this.devToolsEnabled
|
|
503
500
|
});
|
|
504
501
|
this.isPostInteraction = options.isPostInteraction || false;
|
|
505
|
-
this.start = withProfiling(this.start.bind(this), ['vc']);
|
|
506
|
-
this.stop = withProfiling(this.stop.bind(this), ['vc']);
|
|
507
|
-
this.getAbortReasonInfo = withProfiling(this.getAbortReasonInfo.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
508
|
-
this.getVCRawData = withProfiling(this.getVCRawData.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
509
|
-
this.getIgnoredElements = withProfiling(this.getIgnoredElements.bind(this), ['vc']);
|
|
510
|
-
this.getVCResult = withProfiling(this.getVCResult.bind(this), ['vc']);
|
|
511
|
-
this.setSSRElement = withProfiling(this.setSSRElement.bind(this), ['vc']);
|
|
512
|
-
this.setReactRootRenderStart = withProfiling(this.setReactRootRenderStart.bind(this), ['vc']);
|
|
513
|
-
this.setReactRootRenderStop = withProfiling(this.setReactRootRenderStop.bind(this), ['vc']);
|
|
514
|
-
this.handleUpdate = withProfiling(this.handleUpdate.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
515
|
-
this.legacyHandleUpdate = withProfiling(this.legacyHandleUpdate.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
516
|
-
this.onViewportChangeDetected = withProfiling(this.onViewportChangeDetected.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
517
|
-
this.setAbortReason = withProfiling(this.setAbortReason.bind(this), ['vc']);
|
|
518
|
-
this.resetState = withProfiling(this.resetState.bind(this), ['vc']);
|
|
519
|
-
this.setViewportSize = withProfiling(this.setViewportSize.bind(this), ['vc']);
|
|
520
|
-
this.mapPixelsToHeatmap = withProfiling(this.mapPixelsToHeatmap.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
521
|
-
this.getElementRatio = withProfiling(this.getElementRatio.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
522
|
-
this.applyChangesToHeatMap = withProfiling(this.applyChangesToHeatMap.bind(this), ['vc']);
|
|
523
|
-
this.abortReasonCallback = withProfiling(this.abortReasonCallback.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
524
|
-
this.attachAbortListeners = withProfiling(this.attachAbortListeners.bind(this), ['vc']); // TODO: confirm correct value of `this`
|
|
525
|
-
this.detachAbortListeners = withProfiling(this.detachAbortListeners.bind(this), ['vc']);
|
|
526
|
-
this.measureStart = withProfiling(this.measureStart.bind(this), ['vc']);
|
|
527
|
-
this.measureStop = withProfiling(this.measureStop.bind(this), ['vc']);
|
|
528
|
-
markProfilingEnd(operationTimer, {
|
|
529
|
-
tags: ['vc']
|
|
530
|
-
});
|
|
531
502
|
}
|
|
532
503
|
start({
|
|
533
504
|
startTime
|
|
@@ -559,6 +530,100 @@ export class VCObserver {
|
|
|
559
530
|
ignoreReason
|
|
560
531
|
}));
|
|
561
532
|
}
|
|
533
|
+
static calculateVC({
|
|
534
|
+
heatmap,
|
|
535
|
+
ssr = UNUSED_SECTOR,
|
|
536
|
+
componentsLog,
|
|
537
|
+
viewport
|
|
538
|
+
}) {
|
|
539
|
+
const lastUpdate = {};
|
|
540
|
+
let totalPainted = 0;
|
|
541
|
+
if (ssr !== UNUSED_SECTOR) {
|
|
542
|
+
var _window$document;
|
|
543
|
+
const element = {
|
|
544
|
+
__debug__element: new WeakRef((_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body),
|
|
545
|
+
intersectionRect: {
|
|
546
|
+
top: 0,
|
|
547
|
+
left: 0,
|
|
548
|
+
right: 0,
|
|
549
|
+
bottom: 0,
|
|
550
|
+
x: 0,
|
|
551
|
+
y: 0,
|
|
552
|
+
width: viewport.w,
|
|
553
|
+
height: viewport.h,
|
|
554
|
+
toJSON() {
|
|
555
|
+
return {};
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
targetName: 'SSR'
|
|
559
|
+
};
|
|
560
|
+
if (!componentsLog[ssr]) {
|
|
561
|
+
componentsLog[ssr] = [];
|
|
562
|
+
}
|
|
563
|
+
componentsLog[ssr].push(element);
|
|
564
|
+
}
|
|
565
|
+
heatmap.forEach(line => {
|
|
566
|
+
line.forEach(entry => {
|
|
567
|
+
const rounded = Math.floor(entry === UNUSED_SECTOR && ssr !== UNUSED_SECTOR ? ssr : entry);
|
|
568
|
+
totalPainted += rounded !== UNUSED_SECTOR ? 1 : 0;
|
|
569
|
+
if (rounded !== UNUSED_SECTOR) {
|
|
570
|
+
lastUpdate[rounded] = lastUpdate[rounded] ? lastUpdate[rounded] + 1 : 1;
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
const entries = Object.entries(lastUpdate).map(a => [parseInt(a[0], 10), a[1]]).sort((a, b) => a[0] > b[0] ? 1 : -1);
|
|
575
|
+
const VC = VCObserver.makeVCReturnObj();
|
|
576
|
+
const VCBox = VCObserver.makeVCReturnObj();
|
|
577
|
+
|
|
578
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
579
|
+
const isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
|
|
580
|
+
entries.reduce((acc = 0, v) => {
|
|
581
|
+
const currRatio = v[1] / totalPainted;
|
|
582
|
+
let VCRatio = currRatio + acc;
|
|
583
|
+
const preciseCurrRatio = Math.round(100 * (v[1] / totalPainted));
|
|
584
|
+
const preciseAccRatio = Math.round(acc * 100);
|
|
585
|
+
VCRatio = (preciseCurrRatio + preciseAccRatio) / 100;
|
|
586
|
+
const time = v[0];
|
|
587
|
+
VCObserver.VCParts.forEach(key => {
|
|
588
|
+
const value = parseInt(key, 10);
|
|
589
|
+
if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
|
|
590
|
+
var _componentsLog$time;
|
|
591
|
+
VC[key] = time;
|
|
592
|
+
VCBox[key] = [...new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(v => !v.ignoreReason).map(v => v.targetName))];
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
return VCRatio;
|
|
596
|
+
}, 0);
|
|
597
|
+
const VCEntries = entries.reduce((acc, [timestamp, entryPainted], i) => {
|
|
598
|
+
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
599
|
+
const currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
600
|
+
const currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
601
|
+
const logEntry = [...new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(v => !v.ignoreReason).map(v => v.targetName))];
|
|
602
|
+
const ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
|
|
603
|
+
if (isCalcSpeedIndexEnabled) {
|
|
604
|
+
const speedIndex = timestamp * ratioDelta;
|
|
605
|
+
acc.speedIndex += speedIndex;
|
|
606
|
+
}
|
|
607
|
+
acc.abs.push([timestamp, currentlyPainted]);
|
|
608
|
+
acc.rel.push({
|
|
609
|
+
time: timestamp,
|
|
610
|
+
vc: currentlyPaintedRatio,
|
|
611
|
+
elements: logEntry
|
|
612
|
+
});
|
|
613
|
+
return acc;
|
|
614
|
+
}, {
|
|
615
|
+
abs: [],
|
|
616
|
+
rel: [],
|
|
617
|
+
speedIndex: 0
|
|
618
|
+
});
|
|
619
|
+
VCEntries.speedIndex = Math.round(VCEntries.speedIndex);
|
|
620
|
+
return {
|
|
621
|
+
VC,
|
|
622
|
+
VCBox,
|
|
623
|
+
VCEntries,
|
|
624
|
+
totalPainted
|
|
625
|
+
};
|
|
626
|
+
}
|
|
562
627
|
setSSRElement(element) {
|
|
563
628
|
this.observers.setReactRootElement(element);
|
|
564
629
|
}
|
|
@@ -628,6 +693,13 @@ export class VCObserver {
|
|
|
628
693
|
}
|
|
629
694
|
}
|
|
630
695
|
}
|
|
696
|
+
static makeVCReturnObj() {
|
|
697
|
+
const vc = {};
|
|
698
|
+
VCObserver.VCParts.forEach(v => {
|
|
699
|
+
vc[v] = null;
|
|
700
|
+
});
|
|
701
|
+
return vc;
|
|
702
|
+
}
|
|
631
703
|
detachAbortListeners() {
|
|
632
704
|
this.unbind.forEach(fn => fn());
|
|
633
705
|
this.unbind = [];
|
|
@@ -643,107 +715,5 @@ export class VCObserver {
|
|
|
643
715
|
this._startMeasureTimestamp = -1;
|
|
644
716
|
}
|
|
645
717
|
}
|
|
646
|
-
_VCObserver = VCObserver;
|
|
647
718
|
/** config * */
|
|
648
|
-
_defineProperty(VCObserver, "VCParts", ['25', '50', '75', '80', '85', '90', '95', '98', '99']);
|
|
649
|
-
_defineProperty(VCObserver, "calculateVC", withProfiling(function calculateVC({
|
|
650
|
-
heatmap,
|
|
651
|
-
ssr = UNUSED_SECTOR,
|
|
652
|
-
componentsLog,
|
|
653
|
-
viewport
|
|
654
|
-
}) {
|
|
655
|
-
const lastUpdate = {};
|
|
656
|
-
let totalPainted = 0;
|
|
657
|
-
if (ssr !== UNUSED_SECTOR) {
|
|
658
|
-
var _window$document;
|
|
659
|
-
const element = {
|
|
660
|
-
__debug__element: new WeakRef((_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.body),
|
|
661
|
-
intersectionRect: {
|
|
662
|
-
top: 0,
|
|
663
|
-
left: 0,
|
|
664
|
-
right: 0,
|
|
665
|
-
bottom: 0,
|
|
666
|
-
x: 0,
|
|
667
|
-
y: 0,
|
|
668
|
-
width: viewport.w,
|
|
669
|
-
height: viewport.h,
|
|
670
|
-
toJSON() {
|
|
671
|
-
return {};
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
targetName: 'SSR'
|
|
675
|
-
};
|
|
676
|
-
if (!componentsLog[ssr]) {
|
|
677
|
-
componentsLog[ssr] = [];
|
|
678
|
-
}
|
|
679
|
-
componentsLog[ssr].push(element);
|
|
680
|
-
}
|
|
681
|
-
heatmap.forEach(line => {
|
|
682
|
-
line.forEach(entry => {
|
|
683
|
-
const rounded = Math.floor(entry === UNUSED_SECTOR && ssr !== UNUSED_SECTOR ? ssr : entry);
|
|
684
|
-
totalPainted += rounded !== UNUSED_SECTOR ? 1 : 0;
|
|
685
|
-
if (rounded !== UNUSED_SECTOR) {
|
|
686
|
-
lastUpdate[rounded] = lastUpdate[rounded] ? lastUpdate[rounded] + 1 : 1;
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
});
|
|
690
|
-
const entries = Object.entries(lastUpdate).map(a => [parseInt(a[0], 10), a[1]]).sort((a, b) => a[0] > b[0] ? 1 : -1);
|
|
691
|
-
const VC = _VCObserver.makeVCReturnObj();
|
|
692
|
-
const VCBox = _VCObserver.makeVCReturnObj();
|
|
693
|
-
|
|
694
|
-
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
695
|
-
const isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
|
|
696
|
-
entries.reduce((acc = 0, v) => {
|
|
697
|
-
const currRatio = v[1] / totalPainted;
|
|
698
|
-
let VCRatio = currRatio + acc;
|
|
699
|
-
const preciseCurrRatio = Math.round(100 * (v[1] / totalPainted));
|
|
700
|
-
const preciseAccRatio = Math.round(acc * 100);
|
|
701
|
-
VCRatio = (preciseCurrRatio + preciseAccRatio) / 100;
|
|
702
|
-
const time = v[0];
|
|
703
|
-
_VCObserver.VCParts.forEach(key => {
|
|
704
|
-
const value = parseInt(key, 10);
|
|
705
|
-
if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
|
|
706
|
-
var _componentsLog$time;
|
|
707
|
-
VC[key] = time;
|
|
708
|
-
VCBox[key] = [...new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(v => !v.ignoreReason).map(v => v.targetName))];
|
|
709
|
-
}
|
|
710
|
-
});
|
|
711
|
-
return VCRatio;
|
|
712
|
-
}, 0);
|
|
713
|
-
const VCEntries = entries.reduce((acc, [timestamp, entryPainted], i) => {
|
|
714
|
-
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
715
|
-
const currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
716
|
-
const currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
717
|
-
const logEntry = [...new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(v => !v.ignoreReason).map(v => v.targetName))];
|
|
718
|
-
const ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
|
|
719
|
-
if (isCalcSpeedIndexEnabled) {
|
|
720
|
-
const speedIndex = timestamp * ratioDelta;
|
|
721
|
-
acc.speedIndex += speedIndex;
|
|
722
|
-
}
|
|
723
|
-
acc.abs.push([timestamp, currentlyPainted]);
|
|
724
|
-
acc.rel.push({
|
|
725
|
-
time: timestamp,
|
|
726
|
-
vc: currentlyPaintedRatio,
|
|
727
|
-
elements: logEntry
|
|
728
|
-
});
|
|
729
|
-
return acc;
|
|
730
|
-
}, {
|
|
731
|
-
abs: [],
|
|
732
|
-
rel: [],
|
|
733
|
-
speedIndex: 0
|
|
734
|
-
});
|
|
735
|
-
VCEntries.speedIndex = Math.round(VCEntries.speedIndex);
|
|
736
|
-
return {
|
|
737
|
-
VC,
|
|
738
|
-
VCBox,
|
|
739
|
-
VCEntries,
|
|
740
|
-
totalPainted
|
|
741
|
-
};
|
|
742
|
-
}, ['vc']));
|
|
743
|
-
_defineProperty(VCObserver, "makeVCReturnObj", withProfiling(function makeVCReturnObj() {
|
|
744
|
-
const vc = {};
|
|
745
|
-
_VCObserver.VCParts.forEach(v => {
|
|
746
|
-
vc[v] = null;
|
|
747
|
-
});
|
|
748
|
-
return vc;
|
|
749
|
-
}, ['vc']));
|
|
719
|
+
_defineProperty(VCObserver, "VCParts", ['25', '50', '75', '80', '85', '90', '95', '98', '99']);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { withProfiling } from '../../../self-measurements';
|
|
2
1
|
import { MEDIA_WRAPPER_TAG } from './index';
|
|
3
|
-
export
|
|
2
|
+
export function isContainedWithinMediaWrapper(node) {
|
|
4
3
|
while (node) {
|
|
5
4
|
if (node instanceof Element && node.hasAttribute(MEDIA_WRAPPER_TAG)) {
|
|
6
5
|
return true;
|
|
@@ -8,4 +7,4 @@ export const isContainedWithinMediaWrapper = withProfiling(function isContainedW
|
|
|
8
7
|
node = node.parentNode;
|
|
9
8
|
}
|
|
10
9
|
return false;
|
|
11
|
-
}
|
|
10
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../self-measurements';
|
|
3
2
|
const placeholderDataKey = 'editorLnvPlaceholder'; // data-editor-lnv-placeholder
|
|
4
3
|
const replaceDataKey = 'editorLnvPlaceholderReplace'; // data-editor-lnv-placeholder-replace
|
|
5
4
|
|
|
@@ -64,23 +63,7 @@ export class EditorLnvHandler {
|
|
|
64
63
|
return;
|
|
65
64
|
}
|
|
66
65
|
});
|
|
67
|
-
const operationTimer = markProfilingStart('EditorLnvHandler constructor');
|
|
68
66
|
this.intersectionObserver = new IntersectionObserver(entries => entries.filter(entry => entry.intersectionRatio > 0).forEach(this.intersectionObserverCallback));
|
|
69
|
-
this.shouldHandleAddedNode = withProfiling(this.shouldHandleAddedNode.bind(this), ['vc']);
|
|
70
|
-
this.handleAddedNode = withProfiling(this.handleAddedNode.bind(this), ['vc']);
|
|
71
|
-
this.clear = withProfiling(this.clear.bind(this), ['vc']);
|
|
72
|
-
this.handleAddedPlaceholderNode = withProfiling(this.handleAddedPlaceholderNode.bind(this), ['vc']);
|
|
73
|
-
this.handleAddedReplaceNode = withProfiling(this.handleAddedReplaceNode.bind(this), ['vc']);
|
|
74
|
-
this.isExistingPlaceholder = withProfiling(this.isExistingPlaceholder.bind(this), ['vc']);
|
|
75
|
-
this.registerPlaceholder = withProfiling(this.registerPlaceholder.bind(this), ['vc']);
|
|
76
|
-
this.getSize = withProfiling(this.getSize.bind(this), ['vc']);
|
|
77
|
-
this.isAddedPlaceholderMatchingSize = withProfiling(this.isAddedPlaceholderMatchingSize.bind(this), ['vc']);
|
|
78
|
-
this.isAddedReplaceMatchingSize = withProfiling(this.isAddedReplaceMatchingSize.bind(this), ['vc']);
|
|
79
|
-
this.areRectsSameSize = withProfiling(this.areRectsSameSize.bind(this), ['vc']);
|
|
80
|
-
this.intersectionObserverCallback = withProfiling(this.intersectionObserverCallback.bind(this), ['vc']);
|
|
81
|
-
markProfilingEnd(operationTimer, {
|
|
82
|
-
tags: ['vc']
|
|
83
|
-
});
|
|
84
67
|
}
|
|
85
68
|
shouldHandleAddedNode(el) {
|
|
86
69
|
var _el$dataset, _el$dataset2;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { shouldHandleEditorLnv } from '../../../config';
|
|
4
|
-
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
5
4
|
import { isContainedWithinMediaWrapper } from '../media-wrapper/vc-utils';
|
|
6
5
|
import { EditorLnvHandler } from './editor-lnv';
|
|
7
6
|
import isNonVisualStyleMutation from './non-visual-styles/is-non-visual-style-mutation';
|
|
@@ -11,7 +10,7 @@ const state = {
|
|
|
11
10
|
waitingForFirstRender: 2,
|
|
12
11
|
ignoring: 3
|
|
13
12
|
};
|
|
14
|
-
|
|
13
|
+
function isElementVisible(target) {
|
|
15
14
|
if (!target || typeof target.checkVisibility !== 'function') {
|
|
16
15
|
return true;
|
|
17
16
|
}
|
|
@@ -21,7 +20,7 @@ const isElementVisible = withProfiling(function isElementVisible(target) {
|
|
|
21
20
|
visibilityProperty: true
|
|
22
21
|
});
|
|
23
22
|
return isVisible;
|
|
24
|
-
}
|
|
23
|
+
}
|
|
25
24
|
export class Observers {
|
|
26
25
|
constructor(opts) {
|
|
27
26
|
_defineProperty(this, "observedMutations", new WeakMap());
|
|
@@ -65,7 +64,6 @@ export class Observers {
|
|
|
65
64
|
});
|
|
66
65
|
}
|
|
67
66
|
});
|
|
68
|
-
const operationTimer = markProfilingStart('Observers constructor');
|
|
69
67
|
this.selectorConfig = {
|
|
70
68
|
...this.selectorConfig,
|
|
71
69
|
...opts.selectorConfig
|
|
@@ -74,23 +72,6 @@ export class Observers {
|
|
|
74
72
|
this.mutationObserver = this.getMutationObserver();
|
|
75
73
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers();
|
|
76
74
|
this.editorLnvHandler = new EditorLnvHandler();
|
|
77
|
-
this.isBrowserSupported = withProfiling(this.isBrowserSupported.bind(this), ['vc']);
|
|
78
|
-
this.observe = withProfiling(this.observe.bind(this), ['vc']);
|
|
79
|
-
this.disconnect = withProfiling(this.disconnect.bind(this), ['vc']);
|
|
80
|
-
this.subscribeResults = withProfiling(this.subscribeResults.bind(this), ['vc']);
|
|
81
|
-
this.getTotalTime = withProfiling(this.getTotalTime.bind(this), ['vc']);
|
|
82
|
-
this.setReactRootElement = withProfiling(this.setReactRootElement.bind(this), ['vc']);
|
|
83
|
-
this.setReactRootRenderStart = withProfiling(this.setReactRootRenderStart.bind(this), ['vc']);
|
|
84
|
-
this.setReactRootRenderStop = withProfiling(this.setReactRootRenderStop.bind(this), ['vc']);
|
|
85
|
-
this.observeElement = withProfiling(this.observeElement.bind(this), ['vc']);
|
|
86
|
-
this.getMutationObserver = withProfiling(this.getMutationObserver.bind(this), ['vc']);
|
|
87
|
-
this.getElementName = withProfiling(this.getElementName.bind(this), ['vc']);
|
|
88
|
-
this.getIntersectionObserver = withProfiling(this.getIntersectionObserver.bind(this), ['vc']);
|
|
89
|
-
this.measureStart = withProfiling(this.measureStart.bind(this), ['vc']);
|
|
90
|
-
this.measureStop = withProfiling(this.measureStop.bind(this), ['vc']);
|
|
91
|
-
markProfilingEnd(operationTimer, {
|
|
92
|
-
tags: ['vc']
|
|
93
|
-
});
|
|
94
75
|
}
|
|
95
76
|
isBrowserSupported() {
|
|
96
77
|
return typeof window.IntersectionObserver === 'function' && typeof window.MutationObserver === 'function';
|
|
@@ -142,7 +123,6 @@ export class Observers {
|
|
|
142
123
|
}
|
|
143
124
|
const shouldHandleEditorLnvLocal = shouldHandleEditorLnv();
|
|
144
125
|
return new MutationObserver(mutations => {
|
|
145
|
-
const operationTimer = markProfilingStart('mutationObserverCallback');
|
|
146
126
|
this.measureStart();
|
|
147
127
|
mutations.forEach(mutation => {
|
|
148
128
|
// patching element if timestamp not automatically added
|
|
@@ -236,9 +216,6 @@ export class Observers {
|
|
|
236
216
|
}
|
|
237
217
|
}
|
|
238
218
|
});
|
|
239
|
-
markProfilingEnd(operationTimer, {
|
|
240
|
-
tags: ['vc']
|
|
241
|
-
});
|
|
242
219
|
});
|
|
243
220
|
}
|
|
244
221
|
getElementName(element) {
|
|
@@ -271,7 +248,6 @@ export class Observers {
|
|
|
271
248
|
return null;
|
|
272
249
|
}
|
|
273
250
|
return new IntersectionObserver(entries => {
|
|
274
|
-
const operationTimer = markProfilingStart('intersectionObserverCallback');
|
|
275
251
|
this.measureStart();
|
|
276
252
|
entries.forEach(({
|
|
277
253
|
isIntersecting,
|
|
@@ -306,9 +282,6 @@ export class Observers {
|
|
|
306
282
|
}
|
|
307
283
|
});
|
|
308
284
|
this.measureStop();
|
|
309
|
-
markProfilingEnd(operationTimer, {
|
|
310
|
-
tags: ['vc']
|
|
311
|
-
});
|
|
312
285
|
});
|
|
313
286
|
}
|
|
314
287
|
measureStart() {
|
package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Checks if a mutation record represents a non-visual style change
|
|
5
3
|
* @param mutation - The mutation record to check
|
|
@@ -10,7 +8,7 @@ import { withProfiling } from '../../../../self-measurements';
|
|
|
10
8
|
* - The changed attribute is either 'class' or 'style'
|
|
11
9
|
*/
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
function isNonVisualStyleMutation({
|
|
14
12
|
target,
|
|
15
13
|
attributeName
|
|
16
14
|
}) {
|
|
@@ -24,5 +22,5 @@ const isNonVisualStyleMutation = withProfiling(function isNonVisualStyleMutation
|
|
|
24
22
|
return false;
|
|
25
23
|
}
|
|
26
24
|
return true;
|
|
27
|
-
}
|
|
25
|
+
}
|
|
28
26
|
export default isNonVisualStyleMutation;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../../self-measurements';
|
|
3
2
|
const ANCESTOR_LOOKUP_LIMIT = 10;
|
|
4
3
|
export class SSRPlaceholderHandlers {
|
|
5
4
|
constructor() {
|
|
@@ -60,7 +59,6 @@ export class SSRPlaceholderHandlers {
|
|
|
60
59
|
this.reactValidateCallbacks.delete(staticKey);
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
|
-
const operationTimer = markProfilingStart('SSRPlaceholderHandlers constructor');
|
|
64
62
|
if (typeof IntersectionObserver === 'function') {
|
|
65
63
|
// Only instantiate the IntersectionObserver if it's supported
|
|
66
64
|
this.intersectionObserver = new IntersectionObserver(entries => entries.filter(entry => entry.intersectionRatio > 0).forEach(this.intersectionObserverCallback));
|
|
@@ -96,20 +94,6 @@ export class SSRPlaceholderHandlers {
|
|
|
96
94
|
delete window.__SSR_PLACEHOLDERS_DIMENSIONS__;
|
|
97
95
|
}
|
|
98
96
|
}
|
|
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
|
-
});
|
|
113
97
|
}
|
|
114
98
|
clear() {
|
|
115
99
|
this.staticPlaceholders = new Map();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { withProfiling } from '../../../self-measurements';
|
|
3
2
|
import { ViewportUpdateClassifier } from './ViewportUpdateClassifier';
|
|
4
3
|
const legacyIgnoreReasons = ['image', 'ssr-hydration', 'editor-lazy-node-view'];
|
|
5
4
|
export class FY25_01Classifier extends ViewportUpdateClassifier {
|
|
@@ -51,7 +50,6 @@ export class FY25_01Classifier extends ViewportUpdateClassifier {
|
|
|
51
50
|
}
|
|
52
51
|
}]);
|
|
53
52
|
this.mergeConfig();
|
|
54
|
-
this.VCCalculationMethod = withProfiling(this.VCCalculationMethod.bind(this), ['vc']);
|
|
55
53
|
}
|
|
56
54
|
}
|
|
57
55
|
export const revFY25_01Classifier = new FY25_01Classifier();
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { withProfiling } from '../../../self-measurements';
|
|
3
2
|
import { FY25_01Classifier } from './fy25_01';
|
|
4
3
|
export class FY25_02Classifier extends FY25_01Classifier {
|
|
5
4
|
// @todo remove it once fixed as described: https://product-fabric.atlassian.net/browse/AFO-3443
|
|
@@ -31,7 +30,6 @@ export class FY25_02Classifier extends FY25_01Classifier {
|
|
|
31
30
|
}]);
|
|
32
31
|
_defineProperty(this, "removedFilters", []);
|
|
33
32
|
this.mergeConfig();
|
|
34
|
-
this.filterComponentsLog = withProfiling(this.filterComponentsLog.bind(this), ['vc']);
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
35
|
export const revFY25_02Classifier = new FY25_02Classifier();
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import { withProfiling } from '../../../self-measurements';
|
|
3
2
|
import { revFY25_01Classifier } from './fy25_01';
|
|
4
3
|
import { revFY25_02Classifier } from './fy25_02';
|
|
5
|
-
export
|
|
4
|
+
export function getRevisions() {
|
|
6
5
|
if (fg('platform_ufo_disable_ttvc_v1')) {
|
|
7
6
|
return [{
|
|
8
7
|
name: 'fy25.02',
|
|
@@ -16,4 +15,4 @@ export const getRevisions = withProfiling(function getRevisions() {
|
|
|
16
15
|
name: 'fy25.02',
|
|
17
16
|
classifier: revFY25_02Classifier
|
|
18
17
|
}];
|
|
19
|
-
}
|
|
18
|
+
}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
3
2
|
export default class EntriesTimeline {
|
|
4
3
|
constructor() {
|
|
5
4
|
_defineProperty(this, "unorderedEntries", []);
|
|
6
5
|
_defineProperty(this, "sortedEntriesCache", new Map());
|
|
7
|
-
const operationTimer = markProfilingStart('EntriesTimeline constructor');
|
|
8
6
|
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
|
-
});
|
|
16
7
|
}
|
|
17
8
|
push(entry) {
|
|
18
9
|
this.unorderedEntries.push(entry);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { withProfiling } from '../../self-measurements';
|
|
2
1
|
const nameCache = new WeakMap();
|
|
3
|
-
|
|
2
|
+
function getElementName(selectorConfig, element) {
|
|
4
3
|
if (!(element instanceof HTMLElement)) {
|
|
5
4
|
return 'error';
|
|
6
5
|
}
|
|
@@ -65,5 +64,5 @@ const getElementName = withProfiling(function getElementName(selectorConfig, ele
|
|
|
65
64
|
const name = `${tagName}${attributes || classList}`;
|
|
66
65
|
nameCache.set(element, name);
|
|
67
66
|
return name;
|
|
68
|
-
}
|
|
67
|
+
}
|
|
69
68
|
export default getElementName;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { withProfiling } from '../../self-measurements';
|
|
2
1
|
const nameCache = new WeakMap();
|
|
3
|
-
|
|
2
|
+
function getAttributeSelector(element, attributeName) {
|
|
4
3
|
const attrValue = element.getAttribute(attributeName);
|
|
5
4
|
if (!attrValue) {
|
|
6
5
|
return '';
|
|
7
6
|
}
|
|
8
7
|
return `[${attributeName}="${attrValue}"]`;
|
|
9
|
-
}
|
|
10
|
-
|
|
8
|
+
}
|
|
9
|
+
function isValidSelector(selector) {
|
|
11
10
|
try {
|
|
12
11
|
document.querySelector(selector);
|
|
13
12
|
return true;
|
|
14
13
|
} catch (err) {
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
16
|
+
}
|
|
17
|
+
function isSelectorUnique(selector) {
|
|
19
18
|
return document.querySelectorAll(selector).length === 1;
|
|
20
|
-
}
|
|
21
|
-
|
|
19
|
+
}
|
|
20
|
+
function getUniqueSelector(selectorConfig, element) {
|
|
22
21
|
let currentElement = element;
|
|
23
22
|
const parts = [];
|
|
24
23
|
const MAX_DEPTH = 3;
|
|
@@ -60,8 +59,8 @@ const getUniqueSelector = withProfiling(function getUniqueSelector(selectorConfi
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
return potentialSelector;
|
|
63
|
-
}
|
|
64
|
-
|
|
62
|
+
}
|
|
63
|
+
function getElementName(selectorConfig, element) {
|
|
65
64
|
if (!(element instanceof HTMLElement)) {
|
|
66
65
|
return 'error';
|
|
67
66
|
}
|
|
@@ -72,5 +71,5 @@ const getElementName = withProfiling(function getElementName(selectorConfig, ele
|
|
|
72
71
|
const uniqueSelector = getUniqueSelector(selectorConfig, element);
|
|
73
72
|
nameCache.set(element, uniqueSelector);
|
|
74
73
|
return uniqueSelector;
|
|
75
|
-
}
|
|
74
|
+
}
|
|
76
75
|
export default getElementName;
|