@atlaskit/react-ufo 3.4.14 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +6 -6
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/cjs/assets/index.js +17 -14
- package/dist/cjs/assets/utils.js +9 -8
- package/dist/cjs/bundle-eval-timing/index.js +8 -8
- package/dist/cjs/coinflip/index.js +5 -3
- package/dist/cjs/common/constants.js +3 -2
- package/dist/cjs/common/react-ufo-payload-schema.js +5 -0
- package/dist/cjs/config/index.js +30 -42
- package/dist/cjs/create-experimental-interaction-metrics-payload/index.js +29 -39
- package/dist/cjs/create-payload/common/utils/index.js +16 -20
- package/dist/cjs/create-payload/index.js +150 -140
- package/dist/cjs/create-payload/utils/get-interaction-status.js +5 -3
- package/dist/cjs/create-payload/utils/get-page-visibility-up-to-ttai.js +5 -3
- package/dist/cjs/create-payload/utils/get-ssr-done-time-value.js +5 -3
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +10 -8
- package/dist/cjs/create-post-interaction-log-payload/index.js +15 -13
- package/dist/cjs/custom-data/index.js +4 -3
- package/dist/cjs/custom-mark/index.js +4 -3
- package/dist/cjs/custom-spans/index.js +4 -3
- package/dist/cjs/custom-timings/index.js +6 -6
- package/dist/cjs/experience-trace-id-context/index.js +15 -14
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/cjs/feature-flags-accessed/index.js +3 -2
- package/dist/cjs/generate-id/index.js +5 -3
- package/dist/cjs/global-error-handler/index.js +14 -13
- package/dist/cjs/initial-page-load-extra-timing/index.js +6 -6
- package/dist/cjs/interaction-metrics/index.js +110 -145
- package/dist/cjs/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/cjs/interaction-metrics-init/index.js +17 -10
- package/dist/cjs/interaction-metrics-init/schedule-idle-callback.js +8 -4
- package/dist/cjs/resource-timing/common/utils/config.js +10 -10
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/cjs/resource-timing/main.js +27 -20
- package/dist/cjs/resource-timing/utils.js +4 -3
- package/dist/cjs/round-number/index.js +3 -2
- package/dist/cjs/route-name/index.js +5 -3
- package/dist/cjs/segment/schedule-on-paint.js +8 -5
- package/dist/cjs/segment/segment.js +9 -5
- package/dist/cjs/self-measurements/index.js +261 -0
- package/dist/cjs/set-interaction-error/index.js +4 -3
- package/dist/cjs/short-id/index.js +5 -3
- package/dist/cjs/ssr/index.js +18 -21
- package/dist/cjs/trace-interaction/index.js +7 -5
- package/dist/cjs/trace-pageload/index.js +7 -6
- package/dist/cjs/trace-press/index.js +5 -3
- package/dist/cjs/trace-redirect/index.js +5 -3
- package/dist/cjs/trace-transition/index.js +6 -4
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/cjs/vc/index.js +17 -6
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +41 -26
- package/dist/cjs/vc/vc-observer/getViewport.js +6 -6
- package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/cjs/vc/vc-observer/index.js +170 -133
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/cjs/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/cjs/vc/vc-observer/observers/index.js +82 -25
- package/dist/cjs/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +5 -8
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/cjs/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/cjs/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/get-element-name.js +5 -3
- package/dist/cjs/vc/vc-observer-new/get-unique-element-name.js +13 -11
- package/dist/cjs/vc/vc-observer-new/index.js +9 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +20 -12
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +27 -26
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +27 -14
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +50 -40
- package/dist/cjs/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +10 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +5 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -8
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/cjs/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/cjs/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +16 -13
- package/dist/cjs/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/cjs/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +6 -5
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +16 -13
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/es2019/assets/index.js +19 -14
- package/dist/es2019/assets/utils.js +11 -9
- package/dist/es2019/bundle-eval-timing/index.js +7 -6
- package/dist/es2019/coinflip/index.js +5 -2
- package/dist/es2019/common/constants.js +3 -2
- package/dist/es2019/common/react-ufo-payload-schema.js +1 -0
- package/dist/es2019/config/index.js +29 -28
- package/dist/es2019/create-experimental-interaction-metrics-payload/index.js +18 -15
- package/dist/es2019/create-payload/common/utils/index.js +15 -14
- package/dist/es2019/create-payload/index.js +87 -71
- package/dist/es2019/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/es2019/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/es2019/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +4 -2
- package/dist/es2019/create-post-interaction-log-payload/index.js +14 -12
- package/dist/es2019/custom-data/index.js +3 -2
- package/dist/es2019/custom-mark/index.js +3 -2
- package/dist/es2019/custom-spans/index.js +3 -2
- package/dist/es2019/custom-timings/index.js +5 -4
- package/dist/es2019/experience-trace-id-context/index.js +16 -13
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +6 -3
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +14 -7
- package/dist/es2019/feature-flags-accessed/index.js +3 -2
- package/dist/es2019/generate-id/index.js +4 -2
- package/dist/es2019/global-error-handler/index.js +15 -12
- package/dist/es2019/initial-page-load-extra-timing/index.js +5 -4
- package/dist/es2019/interaction-metrics/index.js +109 -108
- package/dist/es2019/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/es2019/interaction-metrics-init/index.js +17 -10
- package/dist/es2019/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/es2019/resource-timing/common/utils/config.js +10 -7
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +14 -11
- package/dist/es2019/resource-timing/main.js +33 -18
- package/dist/es2019/resource-timing/utils.js +3 -2
- package/dist/es2019/round-number/index.js +3 -2
- package/dist/es2019/route-name/index.js +4 -2
- package/dist/es2019/segment/schedule-on-paint.js +7 -4
- package/dist/es2019/segment/segment.js +9 -5
- package/dist/es2019/self-measurements/index.js +213 -0
- package/dist/es2019/set-interaction-error/index.js +3 -2
- package/dist/es2019/short-id/index.js +4 -2
- package/dist/es2019/ssr/index.js +21 -16
- package/dist/es2019/trace-interaction/index.js +6 -4
- package/dist/es2019/trace-pageload/index.js +6 -4
- package/dist/es2019/trace-press/index.js +4 -2
- package/dist/es2019/trace-redirect/index.js +4 -2
- package/dist/es2019/trace-transition/index.js +5 -3
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +4 -1
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/es2019/vc/index.js +16 -4
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +41 -25
- package/dist/es2019/vc/vc-observer/getViewport.js +5 -4
- package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +28 -10
- package/dist/es2019/vc/vc-observer/index.js +158 -116
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/es2019/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/es2019/vc/vc-observer/observers/index.js +80 -25
- package/dist/es2019/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -7
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/es2019/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/es2019/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/es2019/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/es2019/vc/vc-observer-new/index.js +9 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +3 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +14 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +6 -4
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +21 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +10 -8
- package/dist/es2019/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/task-yield.js +5 -2
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/es2019/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/es2019/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -13
- package/dist/es2019/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -9
- package/dist/es2019/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +5 -4
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +3 -2
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +3 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +9 -7
- package/dist/esm/assets/index.js +17 -14
- package/dist/esm/assets/utils.js +10 -8
- package/dist/esm/bundle-eval-timing/index.js +7 -6
- package/dist/esm/coinflip/index.js +5 -2
- package/dist/esm/common/constants.js +3 -2
- package/dist/esm/common/react-ufo-payload-schema.js +1 -0
- package/dist/esm/config/index.js +29 -28
- package/dist/esm/create-experimental-interaction-metrics-payload/index.js +28 -35
- package/dist/esm/create-payload/common/utils/index.js +15 -14
- package/dist/esm/create-payload/index.js +149 -139
- package/dist/esm/create-payload/utils/get-interaction-status.js +5 -2
- package/dist/esm/create-payload/utils/get-page-visibility-up-to-ttai.js +4 -2
- package/dist/esm/create-payload/utils/get-ssr-done-time-value.js +4 -2
- package/dist/esm/create-payload/utils/get-vc-metrics.js +9 -7
- package/dist/esm/create-post-interaction-log-payload/index.js +14 -12
- package/dist/esm/custom-data/index.js +3 -2
- package/dist/esm/custom-mark/index.js +3 -2
- package/dist/esm/custom-spans/index.js +3 -2
- package/dist/esm/custom-timings/index.js +5 -4
- package/dist/esm/experience-trace-id-context/index.js +15 -14
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +3 -2
- package/dist/esm/feature-flags-accessed/common/utils/index.js +11 -10
- package/dist/esm/feature-flags-accessed/index.js +3 -2
- package/dist/esm/generate-id/index.js +4 -2
- package/dist/esm/global-error-handler/index.js +14 -13
- package/dist/esm/initial-page-load-extra-timing/index.js +5 -4
- package/dist/esm/interaction-metrics/index.js +109 -108
- package/dist/esm/interaction-metrics/post-interaction-log.js +10 -0
- package/dist/esm/interaction-metrics-init/index.js +17 -10
- package/dist/esm/interaction-metrics-init/schedule-idle-callback.js +7 -3
- package/dist/esm/resource-timing/common/utils/config.js +9 -8
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +13 -12
- package/dist/esm/resource-timing/main.js +27 -20
- package/dist/esm/resource-timing/utils.js +3 -2
- package/dist/esm/round-number/index.js +3 -2
- package/dist/esm/route-name/index.js +4 -2
- package/dist/esm/segment/schedule-on-paint.js +7 -4
- package/dist/esm/segment/segment.js +9 -5
- package/dist/esm/self-measurements/index.js +246 -0
- package/dist/esm/set-interaction-error/index.js +3 -2
- package/dist/esm/short-id/index.js +4 -2
- package/dist/esm/ssr/index.js +17 -16
- package/dist/esm/trace-interaction/index.js +6 -4
- package/dist/esm/trace-pageload/index.js +6 -4
- package/dist/esm/trace-press/index.js +4 -2
- package/dist/esm/trace-redirect/index.js +4 -2
- package/dist/esm/trace-transition/index.js +5 -3
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +3 -2
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +3 -2
- package/dist/esm/vc/index.js +16 -4
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +3 -2
- package/dist/esm/vc/vc-observer/getVCRevisionsData.js +40 -25
- package/dist/esm/vc/vc-observer/getViewport.js +5 -4
- package/dist/esm/vc/vc-observer/heatmap/heatmap.js +28 -12
- package/dist/esm/vc/vc-observer/index.js +170 -133
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +3 -2
- package/dist/esm/vc/vc-observer/observers/editor-lnv/index.js +17 -0
- package/dist/esm/vc/vc-observer/observers/index.js +82 -25
- package/dist/esm/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.js +4 -7
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +17 -2
- package/dist/esm/vc/vc-observer/revisions/fy25_01.js +7 -7
- package/dist/esm/vc/vc-observer/revisions/fy25_02.js +2 -0
- package/dist/esm/vc/vc-observer/revisions/revisions.js +3 -2
- package/dist/esm/vc/vc-observer-new/entries-timeline/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/get-element-name.js +4 -2
- package/dist/esm/vc/vc-observer-new/get-unique-element-name.js +12 -10
- package/dist/esm/vc/vc-observer-new/index.js +9 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +2 -0
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +6 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.js +19 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.js +26 -24
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/heatmap.js +18 -6
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.js +26 -13
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.js +49 -39
- package/dist/esm/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.js +9 -7
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/task-yield.js +10 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +15 -7
- package/dist/esm/vc/vc-observer-new/viewport-observer/intersection-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/mutation-observer/index.js +15 -12
- package/dist/esm/vc/vc-observer-new/viewport-observer/performance-observer/index.js +11 -7
- package/dist/esm/vc/vc-observer-new/window-event-observer/index.js +7 -1
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types/assets/index.d.ts +3 -1
- package/dist/types/assets/utils.d.ts +1 -1
- package/dist/types/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types/coinflip/index.d.ts +2 -1
- package/dist/types/common/index.d.ts +2 -1
- package/dist/types/common/react-ufo-payload-schema.d.ts +175 -0
- package/dist/types/common/vc/types.d.ts +20 -10
- package/dist/types/config/index.d.ts +14 -16
- package/dist/types/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types/create-payload/index.d.ts +1250 -1537
- package/dist/types/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types/custom-data/index.d.ts +1 -1
- package/dist/types/custom-mark/index.d.ts +1 -1
- package/dist/types/custom-spans/index.d.ts +1 -1
- package/dist/types/custom-timings/index.d.ts +2 -2
- package/dist/types/generate-id/index.d.ts +2 -1
- package/dist/types/hidden-timing/index.d.ts +1 -1
- package/dist/types/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types/interaction-context/index.d.ts +3 -3
- package/dist/types/interaction-metrics/index.d.ts +42 -42
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types/resource-timing/utils.d.ts +1 -1
- package/dist/types/round-number/index.d.ts +1 -1
- package/dist/types/route-name/index.d.ts +4 -3
- package/dist/types/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types/self-measurements/index.d.ts +57 -0
- package/dist/types/set-interaction-error/index.d.ts +1 -1
- package/dist/types/short-id/index.d.ts +2 -1
- package/dist/types/ssr/index.d.ts +5 -5
- package/dist/types/trace-interaction/index.d.ts +2 -1
- package/dist/types/trace-pageload/index.d.ts +3 -2
- package/dist/types/trace-press/index.d.ts +2 -1
- package/dist/types/trace-redirect/index.d.ts +2 -1
- package/dist/types/trace-transition/index.d.ts +2 -1
- package/dist/types/vc/index.d.ts +2 -2
- package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types/vc/vc-observer/index.d.ts +4 -4
- package/dist/types/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +1 -1
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +2 -2
- package/dist/types-ts4.5/assets/index.d.ts +3 -1
- package/dist/types-ts4.5/assets/utils.d.ts +1 -1
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/coinflip/index.d.ts +2 -1
- package/dist/types-ts4.5/common/index.d.ts +2 -1
- package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +177 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +20 -10
- package/dist/types-ts4.5/config/index.d.ts +14 -20
- package/dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts +4 -3
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +6 -7
- package/dist/types-ts4.5/create-payload/index.d.ts +1250 -1537
- package/dist/types-ts4.5/create-payload/utils/get-interaction-status.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-page-visibility-up-to-ttai.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-ssr-done-time-value.d.ts +2 -1
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +3 -2
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +3 -2
- package/dist/types-ts4.5/custom-data/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-mark/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-spans/index.d.ts +1 -1
- package/dist/types-ts4.5/custom-timings/index.d.ts +2 -2
- package/dist/types-ts4.5/generate-id/index.d.ts +2 -1
- package/dist/types-ts4.5/hidden-timing/index.d.ts +1 -1
- package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +2 -2
- package/dist/types-ts4.5/interaction-context/index.d.ts +3 -3
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +42 -42
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +1 -0
- package/dist/types-ts4.5/interaction-metrics-init/schedule-idle-callback.d.ts +2 -1
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +1 -1
- package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -1
- package/dist/types-ts4.5/round-number/index.d.ts +1 -1
- package/dist/types-ts4.5/route-name/index.d.ts +4 -3
- package/dist/types-ts4.5/segment/schedule-on-paint.d.ts +2 -1
- package/dist/types-ts4.5/self-measurements/index.d.ts +57 -0
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +1 -1
- package/dist/types-ts4.5/short-id/index.d.ts +2 -1
- package/dist/types-ts4.5/ssr/index.d.ts +5 -5
- package/dist/types-ts4.5/trace-interaction/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-pageload/index.d.ts +3 -2
- package/dist/types-ts4.5/trace-press/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-redirect/index.d.ts +2 -1
- package/dist/types-ts4.5/trace-transition/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/index.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +7 -7
- package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +7 -4
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +4 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/non-visual-styles/is-non-visual-style-mutation.d.ts +5 -4
- package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/get-unique-element-name.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/canvas-pixel.d.ts +2 -3
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/canvas-heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/heatmap/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/calc-union-area.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/percentile-calc/rect-sweeping-line/index.d.ts +3 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-height.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/get-viewport-width.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-viewport-entry-data.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/task-yield.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/mutation-observer/index.d.ts +2 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/performance-observer/index.d.ts +3 -3
- package/package.json +12 -12
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
1
2
|
import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
|
|
2
3
|
import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
|
|
3
4
|
import { createIntersectionObserver } from './intersection-observer';
|
|
4
5
|
import createMutationObserver from './mutation-observer';
|
|
5
6
|
import createPerformanceObserver from './performance-observer';
|
|
6
|
-
function isElementVisible(element) {
|
|
7
|
+
const isElementVisible = withProfiling(function isElementVisible(element) {
|
|
7
8
|
if (!(element instanceof HTMLElement)) {
|
|
8
9
|
return true;
|
|
9
10
|
}
|
|
@@ -19,23 +20,25 @@ function isElementVisible(element) {
|
|
|
19
20
|
// there is no support for checkVisibility
|
|
20
21
|
return true;
|
|
21
22
|
}
|
|
22
|
-
}
|
|
23
|
-
function sameRectSize(a, b) {
|
|
23
|
+
}, ['vc']);
|
|
24
|
+
const sameRectSize = withProfiling(function sameRectSize(a, b) {
|
|
24
25
|
if (!a || !b) {
|
|
25
26
|
return false;
|
|
26
27
|
}
|
|
27
28
|
return a.width === b.width && a.height === b.height;
|
|
28
|
-
}
|
|
29
|
-
function sameRectDimensions(a, b) {
|
|
29
|
+
}, ['vc']);
|
|
30
|
+
const sameRectDimensions = withProfiling(function sameRectDimensions(a, b) {
|
|
30
31
|
if (!a || !b) {
|
|
31
32
|
return false;
|
|
32
33
|
}
|
|
33
34
|
return a.width === b.width && a.height === b.height && a.x === b.x && a.y === b.y;
|
|
34
|
-
}
|
|
35
|
+
}, ['vc']);
|
|
35
36
|
export default class ViewportObserver {
|
|
36
37
|
constructor({
|
|
37
|
-
onChange
|
|
38
|
+
onChange: _onChange
|
|
38
39
|
}) {
|
|
40
|
+
const onChange = withProfiling(_onChange, ['vc']);
|
|
41
|
+
const operationTimer = markProfilingStart('ViewportObserver constructor');
|
|
39
42
|
this.mapVisibleNodeRects = new WeakMap();
|
|
40
43
|
this.intersectionObserver = createIntersectionObserver({
|
|
41
44
|
onEntry: ({
|
|
@@ -164,6 +167,11 @@ export default class ViewportObserver {
|
|
|
164
167
|
}
|
|
165
168
|
}
|
|
166
169
|
});
|
|
170
|
+
this.start = withProfiling(this.start.bind(this), ['vc']);
|
|
171
|
+
this.stop = withProfiling(this.stop.bind(this), ['vc']);
|
|
172
|
+
markProfilingEnd(operationTimer, {
|
|
173
|
+
tags: ['vc']
|
|
174
|
+
});
|
|
167
175
|
}
|
|
168
176
|
start() {
|
|
169
177
|
var _this$mutationObserve, _this$performanceObse;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
const isValidEntry = withProfiling(function isValidEntry(entry) {
|
|
2
3
|
return entry.isIntersecting && entry.intersectionRect.width > 0 && entry.intersectionRect.height > 0;
|
|
3
|
-
}
|
|
4
|
+
}, ['vc']);
|
|
4
5
|
export function createIntersectionObserver(args) {
|
|
5
6
|
if (!window || typeof window.IntersectionObserver !== 'function') {
|
|
6
7
|
return null;
|
|
7
8
|
}
|
|
9
|
+
const onEntry = withProfiling(args.onEntry, ['vc']);
|
|
10
|
+
const onObserved = typeof args.onObserved === 'function' ? withProfiling(args.onObserved, ['vc']) : undefined;
|
|
8
11
|
const callbacksPerElement = new WeakMap();
|
|
9
|
-
const
|
|
10
|
-
var _args$onObserved;
|
|
12
|
+
const intersectionObserverCallback = withProfiling(function intersectionObserverCallback(entries) {
|
|
11
13
|
const validEntries = [];
|
|
12
14
|
const startTime = performance.now();
|
|
13
15
|
entries.forEach(entry => {
|
|
@@ -34,7 +36,7 @@ export function createIntersectionObserver(args) {
|
|
|
34
36
|
} else if (typeof tagOrCallback === 'string') {
|
|
35
37
|
mutationTag = tagOrCallback;
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
onEntry({
|
|
38
40
|
target: entry.target,
|
|
39
41
|
rect: entry.intersectionRect,
|
|
40
42
|
time: entry.time,
|
|
@@ -45,21 +47,22 @@ export function createIntersectionObserver(args) {
|
|
|
45
47
|
callbacksPerElement.delete(entry.target);
|
|
46
48
|
observer.unobserve(entry.target);
|
|
47
49
|
});
|
|
48
|
-
|
|
50
|
+
onObserved === null || onObserved === void 0 ? void 0 : onObserved({
|
|
49
51
|
time: startTime,
|
|
50
52
|
elements: validEntries
|
|
51
53
|
});
|
|
52
54
|
});
|
|
55
|
+
const observer = new IntersectionObserver(intersectionObserverCallback);
|
|
53
56
|
return {
|
|
54
|
-
disconnect: ()
|
|
57
|
+
disconnect: withProfiling(function disconnect() {
|
|
55
58
|
observer.disconnect();
|
|
56
|
-
},
|
|
57
|
-
unobserve: target
|
|
59
|
+
}, ['vc']),
|
|
60
|
+
unobserve: withProfiling(function unobserve(target) {
|
|
58
61
|
observer.unobserve(target);
|
|
59
|
-
},
|
|
60
|
-
watchAndTag: (target, tagOrCallback)
|
|
62
|
+
}, ['vc']),
|
|
63
|
+
watchAndTag: withProfiling(function watchAndTag(target, tagOrCallback) {
|
|
61
64
|
callbacksPerElement.set(target, tagOrCallback);
|
|
62
65
|
observer.observe(target);
|
|
63
|
-
}
|
|
66
|
+
}, ['vc'])
|
|
64
67
|
};
|
|
65
68
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
onChildListMutation,
|
|
5
|
-
onMutationFinished
|
|
6
|
-
}) {
|
|
2
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
3
|
+
const createMutationObserver = withProfiling(function createMutationObserver(props) {
|
|
7
4
|
if (!window || typeof window.IntersectionObserver !== 'function') {
|
|
8
5
|
return null;
|
|
9
6
|
}
|
|
10
|
-
const
|
|
7
|
+
const onAttributeMutation = withProfiling(props.onAttributeMutation, ['vc']);
|
|
8
|
+
const onChildListMutation = withProfiling(props.onChildListMutation, ['vc']);
|
|
9
|
+
const onMutationFinished = typeof props.onMutationFinished === 'function' ? withProfiling(props.onMutationFinished, ['vc']) : undefined;
|
|
10
|
+
const mutationObserverCallback = withProfiling(function mutationObserverCallback(mutations) {
|
|
11
11
|
const addedNodes = [];
|
|
12
12
|
const removedNodes = [];
|
|
13
13
|
const targets = [];
|
|
@@ -19,12 +19,12 @@ export default function createMutationObserver({
|
|
|
19
19
|
if (fg('platform_ufo_vc_ignore_same_value_mutation')) {
|
|
20
20
|
var _mut$oldValue;
|
|
21
21
|
/*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
"MutationObserver was explicitly designed to work that way, but I can't now recall the reasoning.
|
|
23
|
+
I think it might have been something along the lines that for consistency every setAttribute call should create a record.
|
|
24
|
+
Conceptually there is after all a mutation: there is an old value replaced with a new one,
|
|
25
|
+
and whether or not they are the same doesn't really matter.
|
|
26
|
+
And Custom elements should work the same way as MutationObserver."
|
|
27
|
+
https://github.com/whatwg/dom/issues/520#issuecomment-336574796
|
|
28
28
|
*/
|
|
29
29
|
const oldValue = (_mut$oldValue = mut.oldValue) !== null && _mut$oldValue !== void 0 ? _mut$oldValue : undefined;
|
|
30
30
|
const newValue = mut.attributeName ? mut.target.getAttribute(mut.attributeName) : undefined;
|
|
@@ -66,5 +66,7 @@ export default function createMutationObserver({
|
|
|
66
66
|
targets
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
|
+
const observer = new MutationObserver(mutationObserverCallback);
|
|
69
70
|
return observer;
|
|
70
|
-
}
|
|
71
|
+
}, ['vc']);
|
|
72
|
+
export default createMutationObserver;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
2
|
+
|
|
1
3
|
// The LayoutShiftAttribution API is returning the numbers on physical dimension
|
|
2
|
-
export function convertPhysicalToLogicalResolution(rect) {
|
|
4
|
+
export const convertPhysicalToLogicalResolution = withProfiling(function convertPhysicalToLogicalResolution(rect) {
|
|
3
5
|
if (typeof window.devicePixelRatio !== 'number') {
|
|
4
6
|
return rect;
|
|
5
7
|
}
|
|
@@ -9,15 +11,13 @@ export function convertPhysicalToLogicalResolution(rect) {
|
|
|
9
11
|
|
|
10
12
|
// eslint-disable-next-line compat/compat
|
|
11
13
|
return new DOMRect(rect.x / window.devicePixelRatio, rect.y / window.devicePixelRatio, rect.width / window.devicePixelRatio, rect.height / window.devicePixelRatio);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
+
}, ['vc']);
|
|
15
|
+
const createPerformanceObserver = withProfiling(function createPerformanceObserver(args) {
|
|
14
16
|
if (!window || typeof window.PerformanceObserver !== 'function') {
|
|
15
17
|
return null;
|
|
16
18
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
} = args;
|
|
20
|
-
const observer = new PerformanceObserver(entries => {
|
|
19
|
+
const onLayoutShift = withProfiling(args.onLayoutShift, ['vc']);
|
|
20
|
+
const performanceObserverCallback = withProfiling(function performanceObserverCallback(entries) {
|
|
21
21
|
for (const entry of entries.getEntries()) {
|
|
22
22
|
if (entry.entryType === 'layout-shift') {
|
|
23
23
|
// Ignored via go/ees005
|
|
@@ -36,6 +36,8 @@ export default function createPerformanceObserver(args) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
});
|
|
39
|
+
}, ['vc']);
|
|
40
|
+
const observer = new PerformanceObserver(performanceObserverCallback);
|
|
40
41
|
return observer;
|
|
41
|
-
}
|
|
42
|
+
}, ['vc']);
|
|
43
|
+
export default createPerformanceObserver;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
|
+
import { markProfilingEnd, markProfilingStart, withProfiling } from '../../../self-measurements';
|
|
3
4
|
export default class WindowEventObserver {
|
|
4
5
|
constructor(opts) {
|
|
5
6
|
_defineProperty(this, "unbindFns", []);
|
|
6
|
-
|
|
7
|
+
const operationTimer = markProfilingStart('WindowEventObserver constructor');
|
|
8
|
+
this.onEvent = withProfiling(opts.onEvent, ['vc']);
|
|
9
|
+
this.bindEvent = withProfiling(this.bindEvent.bind(this), ['vc']);
|
|
10
|
+
this.start = withProfiling(this.start.bind(this), ['vc']);
|
|
11
|
+
this.stop = withProfiling(this.stop.bind(this), ['vc']);
|
|
12
|
+
markProfilingEnd(operationTimer);
|
|
7
13
|
}
|
|
8
14
|
bindEvent(type) {
|
|
9
15
|
const unbindCallback = bind(window, {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { withProfiling } from '../../../self-measurements';
|
|
1
2
|
/* Borrowed from https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/performance/browser-metrics/src/plugins/timings/resource.ts */
|
|
2
3
|
var cacheableTypes = ['script', 'link'];
|
|
3
4
|
var CACHE_NETWORK = 'network';
|
|
4
5
|
var CACHE_MEMORY = 'memory';
|
|
5
6
|
var CACHE_DISK = 'disk';
|
|
6
|
-
var calculateTransferType = function calculateTransferType(type, duration, size) {
|
|
7
|
+
var calculateTransferType = withProfiling(function calculateTransferType(type, duration, size) {
|
|
7
8
|
if (!cacheableTypes.includes(type)) {
|
|
8
9
|
return CACHE_NETWORK;
|
|
9
10
|
}
|
|
@@ -17,8 +18,8 @@ var calculateTransferType = function calculateTransferType(type, duration, size)
|
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
20
|
return CACHE_NETWORK;
|
|
20
|
-
};
|
|
21
|
-
export var getCacheHitRatio = function getCacheHitRatio(_ref) {
|
|
21
|
+
});
|
|
22
|
+
export var getCacheHitRatio = withProfiling(function getCacheHitRatio(_ref) {
|
|
22
23
|
var start = _ref.start;
|
|
23
24
|
var fromCache = 0;
|
|
24
25
|
var preloadFromCache = 0;
|
|
@@ -60,4 +61,4 @@ export var getCacheHitRatio = function getCacheHitRatio(_ref) {
|
|
|
60
61
|
} catch (e) {
|
|
61
62
|
return {};
|
|
62
63
|
}
|
|
63
|
-
};
|
|
64
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
2
|
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; } }
|
|
3
3
|
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; }
|
|
4
|
-
|
|
4
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
5
|
+
export var getCLS = withProfiling(function getCLS(start, stop, buffer) {
|
|
5
6
|
var layoutShifts = buffer.getAll().filter(function (entry) {
|
|
6
7
|
return entry.startTime >= start && entry.startTime <= stop;
|
|
7
8
|
});
|
|
@@ -44,4 +45,4 @@ export var getCLS = function getCLS(start, stop, buffer) {
|
|
|
44
45
|
|
|
45
46
|
// Return score of largest burst as CLS metric
|
|
46
47
|
return Math.round(maxScore * 10000) / 10000;
|
|
47
|
-
};
|
|
48
|
+
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { withProfiling } from '../../../self-measurements';
|
|
1
2
|
import { getCLS } from './cls';
|
|
2
3
|
import { PerformanceObserverEntryTypes } from './const';
|
|
3
4
|
import { getTBT } from './tbt';
|
|
4
5
|
import { EntriesBuffer } from './utils/buffer';
|
|
5
6
|
import { startLSObserver, startLTObserver } from './utils/observer';
|
|
6
|
-
export function startLighthouseObserver() {
|
|
7
|
+
export var startLighthouseObserver = withProfiling(function startLighthouseObserver() {
|
|
7
8
|
startLSObserver();
|
|
8
9
|
startLTObserver();
|
|
9
|
-
}
|
|
10
|
-
export var getLighthouseMetrics = function getLighthouseMetrics(_ref) {
|
|
10
|
+
});
|
|
11
|
+
export var getLighthouseMetrics = withProfiling(function getLighthouseMetrics(_ref) {
|
|
11
12
|
var start = _ref.start,
|
|
12
13
|
stop = _ref.stop;
|
|
13
14
|
var tbt = getTBT(start, stop, EntriesBuffer[PerformanceObserverEntryTypes.LongTask]);
|
|
@@ -19,4 +20,4 @@ export var getLighthouseMetrics = function getLighthouseMetrics(_ref) {
|
|
|
19
20
|
'metric:tbt:observed': Math.round(tbt.observed),
|
|
20
21
|
'metric:cls': cls
|
|
21
22
|
};
|
|
22
|
-
};
|
|
23
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../self-measurements';
|
|
1
2
|
var MAX_ACCEPTABLE_TASK_DURATION = 50;
|
|
2
|
-
export var getTBT = function getTBT(start, stop, buffer) {
|
|
3
|
+
export var getTBT = withProfiling(function getTBT(start, stop, buffer) {
|
|
3
4
|
return buffer.getAll().filter(function (entry) {
|
|
4
5
|
return entry.startTime <= stop && entry.duration > MAX_ACCEPTABLE_TASK_DURATION && (entry.startTime >= start || entry.startTime + entry.duration >= start || entry.startTime <= start && entry.startTime + entry.duration >= stop);
|
|
5
6
|
}).reduce(function (tbt, entry) {
|
|
@@ -16,4 +17,4 @@ export var getTBT = function getTBT(start, stop, buffer) {
|
|
|
16
17
|
total: 0,
|
|
17
18
|
observed: 0
|
|
18
19
|
});
|
|
19
|
-
};
|
|
20
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
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 { withProfiling } from '../../../../../self-measurements';
|
|
4
5
|
import { PerformanceObserverEntryTypes } from '../../const';
|
|
5
6
|
export var BufferWithMaxLength = /*#__PURE__*/function () {
|
|
6
7
|
function BufferWithMaxLength() {
|
|
@@ -9,6 +10,8 @@ export var BufferWithMaxLength = /*#__PURE__*/function () {
|
|
|
9
10
|
_defineProperty(this, "buffer", []);
|
|
10
11
|
_defineProperty(this, "full", false);
|
|
11
12
|
this.maxLength = maxLength;
|
|
13
|
+
this.push = withProfiling(this.push.bind(this));
|
|
14
|
+
this.getAll = withProfiling(this.getAll.bind(this));
|
|
12
15
|
}
|
|
13
16
|
return _createClass(BufferWithMaxLength, [{
|
|
14
17
|
key: "push",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { withProfiling } from '../../../../../self-measurements';
|
|
1
2
|
import { PerformanceObserverEntryTypes } from '../../const';
|
|
2
3
|
import { EntriesBuffer } from '../buffer';
|
|
3
4
|
var pe = null;
|
|
4
|
-
var getObserver = function getObserver() {
|
|
5
|
+
var getObserver = withProfiling(function getObserver() {
|
|
5
6
|
if (typeof PerformanceObserver !== 'function') {
|
|
6
7
|
// Only instantiate the IntersectionObserver if it's supported
|
|
7
8
|
return null;
|
|
@@ -9,7 +10,7 @@ var getObserver = function getObserver() {
|
|
|
9
10
|
if (pe !== null) {
|
|
10
11
|
return pe;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
var performanceObserverCallback = withProfiling(function performanceObserverCallback(list) {
|
|
13
14
|
list.getEntries().forEach(function (entry) {
|
|
14
15
|
if (entry.entryType === PerformanceObserverEntryTypes.LayoutShift) {
|
|
15
16
|
EntriesBuffer[PerformanceObserverEntryTypes.LayoutShift].push(entry);
|
|
@@ -19,19 +20,20 @@ var getObserver = function getObserver() {
|
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
});
|
|
23
|
+
pe = new PerformanceObserver(performanceObserverCallback);
|
|
22
24
|
return pe;
|
|
23
|
-
};
|
|
24
|
-
export var startLSObserver = function startLSObserver() {
|
|
25
|
+
});
|
|
26
|
+
export var startLSObserver = withProfiling(function startLSObserver() {
|
|
25
27
|
var _getObserver;
|
|
26
28
|
(_getObserver = getObserver()) === null || _getObserver === void 0 || _getObserver.observe({
|
|
27
29
|
type: PerformanceObserverEntryTypes.LayoutShift,
|
|
28
30
|
buffered: true
|
|
29
31
|
});
|
|
30
|
-
};
|
|
31
|
-
export var startLTObserver = function startLTObserver() {
|
|
32
|
+
});
|
|
33
|
+
export var startLTObserver = withProfiling(function startLTObserver() {
|
|
32
34
|
var _getObserver2;
|
|
33
35
|
(_getObserver2 = getObserver()) === null || _getObserver2 === void 0 || _getObserver2.observe({
|
|
34
36
|
type: PerformanceObserverEntryTypes.LongTask,
|
|
35
37
|
buffered: true
|
|
36
38
|
});
|
|
37
|
-
};
|
|
39
|
+
});
|
package/dist/esm/assets/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
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
|
+
var _CHRSummary;
|
|
5
|
+
import { withProfiling } from '../self-measurements';
|
|
4
6
|
import { calculateTransferType, checkIfTimingsAvailable, DISK_KEY, getTypeOfRequest, MEMORY_KEY, NETWORK_KEY, round } from './utils';
|
|
5
7
|
export var CHRSummary = /*#__PURE__*/function () {
|
|
6
8
|
function CHRSummary() {
|
|
@@ -9,6 +11,7 @@ export var CHRSummary = /*#__PURE__*/function () {
|
|
|
9
11
|
_defineProperty(this, "bundlesCount", 0);
|
|
10
12
|
_defineProperty(this, "size", _defineProperty(_defineProperty(_defineProperty({}, MEMORY_KEY, 0), DISK_KEY, 0), NETWORK_KEY, 0));
|
|
11
13
|
_defineProperty(this, "sizeTotal", 0);
|
|
14
|
+
this.add = withProfiling(this.add.bind(this));
|
|
12
15
|
}
|
|
13
16
|
return _createClass(CHRSummary, [{
|
|
14
17
|
key: "add",
|
|
@@ -23,22 +26,21 @@ export var CHRSummary = /*#__PURE__*/function () {
|
|
|
23
26
|
this.size[type] += encodedSize;
|
|
24
27
|
this.sizeTotal += encodedSize;
|
|
25
28
|
}
|
|
26
|
-
}], [{
|
|
27
|
-
key: "makePayload",
|
|
28
|
-
value: function makePayload(summary) {
|
|
29
|
-
var size = summary.size,
|
|
30
|
-
bundlesCount = summary.bundlesCount,
|
|
31
|
-
sizeTotal = summary.sizeTotal;
|
|
32
|
-
var cachedSize = size[MEMORY_KEY] + size[DISK_KEY];
|
|
33
|
-
var sizeRatio = round(cachedSize / summary.sizeTotal);
|
|
34
|
-
return {
|
|
35
|
-
size: sizeTotal,
|
|
36
|
-
chr: sizeRatio,
|
|
37
|
-
count: bundlesCount
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
29
|
}]);
|
|
41
30
|
}();
|
|
31
|
+
_CHRSummary = CHRSummary;
|
|
32
|
+
_defineProperty(CHRSummary, "makePayload", withProfiling(function makePayload(summary) {
|
|
33
|
+
var size = summary.size,
|
|
34
|
+
bundlesCount = summary.bundlesCount,
|
|
35
|
+
sizeTotal = summary.sizeTotal;
|
|
36
|
+
var cachedSize = size[MEMORY_KEY] + size[DISK_KEY];
|
|
37
|
+
var sizeRatio = round(cachedSize / summary.sizeTotal);
|
|
38
|
+
return {
|
|
39
|
+
size: sizeTotal,
|
|
40
|
+
chr: sizeRatio,
|
|
41
|
+
count: bundlesCount
|
|
42
|
+
};
|
|
43
|
+
}));
|
|
42
44
|
export var CHRReporter = /*#__PURE__*/function () {
|
|
43
45
|
function CHRReporter() {
|
|
44
46
|
_classCallCheck(this, CHRReporter);
|
|
@@ -46,6 +48,7 @@ export var CHRReporter = /*#__PURE__*/function () {
|
|
|
46
48
|
_defineProperty(this, "allAtlassian", new CHRSummary());
|
|
47
49
|
_defineProperty(this, "preloaded", new CHRSummary());
|
|
48
50
|
_defineProperty(this, "defaultAllowedTypes", ['js']);
|
|
51
|
+
this.get = withProfiling(this.get.bind(this));
|
|
49
52
|
}
|
|
50
53
|
return _createClass(CHRReporter, [{
|
|
51
54
|
key: "get",
|
package/dist/esm/assets/utils.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
|
|
1
3
|
/* Borrowed from https://bitbucket.org/atlassian/atlassian-frontend/src/master/packages/performance/browser-metrics/src/plugins/timings/resource.ts */
|
|
2
4
|
export var cacheableTypes = ['script', 'link', 'other'];
|
|
3
5
|
export var MEMORY_KEY = 'mem';
|
|
4
6
|
export var DISK_KEY = 'disk';
|
|
5
7
|
export var NETWORK_KEY = 'net';
|
|
6
|
-
export var calculateTransferType = function calculateTransferType(name, type, duration, size) {
|
|
8
|
+
export var calculateTransferType = withProfiling(function calculateTransferType(name, type, duration, size) {
|
|
7
9
|
if (!cacheableTypes.includes(type) && !(type === 'other' && name.includes('.js'))) {
|
|
8
10
|
return null;
|
|
9
11
|
}
|
|
@@ -17,8 +19,8 @@ export var calculateTransferType = function calculateTransferType(name, type, du
|
|
|
17
19
|
return null;
|
|
18
20
|
}
|
|
19
21
|
return NETWORK_KEY;
|
|
20
|
-
};
|
|
21
|
-
export var getTypeOfRequest = function getTypeOfRequest(_ref) {
|
|
22
|
+
});
|
|
23
|
+
export var getTypeOfRequest = withProfiling(function getTypeOfRequest(_ref) {
|
|
22
24
|
var name = _ref.name,
|
|
23
25
|
type = _ref.initiatorType;
|
|
24
26
|
var category = 'other';
|
|
@@ -54,16 +56,16 @@ export var getTypeOfRequest = function getTypeOfRequest(_ref) {
|
|
|
54
56
|
break;
|
|
55
57
|
}
|
|
56
58
|
return category;
|
|
57
|
-
};
|
|
58
|
-
export var checkIfTimingsAvailable = function checkIfTimingsAvailable(entry) {
|
|
59
|
+
});
|
|
60
|
+
export var checkIfTimingsAvailable = withProfiling(function checkIfTimingsAvailable(entry) {
|
|
59
61
|
if (entry.decodedSize === 0 && entry.encodedSize === 0 && entry.requestStart === 0 && entry.responseStart === 0) {
|
|
60
62
|
return false;
|
|
61
63
|
}
|
|
62
64
|
return true;
|
|
63
|
-
};
|
|
64
|
-
export var round = function round(n) {
|
|
65
|
+
});
|
|
66
|
+
export var round = withProfiling(function round(n) {
|
|
65
67
|
if (isNaN(n)) {
|
|
66
68
|
return 0;
|
|
67
69
|
}
|
|
68
70
|
return Math.round(n * 10000) / 10000;
|
|
69
|
-
};
|
|
71
|
+
});
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { roundEpsilon } from '../round-number';
|
|
2
|
+
import { withProfiling } from '../self-measurements';
|
|
2
3
|
var config = null;
|
|
3
|
-
export function configure(bundleEvalTimingConfiguration) {
|
|
4
|
+
export var configure = withProfiling(function configure(bundleEvalTimingConfiguration) {
|
|
4
5
|
config = bundleEvalTimingConfiguration;
|
|
5
|
-
}
|
|
6
|
-
var getPerformanceObject = function getPerformanceObject() {
|
|
6
|
+
});
|
|
7
|
+
var getPerformanceObject = withProfiling(function getPerformanceObject() {
|
|
7
8
|
var _window;
|
|
8
9
|
return ((_window = window) !== null && _window !== void 0 ? _window : {}).performance;
|
|
9
|
-
};
|
|
10
|
-
export function getBundleEvalTimings(interactionStartTime) {
|
|
10
|
+
});
|
|
11
|
+
export var getBundleEvalTimings = withProfiling(function getBundleEvalTimings(interactionStartTime) {
|
|
11
12
|
if (config == null) {
|
|
12
13
|
return {};
|
|
13
14
|
}
|
|
@@ -38,4 +39,4 @@ export function getBundleEvalTimings(interactionStartTime) {
|
|
|
38
39
|
return {};
|
|
39
40
|
}
|
|
40
41
|
return timings;
|
|
41
|
-
}
|
|
42
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { withProfiling } from '../self-measurements';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* A random function that passes one in rate times.
|
|
3
5
|
* E.g. coinflip(2) is the same as if you flipped a coin.
|
|
@@ -5,7 +7,7 @@
|
|
|
5
7
|
* @param rate The change that it will pass (1 in <rate> times)
|
|
6
8
|
* @returns bool, if it passes or not
|
|
7
9
|
*/
|
|
8
|
-
|
|
10
|
+
var coinflip = withProfiling(function coinflip(rate) {
|
|
9
11
|
if (rate === 0) {
|
|
10
12
|
return false;
|
|
11
13
|
} else if (rate === 1) {
|
|
@@ -13,4 +15,5 @@ export default function coinflip(rate) {
|
|
|
13
15
|
} else {
|
|
14
16
|
return Math.random() * rate <= 1;
|
|
15
17
|
}
|
|
16
|
-
}
|
|
18
|
+
});
|
|
19
|
+
export default coinflip;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
|
|
2
|
+
import { withProfiling } from '../self-measurements';
|
|
3
|
+
export var getReactUFOVersion = withProfiling(function getReactUFOVersion(interactionType) {
|
|
3
4
|
if (interactionType !== 'page_load' && interactionType !== 'transition') {
|
|
4
5
|
return '1.0.1';
|
|
5
6
|
}
|
|
@@ -9,4 +10,4 @@ export var getReactUFOVersion = function getReactUFOVersion(interactionType) {
|
|
|
9
10
|
return '1.0.1';
|
|
10
11
|
}
|
|
11
12
|
return '2.0.0';
|
|
12
|
-
};
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|