@atlaskit/react-ufo 1.1.0 → 2.0.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 +32 -0
- package/README.md +5 -0
- package/additional-payload/package.json +15 -0
- package/bundle-eval-timing/package.json +15 -0
- package/coinflip/package.json +15 -0
- package/common/package.json +5 -5
- package/config/package.json +15 -0
- package/create-payload/package.json +15 -0
- package/create-post-interaction-log-payload/package.json +15 -0
- package/custom-data/package.json +15 -0
- package/custom-mark/package.json +15 -0
- package/custom-spans/package.json +15 -0
- package/custom-timings/package.json +15 -0
- package/dist/cjs/additional-payload/index.js +25 -0
- package/dist/cjs/additional-payload/utils/cache-hit-ratio/index.js +69 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +53 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/const.js +10 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/index.js +29 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/tbt/index.js +25 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +38 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +37 -0
- package/dist/cjs/bundle-eval-timing/index.js +48 -0
- package/dist/cjs/coinflip/index.js +22 -0
- package/dist/cjs/common/common/types.js +5 -0
- package/dist/cjs/common/constants.js +7 -0
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/vc/types.js +11 -0
- package/dist/cjs/config/index.js +222 -0
- package/dist/cjs/create-payload/common/types.js +1 -0
- package/dist/cjs/create-payload/common/utils/index.js +15 -0
- package/dist/cjs/create-payload/index.js +784 -0
- package/dist/cjs/create-post-interaction-log-payload/index.js +207 -0
- package/dist/cjs/custom-data/index.js +31 -0
- package/dist/cjs/custom-data/types.js +5 -0
- package/dist/cjs/custom-mark/index.js +45 -0
- package/dist/cjs/custom-spans/index.js +14 -0
- package/dist/cjs/custom-timings/index.js +65 -0
- package/dist/cjs/experience-trace-id-context/index.js +40 -0
- package/dist/cjs/experience-trace-id-context/types.js +1 -0
- package/dist/cjs/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +12 -0
- package/dist/cjs/feature-flags-accessed/common/constants.js +7 -0
- package/dist/cjs/feature-flags-accessed/common/types.js +5 -0
- package/dist/cjs/feature-flags-accessed/common/utils/index.js +38 -0
- package/dist/cjs/feature-flags-accessed/index.js +32 -0
- package/dist/cjs/generate-id/index.js +12 -0
- package/dist/cjs/global-error-handler/index.js +74 -0
- package/dist/cjs/hidden-timing/index.js +94 -0
- package/dist/cjs/initial-page-load-extra-timing/index.js +49 -0
- package/dist/cjs/interaction-context/index.js +14 -0
- package/dist/cjs/interaction-id-context/index.js +27 -0
- package/dist/cjs/interaction-metrics/common/constants.js +8 -0
- package/dist/cjs/interaction-metrics/index.js +810 -1
- package/dist/cjs/interaction-metrics/post-interaction-log.js +190 -0
- package/dist/cjs/interaction-metrics-init/index.js +89 -0
- package/dist/cjs/label/UFOLabel.js +45 -0
- package/dist/cjs/label/index.js +9 -0
- package/dist/cjs/load-hold/UFOLoadHold.js +76 -0
- package/dist/cjs/load-hold/index.js +9 -0
- package/dist/cjs/placeholder/Placeholder.js +34 -0
- package/dist/cjs/placeholder/index.js +9 -0
- package/dist/cjs/placeholder/loosely-lazy/index.js +19 -0
- package/dist/cjs/placeholder/loosely-lazy/lazy-suspense.js +80 -0
- package/dist/cjs/placeholder/loosely-lazy/types.js +5 -0
- package/dist/cjs/placeholder/loosely-lazy/wait-context.js +15 -0
- package/dist/cjs/resource-timing/common/types.js +1 -0
- package/dist/cjs/resource-timing/common/utils/config.js +70 -0
- package/dist/cjs/resource-timing/common/utils/resource-timing-buffer.js +111 -0
- package/dist/cjs/resource-timing/index.js +26 -0
- package/dist/cjs/resource-timing/main.js +141 -0
- package/dist/cjs/resource-timing/utils.js +10 -0
- package/dist/cjs/round-number/index.js +11 -0
- package/dist/cjs/route-name/index.js +12 -0
- package/dist/cjs/route-name-context/index.js +11 -0
- package/dist/cjs/segment/index.js +9 -0
- package/dist/cjs/segment/segment-highlight.js +40 -0
- package/dist/cjs/segment/segment.js +247 -0
- package/dist/cjs/set-interaction-error/index.js +17 -0
- package/dist/cjs/short-id/index.js +15 -0
- package/dist/cjs/ssr/index.js +70 -0
- package/dist/cjs/trace-interaction/index.js +48 -0
- package/dist/cjs/trace-pageload/index.js +58 -0
- package/dist/cjs/trace-press/index.js +34 -0
- package/dist/cjs/trace-redirect/index.js +17 -0
- package/dist/cjs/trace-transition/index.js +60 -0
- package/dist/cjs/trace-transition/utils/generate-span-id/index.js +11 -0
- package/dist/cjs/trace-transition/utils/set-interaction-active-trace/index.js +11 -0
- package/dist/cjs/typing-performance-tracing/index.js +262 -0
- package/dist/cjs/use-press-tracing/index.js +19 -0
- package/dist/cjs/vc/index.js +15 -0
- package/dist/cjs/vc/vc-observer/attachAbortListeners.js +40 -0
- package/dist/cjs/vc/vc-observer/getViewport.js +27 -0
- package/dist/cjs/vc/vc-observer/index.js +562 -0
- package/dist/cjs/vc/vc-observer/media-wrapper/index.js +15 -0
- package/dist/cjs/vc/vc-observer/media-wrapper/vc-utils.js +16 -0
- package/dist/cjs/vc/vc-observer/observers/index.js +270 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +183 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +22 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +20 -0
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +19 -0
- package/dist/cjs/vc/vc-observer/observers/types.js +5 -0
- package/dist/es2019/additional-payload/index.js +2 -0
- package/dist/es2019/additional-payload/utils/cache-hit-ratio/index.js +63 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +33 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/const.js +4 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/index.js +23 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/tbt/index.js +15 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +23 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +31 -0
- package/dist/es2019/bundle-eval-timing/index.js +43 -0
- package/dist/es2019/coinflip/index.js +16 -0
- package/dist/es2019/common/common/types.js +1 -0
- package/dist/es2019/common/constants.js +1 -0
- package/dist/es2019/common/vc/types.js +5 -0
- package/dist/es2019/config/index.js +215 -0
- package/dist/es2019/create-payload/common/types.js +0 -0
- package/dist/es2019/create-payload/common/utils/index.js +8 -0
- package/dist/es2019/create-payload/index.js +792 -0
- package/dist/es2019/create-post-interaction-log-payload/index.js +188 -0
- package/dist/es2019/custom-data/index.js +24 -0
- package/dist/es2019/custom-data/types.js +1 -0
- package/dist/es2019/custom-mark/index.js +38 -0
- package/dist/es2019/custom-spans/index.js +6 -0
- package/dist/es2019/custom-timings/index.js +57 -0
- package/dist/es2019/experience-trace-id-context/index.js +31 -0
- package/dist/es2019/experience-trace-id-context/types.js +0 -0
- package/dist/es2019/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +4 -0
- package/dist/es2019/feature-flags-accessed/common/constants.js +1 -0
- package/dist/es2019/feature-flags-accessed/common/types.js +1 -0
- package/dist/es2019/feature-flags-accessed/common/utils/index.js +24 -0
- package/dist/es2019/feature-flags-accessed/index.js +21 -0
- package/dist/es2019/generate-id/index.js +6 -0
- package/dist/es2019/global-error-handler/index.js +64 -0
- package/dist/es2019/hidden-timing/index.js +87 -0
- package/dist/es2019/initial-page-load-extra-timing/index.js +43 -0
- package/dist/es2019/interaction-context/index.js +6 -0
- package/dist/es2019/interaction-id-context/index.js +18 -0
- package/dist/es2019/interaction-metrics/common/constants.js +2 -0
- package/dist/es2019/interaction-metrics/index.js +736 -0
- package/dist/es2019/interaction-metrics/post-interaction-log.js +158 -0
- package/dist/es2019/interaction-metrics-init/index.js +72 -0
- package/dist/es2019/label/UFOLabel.js +34 -0
- package/dist/es2019/label/index.js +2 -0
- package/dist/es2019/load-hold/UFOLoadHold.js +66 -0
- package/dist/es2019/load-hold/index.js +2 -0
- package/dist/es2019/placeholder/Placeholder.js +25 -0
- package/dist/es2019/placeholder/index.js +2 -0
- package/dist/es2019/placeholder/loosely-lazy/index.js +2 -0
- package/dist/es2019/placeholder/loosely-lazy/lazy-suspense.js +63 -0
- package/dist/es2019/placeholder/loosely-lazy/types.js +1 -0
- package/dist/es2019/placeholder/loosely-lazy/wait-context.js +5 -0
- package/dist/es2019/resource-timing/common/types.js +0 -0
- package/dist/es2019/resource-timing/common/utils/config.js +44 -0
- package/dist/es2019/resource-timing/common/utils/resource-timing-buffer.js +88 -0
- package/dist/es2019/resource-timing/index.js +3 -0
- package/dist/es2019/resource-timing/main.js +130 -0
- package/dist/es2019/resource-timing/utils.js +4 -0
- package/dist/es2019/round-number/index.js +4 -0
- package/dist/es2019/route-name/index.js +6 -0
- package/dist/es2019/route-name-context/index.js +5 -0
- package/dist/es2019/segment/index.js +2 -0
- package/dist/es2019/segment/segment-highlight.js +27 -0
- package/dist/es2019/segment/segment.js +218 -0
- package/dist/es2019/set-interaction-error/index.js +11 -0
- package/dist/es2019/short-id/index.js +8 -0
- package/dist/es2019/ssr/index.js +54 -0
- package/dist/es2019/trace-interaction/index.js +41 -0
- package/dist/es2019/trace-pageload/index.js +48 -0
- package/dist/es2019/trace-press/index.js +27 -0
- package/dist/es2019/trace-redirect/index.js +10 -0
- package/dist/es2019/trace-transition/index.js +48 -0
- package/dist/es2019/trace-transition/utils/generate-span-id/index.js +1 -0
- package/dist/es2019/trace-transition/utils/set-interaction-active-trace/index.js +5 -0
- package/dist/es2019/typing-performance-tracing/index.js +255 -0
- package/dist/es2019/use-press-tracing/index.js +12 -0
- package/dist/es2019/vc/index.js +8 -0
- package/dist/es2019/vc/vc-observer/attachAbortListeners.js +34 -0
- package/dist/es2019/vc/vc-observer/getViewport.js +18 -0
- package/dist/es2019/vc/vc-observer/index.js +522 -0
- package/dist/es2019/vc/vc-observer/media-wrapper/index.js +9 -0
- package/dist/es2019/vc/vc-observer/media-wrapper/vc-utils.js +10 -0
- package/dist/es2019/vc/vc-observer/observers/index.js +231 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +146 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +16 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +14 -0
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +2 -0
- package/dist/es2019/vc/vc-observer/observers/types.js +1 -0
- package/dist/esm/additional-payload/index.js +2 -0
- package/dist/esm/additional-payload/utils/cache-hit-ratio/index.js +63 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +47 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/types.js +0 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/const.js +4 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/index.js +22 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/tbt/index.js +19 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/buffer/index.js +31 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/utils/observer/index.js +31 -0
- package/dist/esm/bundle-eval-timing/index.js +41 -0
- package/dist/esm/coinflip/index.js +16 -0
- package/dist/esm/common/common/types.js +1 -0
- package/dist/esm/common/constants.js +1 -0
- package/dist/esm/common/index.js +0 -0
- package/dist/esm/common/vc/types.js +5 -0
- package/dist/esm/config/index.js +206 -0
- package/dist/esm/create-payload/common/types.js +0 -0
- package/dist/esm/create-payload/common/utils/index.js +8 -0
- package/dist/esm/create-payload/index.js +774 -0
- package/dist/esm/create-post-interaction-log-payload/index.js +200 -0
- package/dist/esm/custom-data/index.js +23 -0
- package/dist/esm/custom-data/types.js +1 -0
- package/dist/esm/custom-mark/index.js +36 -0
- package/dist/esm/custom-spans/index.js +8 -0
- package/dist/esm/custom-timings/index.js +56 -0
- package/dist/esm/experience-trace-id-context/index.js +34 -0
- package/dist/esm/experience-trace-id-context/types.js +0 -0
- package/dist/esm/experience-trace-id-context/utils/make-trace-http-request-headers/index.js +6 -0
- package/dist/esm/feature-flags-accessed/common/constants.js +1 -0
- package/dist/esm/feature-flags-accessed/common/types.js +1 -0
- package/dist/esm/feature-flags-accessed/common/utils/index.js +31 -0
- package/dist/esm/feature-flags-accessed/index.js +21 -0
- package/dist/esm/generate-id/index.js +6 -0
- package/dist/esm/global-error-handler/index.js +67 -0
- package/dist/esm/hidden-timing/index.js +87 -0
- package/dist/esm/initial-page-load-extra-timing/index.js +42 -0
- package/dist/esm/interaction-context/index.js +6 -0
- package/dist/esm/interaction-id-context/index.js +22 -0
- package/dist/esm/interaction-metrics/common/constants.js +2 -0
- package/dist/esm/interaction-metrics/index.js +773 -0
- package/dist/esm/interaction-metrics/post-interaction-log.js +184 -0
- package/dist/esm/interaction-metrics-init/index.js +77 -0
- package/dist/esm/label/UFOLabel.js +36 -0
- package/dist/esm/label/index.js +2 -0
- package/dist/esm/load-hold/UFOLoadHold.js +66 -0
- package/dist/esm/load-hold/index.js +2 -0
- package/dist/esm/placeholder/Placeholder.js +25 -0
- package/dist/esm/placeholder/index.js +2 -0
- package/dist/esm/placeholder/loosely-lazy/index.js +2 -0
- package/dist/esm/placeholder/loosely-lazy/lazy-suspense.js +70 -0
- package/dist/esm/placeholder/loosely-lazy/types.js +1 -0
- package/dist/esm/placeholder/loosely-lazy/wait-context.js +9 -0
- package/dist/esm/resource-timing/common/types.js +0 -0
- package/dist/esm/resource-timing/common/utils/config.js +62 -0
- package/dist/esm/resource-timing/common/utils/resource-timing-buffer.js +104 -0
- package/dist/esm/resource-timing/index.js +3 -0
- package/dist/esm/resource-timing/main.js +134 -0
- package/dist/esm/resource-timing/utils.js +4 -0
- package/dist/esm/round-number/index.js +5 -0
- package/dist/esm/route-name/index.js +6 -0
- package/dist/esm/route-name-context/index.js +5 -0
- package/dist/esm/segment/index.js +2 -0
- package/dist/esm/segment/segment-highlight.js +30 -0
- package/dist/esm/segment/segment.js +235 -0
- package/dist/esm/set-interaction-error/index.js +11 -0
- package/dist/esm/short-id/index.js +9 -0
- package/dist/esm/ssr/index.js +59 -0
- package/dist/esm/trace-interaction/index.js +41 -0
- package/dist/esm/trace-pageload/index.js +50 -0
- package/dist/esm/trace-press/index.js +27 -0
- package/dist/esm/trace-redirect/index.js +10 -0
- package/dist/esm/trace-transition/index.js +49 -0
- package/dist/esm/trace-transition/utils/generate-span-id/index.js +5 -0
- package/dist/esm/trace-transition/utils/set-interaction-active-trace/index.js +5 -0
- package/dist/esm/typing-performance-tracing/index.js +255 -0
- package/dist/esm/use-press-tracing/index.js +12 -0
- package/dist/esm/vc/index.js +9 -0
- package/dist/esm/vc/vc-observer/attachAbortListeners.js +34 -0
- package/dist/esm/vc/vc-observer/getViewport.js +20 -0
- package/dist/esm/vc/vc-observer/index.js +555 -0
- package/dist/esm/vc/vc-observer/media-wrapper/index.js +7 -0
- package/dist/esm/vc/vc-observer/media-wrapper/vc-utils.js +10 -0
- package/dist/esm/vc/vc-observer/observers/index.js +263 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +176 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.js +16 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +14 -0
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.js +2 -0
- package/dist/esm/vc/vc-observer/observers/types.js +1 -0
- package/dist/types/additional-payload/index.d.ts +2 -0
- package/dist/types/additional-payload/utils/cache-hit-ratio/index.d.ts +8 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +2 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +3 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/const.d.ts +5 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/index.d.ts +7 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +5 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/utils/buffer/index.d.ts +13 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -0
- package/dist/types/bundle-eval-timing/index.d.ts +16 -0
- package/dist/types/coinflip/index.d.ts +8 -0
- package/dist/types/common/common/types.d.ts +201 -0
- package/dist/types/common/constants.d.ts +1 -0
- package/dist/types/common/index.d.ts +5 -0
- package/dist/types/common/vc/types.d.ts +91 -0
- package/dist/types/config/index.d.ts +91 -0
- package/dist/types/create-payload/common/types.d.ts +4 -0
- package/dist/types/create-payload/common/utils/index.d.ts +3 -0
- package/dist/types/create-payload/index.d.ts +2969 -0
- package/dist/types/create-post-interaction-log-payload/index.d.ts +45 -0
- package/dist/types/custom-data/index.d.ts +5 -0
- package/dist/types/custom-data/types.d.ts +4 -0
- package/dist/types/custom-mark/index.d.ts +10 -0
- package/dist/types/custom-spans/index.d.ts +1 -0
- package/dist/types/custom-timings/index.d.ts +19 -0
- package/dist/types/experience-trace-id-context/index.d.ts +10 -0
- package/dist/types/experience-trace-id-context/types.d.ts +8 -0
- package/dist/types/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +4 -0
- package/dist/types/feature-flags-accessed/common/constants.d.ts +1 -0
- package/dist/types/feature-flags-accessed/common/types.d.ts +2 -0
- package/dist/types/feature-flags-accessed/common/utils/index.d.ts +3 -0
- package/dist/types/feature-flags-accessed/index.d.ts +14 -0
- package/dist/types/generate-id/index.d.ts +2 -0
- package/dist/types/global-error-handler/index.d.ts +3 -0
- package/dist/types/hidden-timing/index.d.ts +7 -0
- package/dist/types/initial-page-load-extra-timing/index.d.ts +9 -0
- package/dist/types/interaction-context/index.d.ts +33 -0
- package/dist/types/interaction-id-context/index.d.ts +9 -0
- package/dist/types/interaction-metrics/common/constants.d.ts +3 -0
- package/dist/types/interaction-metrics/index.d.ts +65 -1
- package/dist/types/interaction-metrics/post-interaction-log.d.ts +69 -0
- package/dist/types/interaction-metrics-init/index.d.ts +11 -0
- package/dist/types/label/UFOLabel.d.ts +13 -0
- package/dist/types/label/index.d.ts +2 -0
- package/dist/types/load-hold/UFOLoadHold.d.ts +53 -0
- package/dist/types/load-hold/index.d.ts +2 -0
- package/dist/types/placeholder/Placeholder.d.ts +13 -0
- package/dist/types/placeholder/index.d.ts +2 -0
- package/dist/types/placeholder/loosely-lazy/index.d.ts +3 -0
- package/dist/types/placeholder/loosely-lazy/lazy-suspense.d.ts +6 -0
- package/dist/types/placeholder/loosely-lazy/types.d.ts +20 -0
- package/dist/types/placeholder/loosely-lazy/wait-context.d.ts +3 -0
- package/dist/types/resource-timing/common/types.d.ts +41 -0
- package/dist/types/resource-timing/common/utils/config.d.ts +3 -0
- package/dist/types/resource-timing/common/utils/resource-timing-buffer.d.ts +11 -0
- package/dist/types/resource-timing/index.d.ts +4 -0
- package/dist/types/resource-timing/main.d.ts +2 -0
- package/dist/types/resource-timing/utils.d.ts +1 -0
- package/dist/types/round-number/index.d.ts +1 -0
- package/dist/types/route-name/index.d.ts +4 -0
- package/dist/types/route-name-context/index.d.ts +5 -0
- package/dist/types/segment/index.d.ts +2 -0
- package/dist/types/segment/segment-highlight.d.ts +6 -0
- package/dist/types/segment/segment.d.ts +8 -0
- package/dist/types/set-interaction-error/index.d.ts +4 -0
- package/dist/types/short-id/index.d.ts +1 -0
- package/dist/types/ssr/index.d.ts +21 -0
- package/dist/types/trace-interaction/index.d.ts +2 -0
- package/dist/types/trace-pageload/index.d.ts +2 -0
- package/dist/types/trace-press/index.d.ts +1 -0
- package/dist/types/trace-redirect/index.d.ts +1 -0
- package/dist/types/trace-transition/index.d.ts +2 -0
- package/dist/types/trace-transition/utils/generate-span-id/index.d.ts +1 -0
- package/dist/types/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -0
- package/dist/types/typing-performance-tracing/index.d.ts +2 -0
- package/dist/types/use-press-tracing/index.d.ts +1 -0
- package/dist/types/vc/index.d.ts +2 -0
- package/dist/types/vc/vc-observer/attachAbortListeners.d.ts +6 -0
- package/dist/types/vc/vc-observer/getViewport.d.ts +2 -0
- package/dist/types/vc/vc-observer/index.d.ts +98 -0
- package/dist/types/vc/vc-observer/media-wrapper/index.d.ts +7 -0
- package/dist/types/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -0
- package/dist/types/vc/vc-observer/observers/index.d.ts +39 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/index.d.ts +23 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.d.ts +1 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.d.ts +1 -0
- package/dist/types/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.d.ts +2 -0
- package/dist/types/vc/vc-observer/observers/types.d.ts +11 -0
- package/dist/types-ts4.5/additional-payload/index.d.ts +2 -0
- package/dist/types-ts4.5/additional-payload/utils/cache-hit-ratio/index.d.ts +8 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/index.d.ts +2 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +3 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/const.d.ts +5 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/index.d.ts +7 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/tbt/index.d.ts +5 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/buffer/index.d.ts +13 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/utils/observer/index.d.ts +2 -0
- package/dist/types-ts4.5/bundle-eval-timing/index.d.ts +16 -0
- package/dist/types-ts4.5/coinflip/index.d.ts +8 -0
- package/dist/types-ts4.5/common/common/types.d.ts +201 -0
- package/dist/types-ts4.5/common/constants.d.ts +1 -0
- package/dist/types-ts4.5/common/index.d.ts +5 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +91 -0
- package/dist/types-ts4.5/config/index.d.ts +95 -0
- package/dist/types-ts4.5/create-payload/common/types.d.ts +4 -0
- package/dist/types-ts4.5/create-payload/common/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +2969 -0
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +45 -0
- package/dist/types-ts4.5/custom-data/index.d.ts +5 -0
- package/dist/types-ts4.5/custom-data/types.d.ts +4 -0
- package/dist/types-ts4.5/custom-mark/index.d.ts +10 -0
- package/dist/types-ts4.5/custom-spans/index.d.ts +1 -0
- package/dist/types-ts4.5/custom-timings/index.d.ts +19 -0
- package/dist/types-ts4.5/experience-trace-id-context/index.d.ts +10 -0
- package/dist/types-ts4.5/experience-trace-id-context/types.d.ts +8 -0
- package/dist/types-ts4.5/experience-trace-id-context/utils/make-trace-http-request-headers/index.d.ts +4 -0
- package/dist/types-ts4.5/feature-flags-accessed/common/constants.d.ts +1 -0
- package/dist/types-ts4.5/feature-flags-accessed/common/types.d.ts +2 -0
- package/dist/types-ts4.5/feature-flags-accessed/common/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/feature-flags-accessed/index.d.ts +14 -0
- package/dist/types-ts4.5/generate-id/index.d.ts +2 -0
- package/dist/types-ts4.5/global-error-handler/index.d.ts +3 -0
- package/dist/types-ts4.5/hidden-timing/index.d.ts +7 -0
- package/dist/types-ts4.5/initial-page-load-extra-timing/index.d.ts +9 -0
- package/dist/types-ts4.5/interaction-context/index.d.ts +33 -0
- package/dist/types-ts4.5/interaction-id-context/index.d.ts +9 -0
- package/dist/types-ts4.5/interaction-metrics/common/constants.d.ts +3 -0
- package/dist/types-ts4.5/interaction-metrics/index.d.ts +65 -1
- package/dist/types-ts4.5/interaction-metrics/post-interaction-log.d.ts +69 -0
- package/dist/types-ts4.5/interaction-metrics-init/index.d.ts +11 -0
- package/dist/types-ts4.5/label/UFOLabel.d.ts +13 -0
- package/dist/types-ts4.5/label/index.d.ts +2 -0
- package/dist/types-ts4.5/load-hold/UFOLoadHold.d.ts +53 -0
- package/dist/types-ts4.5/load-hold/index.d.ts +2 -0
- package/dist/types-ts4.5/placeholder/Placeholder.d.ts +13 -0
- package/dist/types-ts4.5/placeholder/index.d.ts +2 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/index.d.ts +3 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/lazy-suspense.d.ts +6 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/types.d.ts +20 -0
- package/dist/types-ts4.5/placeholder/loosely-lazy/wait-context.d.ts +3 -0
- package/dist/types-ts4.5/resource-timing/common/types.d.ts +41 -0
- package/dist/types-ts4.5/resource-timing/common/utils/config.d.ts +3 -0
- package/dist/types-ts4.5/resource-timing/common/utils/resource-timing-buffer.d.ts +11 -0
- package/dist/types-ts4.5/resource-timing/index.d.ts +4 -0
- package/dist/types-ts4.5/resource-timing/main.d.ts +2 -0
- package/dist/types-ts4.5/resource-timing/utils.d.ts +1 -0
- package/dist/types-ts4.5/round-number/index.d.ts +1 -0
- package/dist/types-ts4.5/route-name/index.d.ts +4 -0
- package/dist/types-ts4.5/route-name-context/index.d.ts +5 -0
- package/dist/types-ts4.5/segment/index.d.ts +2 -0
- package/dist/types-ts4.5/segment/segment-highlight.d.ts +6 -0
- package/dist/types-ts4.5/segment/segment.d.ts +8 -0
- package/dist/types-ts4.5/set-interaction-error/index.d.ts +4 -0
- package/dist/types-ts4.5/short-id/index.d.ts +1 -0
- package/dist/types-ts4.5/ssr/index.d.ts +21 -0
- package/dist/types-ts4.5/trace-interaction/index.d.ts +2 -0
- package/dist/types-ts4.5/trace-pageload/index.d.ts +2 -0
- package/dist/types-ts4.5/trace-press/index.d.ts +1 -0
- package/dist/types-ts4.5/trace-redirect/index.d.ts +1 -0
- package/dist/types-ts4.5/trace-transition/index.d.ts +2 -0
- package/dist/types-ts4.5/trace-transition/utils/generate-span-id/index.d.ts +1 -0
- package/dist/types-ts4.5/trace-transition/utils/set-interaction-active-trace/index.d.ts +1 -0
- package/dist/types-ts4.5/typing-performance-tracing/index.d.ts +2 -0
- package/dist/types-ts4.5/use-press-tracing/index.d.ts +1 -0
- package/dist/types-ts4.5/vc/index.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/attachAbortListeners.d.ts +6 -0
- package/dist/types-ts4.5/vc/vc-observer/getViewport.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/index.d.ts +98 -0
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/index.d.ts +7 -0
- package/dist/types-ts4.5/vc/vc-observer/media-wrapper/vc-utils.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/index.d.ts +39 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/index.d.ts +23 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/bindAbortListeners.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/index.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer/observers/types.d.ts +11 -0
- package/experience-trace-id-context/package.json +15 -0
- package/feature-flags-accessed/package.json +15 -0
- package/generate-id/package.json +15 -0
- package/global-error-handler/package.json +15 -0
- package/hidden-timing/package.json +15 -0
- package/initial-page-load-extra-timing/package.json +15 -0
- package/interaction-context/package.json +15 -0
- package/interaction-id-context/package.json +15 -0
- package/interaction-metrics-init/package.json +15 -0
- package/label/package.json +15 -0
- package/load-hold/package.json +15 -0
- package/package.json +55 -3
- package/placeholder/package.json +15 -0
- package/resource-timing/package.json +15 -0
- package/round-number/package.json +15 -0
- package/route-name/package.json +15 -0
- package/route-name-context/package.json +15 -0
- package/segment/package.json +15 -0
- package/set-interaction-error/package.json +15 -0
- package/short-id/package.json +15 -0
- package/ssr/package.json +15 -0
- package/ssr-scripts/package.json +15 -0
- package/trace-interaction/package.json +15 -0
- package/trace-pageload/package.json +15 -0
- package/trace-press/package.json +15 -0
- package/trace-redirect/package.json +15 -0
- package/trace-transition/package.json +15 -0
- package/typing-performance-tracing/package.json +15 -0
- package/use-press-tracing/package.json +15 -0
- package/vc/media/package.json +15 -0
- package/vc/package.json +15 -0
- package/dist/types/common/types.d.ts +0 -17
- package/dist/types-ts4.5/common/types.d.ts +0 -17
- /package/dist/cjs/{common → additional-payload/utils/lighthouse-metrics/cls}/types.js +0 -0
- /package/dist/es2019/{common → additional-payload/utils/lighthouse-metrics/cls}/types.js +0 -0
- /package/dist/{esm/common/types.js → es2019/common/index.js} +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import { getConfig } from '../config';
|
|
7
|
+
import { VCObserver } from '../vc/vc-observer';
|
|
8
|
+
var POST_INTERACTION_LOG_SEND_DEFAULT_TIMEOUT = 3000;
|
|
9
|
+
var PostInteractionLog = /*#__PURE__*/function () {
|
|
10
|
+
function PostInteractionLog() {
|
|
11
|
+
_classCallCheck(this, PostInteractionLog);
|
|
12
|
+
/**
|
|
13
|
+
* Basic info about interaction that has just finished
|
|
14
|
+
*/
|
|
15
|
+
_defineProperty(this, "lastInteractionFinish", null);
|
|
16
|
+
/**
|
|
17
|
+
* Array of observed react render timings
|
|
18
|
+
*/
|
|
19
|
+
_defineProperty(this, "reactProfilerTimings", []);
|
|
20
|
+
/**
|
|
21
|
+
* Store the scheduled sink timeout Id so that it can be cancelled when needed
|
|
22
|
+
*/
|
|
23
|
+
_defineProperty(this, "sinkTimeoutId", null);
|
|
24
|
+
/**
|
|
25
|
+
* independent VC observer, that observes until `custom.post-interaction-logs` event is sent
|
|
26
|
+
*/
|
|
27
|
+
_defineProperty(this, "vcObserver", null);
|
|
28
|
+
_defineProperty(this, "vcObserverSSRConfig", null);
|
|
29
|
+
/**
|
|
30
|
+
* Handler function to process / send the observation data
|
|
31
|
+
*/
|
|
32
|
+
_defineProperty(this, "sinkHandlerFn", function () {});
|
|
33
|
+
}
|
|
34
|
+
_createClass(PostInteractionLog, [{
|
|
35
|
+
key: "initializeVCObserver",
|
|
36
|
+
value: function initializeVCObserver(options) {
|
|
37
|
+
if (this.vcObserver === null) {
|
|
38
|
+
this.vcObserver = new VCObserver(_objectSpread(_objectSpread({}, options), {}, {
|
|
39
|
+
isPostInteraction: true
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "startVCObserver",
|
|
45
|
+
value: function startVCObserver(_ref) {
|
|
46
|
+
var _this$vcObserver;
|
|
47
|
+
var startTime = _ref.startTime;
|
|
48
|
+
(_this$vcObserver = this.vcObserver) === null || _this$vcObserver === void 0 || _this$vcObserver.start({
|
|
49
|
+
startTime: startTime
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
key: "setVCObserverSSRConfig",
|
|
54
|
+
value: function setVCObserverSSRConfig(vcObserverSSRConfig) {
|
|
55
|
+
this.vcObserverSSRConfig = vcObserverSSRConfig;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Set the VC result as per the last interaction
|
|
60
|
+
* Used to compare diffs of VC updates vs post interaction VC observer
|
|
61
|
+
* @param result - VC result as calculated by UFO create payload
|
|
62
|
+
*/
|
|
63
|
+
}, {
|
|
64
|
+
key: "setLastInteractionFinishVCResult",
|
|
65
|
+
value: function setLastInteractionFinishVCResult(result) {
|
|
66
|
+
this.lastInteractionFinishVCResult = result;
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "sinkHandler",
|
|
70
|
+
value:
|
|
71
|
+
/**
|
|
72
|
+
* Set the fn that would be invoked to process / send the observation data
|
|
73
|
+
*/
|
|
74
|
+
function sinkHandler(sinkHandlerFn) {
|
|
75
|
+
this.sinkHandlerFn = sinkHandlerFn;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Reset state of the log
|
|
80
|
+
*/
|
|
81
|
+
}, {
|
|
82
|
+
key: "reset",
|
|
83
|
+
value: function reset() {
|
|
84
|
+
this.lastInteractionFinish = null;
|
|
85
|
+
this.reactProfilerTimings = [];
|
|
86
|
+
if (this.sinkTimeoutId != null) {
|
|
87
|
+
clearTimeout(this.sinkTimeoutId);
|
|
88
|
+
this.sinkTimeoutId = null;
|
|
89
|
+
}
|
|
90
|
+
this.setVCObserverSSRConfig(null);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Check if there is data in the log
|
|
95
|
+
*/
|
|
96
|
+
}, {
|
|
97
|
+
key: "hasData",
|
|
98
|
+
value: function hasData() {
|
|
99
|
+
var _this$reactProfilerTi;
|
|
100
|
+
return ((_this$reactProfilerTi = this.reactProfilerTimings) === null || _this$reactProfilerTi === void 0 ? void 0 : _this$reactProfilerTi.length) > 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Send the log if there is data
|
|
105
|
+
*/
|
|
106
|
+
}, {
|
|
107
|
+
key: "sendPostInteractionLog",
|
|
108
|
+
value: function sendPostInteractionLog() {
|
|
109
|
+
var _this$vcObserver2;
|
|
110
|
+
if (!this.hasData() || !this.lastInteractionFinish || !this.sinkHandlerFn) {
|
|
111
|
+
this.reset();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.sinkHandlerFn({
|
|
115
|
+
lastInteractionFinish: this.lastInteractionFinish,
|
|
116
|
+
reactProfilerTimings: this.reactProfilerTimings,
|
|
117
|
+
// NOTE: invoking `getVCResult` at latest possible point in time here (not earlier) to get the most accurate result (from performance.now())
|
|
118
|
+
postInteractionFinishVCResult: (_this$vcObserver2 = this.vcObserver) === null || _this$vcObserver2 === void 0 ? void 0 : _this$vcObserver2.getVCResult(_objectSpread({
|
|
119
|
+
start: this.lastInteractionFinish.start,
|
|
120
|
+
stop: performance.now(),
|
|
121
|
+
tti: -1,
|
|
122
|
+
// no need for TTI value here
|
|
123
|
+
prefix: 'ufo'
|
|
124
|
+
}, this.vcObserverSSRConfig)),
|
|
125
|
+
lastInteractionFinishVCResult: this.lastInteractionFinishVCResult
|
|
126
|
+
});
|
|
127
|
+
this.reset();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* This fn should be invoked when an interaction has finished
|
|
132
|
+
* Basic details about the finished interaction will be recorded
|
|
133
|
+
* A timeout will be setup to send the post interaction observation after some time.
|
|
134
|
+
*/
|
|
135
|
+
}, {
|
|
136
|
+
key: "onInteractionComplete",
|
|
137
|
+
value: function onInteractionComplete(_ref2) {
|
|
138
|
+
var _getConfig,
|
|
139
|
+
_this = this;
|
|
140
|
+
var ufoName = _ref2.ufoName,
|
|
141
|
+
start = _ref2.start,
|
|
142
|
+
end = _ref2.end,
|
|
143
|
+
id = _ref2.id,
|
|
144
|
+
abortReason = _ref2.abortReason,
|
|
145
|
+
abortedByInteractionName = _ref2.abortedByInteractionName,
|
|
146
|
+
routeName = _ref2.routeName,
|
|
147
|
+
type = _ref2.type;
|
|
148
|
+
this.lastInteractionFinish = {
|
|
149
|
+
ufoName: ufoName,
|
|
150
|
+
start: start,
|
|
151
|
+
end: end,
|
|
152
|
+
id: id,
|
|
153
|
+
abortReason: abortReason,
|
|
154
|
+
abortedByInteractionName: abortedByInteractionName,
|
|
155
|
+
routeName: routeName,
|
|
156
|
+
type: type
|
|
157
|
+
};
|
|
158
|
+
var timeout = ((_getConfig = getConfig()) === null || _getConfig === void 0 ? void 0 : _getConfig.timeWindowForLateMutationsInMilliseconds) || POST_INTERACTION_LOG_SEND_DEFAULT_TIMEOUT;
|
|
159
|
+
this.sinkTimeoutId = window.setTimeout(function () {
|
|
160
|
+
_this.sendPostInteractionLog();
|
|
161
|
+
}, timeout);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* This fn should be invoked when a React render happens after interaction has finished
|
|
166
|
+
*/
|
|
167
|
+
}, {
|
|
168
|
+
key: "addProfilerTimings",
|
|
169
|
+
value: function addProfilerTimings(labelStack, type, actualDuration, baseDuration, startTime, commitTime) {
|
|
170
|
+
if (this.lastInteractionFinish != null) {
|
|
171
|
+
this.reactProfilerTimings.push({
|
|
172
|
+
type: type,
|
|
173
|
+
actualDuration: actualDuration,
|
|
174
|
+
baseDuration: baseDuration,
|
|
175
|
+
startTime: startTime,
|
|
176
|
+
commitTime: commitTime,
|
|
177
|
+
labelStack: labelStack
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}]);
|
|
182
|
+
return PostInteractionLog;
|
|
183
|
+
}();
|
|
184
|
+
export { PostInteractionLog as default };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { unstable_IdlePriority as idlePriority, unstable_scheduleCallback as scheduleCallback } from 'scheduler';
|
|
3
|
+
import { startLighthouseObserver } from '../additional-payload';
|
|
4
|
+
import { setUFOConfig } from '../config';
|
|
5
|
+
import { setupHiddenTimingCapture } from '../hidden-timing';
|
|
6
|
+
import { postInteractionLog, sinkInteractionHandler, sinkPostInteractionLogHandler } from '../interaction-metrics';
|
|
7
|
+
import { getVCObserver } from '../vc';
|
|
8
|
+
var initialized = false;
|
|
9
|
+
function sinkInteraction(instance, payloadPackage) {
|
|
10
|
+
sinkInteractionHandler(function (interactionId, interaction) {
|
|
11
|
+
scheduleCallback(idlePriority, function () {
|
|
12
|
+
var payloads = payloadPackage.createPayloads(interactionId, interaction);
|
|
13
|
+
payloads === null || payloads === void 0 || payloads.forEach(function (payload) {
|
|
14
|
+
instance.sendOperationalEvent(payload);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function sinkPostInteractionLog(instance, createPostInteractionLogPayload) {
|
|
20
|
+
sinkPostInteractionLogHandler(function (logOutput) {
|
|
21
|
+
scheduleCallback(idlePriority, function () {
|
|
22
|
+
var payload = createPostInteractionLogPayload(logOutput);
|
|
23
|
+
if (payload) {
|
|
24
|
+
instance.sendOperationalEvent(payload);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export var init = function init(analyticsWebClientAsync, config) {
|
|
30
|
+
var _config$vc;
|
|
31
|
+
if (initialized) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
setUFOConfig(config);
|
|
35
|
+
if ((_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled) {
|
|
36
|
+
var vcOptions = {
|
|
37
|
+
heatmapSize: config.vc.heatmapSize,
|
|
38
|
+
oldDomUpdates: config.vc.oldDomUpdates,
|
|
39
|
+
devToolsEnabled: config.vc.devToolsEnabled,
|
|
40
|
+
selectorConfig: config.vc.selectorConfig
|
|
41
|
+
};
|
|
42
|
+
getVCObserver(vcOptions).start({
|
|
43
|
+
startTime: 0
|
|
44
|
+
});
|
|
45
|
+
postInteractionLog.initializeVCObserver(vcOptions);
|
|
46
|
+
postInteractionLog.startVCObserver({
|
|
47
|
+
startTime: 0
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
setupHiddenTimingCapture();
|
|
51
|
+
startLighthouseObserver();
|
|
52
|
+
initialized = true;
|
|
53
|
+
Promise.all([analyticsWebClientAsync,
|
|
54
|
+
// eslint-disable-next-line import/dynamic-import-chunkname
|
|
55
|
+
import( /* webpackChunkName: "create-payloads" */'../create-payload'),
|
|
56
|
+
// eslint-disable-next-line import/dynamic-import-chunkname
|
|
57
|
+
import( /* webpackChunkName: "create-post-intreaction-log-payload" */'../create-post-interaction-log-payload')]).then(function (_ref) {
|
|
58
|
+
var _ref2 = _slicedToArray(_ref, 3),
|
|
59
|
+
awc = _ref2[0],
|
|
60
|
+
payloadPackage = _ref2[1],
|
|
61
|
+
createPostInteractionLogPayloadPackage = _ref2[2];
|
|
62
|
+
if (awc.getAnalyticsWebClientPromise) {
|
|
63
|
+
awc.getAnalyticsWebClientPromise().then(function (client) {
|
|
64
|
+
var instance = client.getInstance();
|
|
65
|
+
sinkInteraction(instance, payloadPackage);
|
|
66
|
+
if (config.captureLateReRenders) {
|
|
67
|
+
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
} else if (awc.sendOperationalEvent) {
|
|
71
|
+
sinkInteraction(awc, payloadPackage);
|
|
72
|
+
if (config.captureLateReRenders) {
|
|
73
|
+
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import InteractionContext, { useInteractionContext } from '../interaction-context';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Annotate part of the react tree with a product name
|
|
10
|
+
* ```
|
|
11
|
+
* <UFOLabel name="card">
|
|
12
|
+
* <Card card={data} />
|
|
13
|
+
* </UFOLabel>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export default function UFOLabel(_ref) {
|
|
17
|
+
var name = _ref.name,
|
|
18
|
+
children = _ref.children;
|
|
19
|
+
var context = useInteractionContext();
|
|
20
|
+
var newContext = useMemo(function () {
|
|
21
|
+
if (context) {
|
|
22
|
+
return _objectSpread(_objectSpread({}, context), {}, {
|
|
23
|
+
labelStack: context.labelStack == null ? [{
|
|
24
|
+
name: name
|
|
25
|
+
}] : [].concat(_toConsumableArray(context.labelStack), [{
|
|
26
|
+
name: name
|
|
27
|
+
}])
|
|
28
|
+
});
|
|
29
|
+
} else {
|
|
30
|
+
return context;
|
|
31
|
+
}
|
|
32
|
+
}, [context, name]);
|
|
33
|
+
return context ? /*#__PURE__*/React.createElement(InteractionContext.Provider, {
|
|
34
|
+
value: newContext
|
|
35
|
+
}, children) : /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
36
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React, { useContext, useEffect, useLayoutEffect } from 'react';
|
|
2
|
+
import UFOInteractionContext from '../interaction-context';
|
|
3
|
+
var useLayoutEffectSAFE = typeof window === 'undefined' ? useEffect : useLayoutEffect;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Render this whenever you're loading.
|
|
7
|
+
*
|
|
8
|
+
* Wrap loading elements
|
|
9
|
+
* ```js
|
|
10
|
+
* if (isLoading){
|
|
11
|
+
* return (
|
|
12
|
+
* <UFOLoadHold name="card">
|
|
13
|
+
* <Skeleton />
|
|
14
|
+
* </UFOLoadHold>
|
|
15
|
+
* )
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* Or render it as a sibling
|
|
20
|
+
* ```
|
|
21
|
+
* if (isLoading){
|
|
22
|
+
* return (
|
|
23
|
+
* <>
|
|
24
|
+
* <Skeleton />
|
|
25
|
+
* <UFOLoadHold name="card">
|
|
26
|
+
* </UFOLoadHold>
|
|
27
|
+
* )
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Or wrap your content conditionally
|
|
32
|
+
* ```
|
|
33
|
+
* return (
|
|
34
|
+
* <UFOLoadHold name="card" hold={isLoading}>
|
|
35
|
+
* <Card />
|
|
36
|
+
* </UFOLoadHold>
|
|
37
|
+
* )
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* Or render as a sibling conditionally
|
|
41
|
+
* ```
|
|
42
|
+
* return (
|
|
43
|
+
* <>
|
|
44
|
+
* <Card />
|
|
45
|
+
* <UFOLoadHold name="card" hold={isLoading} />
|
|
46
|
+
* </>
|
|
47
|
+
* )
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
export default function UFOLoadHold(_ref) {
|
|
52
|
+
var children = _ref.children,
|
|
53
|
+
name = _ref.name,
|
|
54
|
+
_ref$hold = _ref.hold,
|
|
55
|
+
hold = _ref$hold === void 0 ? true : _ref$hold;
|
|
56
|
+
// react-18: useId instead
|
|
57
|
+
var context = useContext(UFOInteractionContext);
|
|
58
|
+
useLayoutEffectSAFE(function () {
|
|
59
|
+
if (hold && context != null) {
|
|
60
|
+
return context.hold(name);
|
|
61
|
+
}
|
|
62
|
+
}, [hold, context, name]);
|
|
63
|
+
|
|
64
|
+
// react-18: can return children directly
|
|
65
|
+
return children != null ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : null;
|
|
66
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import UFOLoadHold from '../load-hold';
|
|
3
|
+
import { LazySuspense, WaitContext } from './loosely-lazy';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Provides a placeholder for lazily loaded content, improving perceived performance.
|
|
7
|
+
*
|
|
8
|
+
* Named placeholders are especially useful for analyzing page load breakdowns
|
|
9
|
+
* in performance monitoring tools like Performance Portal.
|
|
10
|
+
*/
|
|
11
|
+
export default function Placeholder(_ref) {
|
|
12
|
+
var name = _ref.name,
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
_ref$fallback = _ref.fallback,
|
|
15
|
+
fallback = _ref$fallback === void 0 ? null : _ref$fallback;
|
|
16
|
+
var waitContext = useContext(WaitContext);
|
|
17
|
+
var shouldHold = !waitContext || !!waitContext.currentValue();
|
|
18
|
+
return /*#__PURE__*/React.createElement(LazySuspense, {
|
|
19
|
+
fallback: /*#__PURE__*/React.createElement(React.Fragment, null, fallback, /*#__PURE__*/React.createElement(UFOLoadHold, {
|
|
20
|
+
name: name,
|
|
21
|
+
hold: shouldHold
|
|
22
|
+
})),
|
|
23
|
+
name: name
|
|
24
|
+
}, children);
|
|
25
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { createContext, Fragment, Suspense, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
var isNodeEnvironment = function isNodeEnvironment() {
|
|
4
|
+
return typeof window === 'undefined' || window.name === 'nodejs';
|
|
5
|
+
};
|
|
6
|
+
var LazySuspenseContext = /*#__PURE__*/createContext({
|
|
7
|
+
fallback: /*#__PURE__*/React.createElement(Fragment, null),
|
|
8
|
+
setFallback: function setFallback() {
|
|
9
|
+
// eslint-disable-next-line no-console
|
|
10
|
+
console.warn('Missing <LooselySuspense /> boundary');
|
|
11
|
+
},
|
|
12
|
+
name: ''
|
|
13
|
+
});
|
|
14
|
+
var DynamicFallback = function DynamicFallback(_ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
outsideSuspense = _ref.outsideSuspense;
|
|
17
|
+
var _React$useContext = React.useContext(LazySuspenseContext),
|
|
18
|
+
fallback = _React$useContext.fallback,
|
|
19
|
+
setFallback = _React$useContext.setFallback;
|
|
20
|
+
useLayoutEffect(function () {
|
|
21
|
+
return function () {
|
|
22
|
+
if (!outsideSuspense) {
|
|
23
|
+
setFallback(null);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}, [outsideSuspense, setFallback]);
|
|
27
|
+
return children(outsideSuspense ? null : fallback);
|
|
28
|
+
};
|
|
29
|
+
DynamicFallback.displayName = 'DynamicFallback';
|
|
30
|
+
export var LazySuspense = function LazySuspense(_ref2) {
|
|
31
|
+
var fallback = _ref2.fallback,
|
|
32
|
+
children = _ref2.children,
|
|
33
|
+
name = _ref2.name;
|
|
34
|
+
var _useState = useState(null),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
hydrationFallback = _useState2[0],
|
|
37
|
+
setHydrationFallback = _useState2[1];
|
|
38
|
+
var mountedRef = useRef(false);
|
|
39
|
+
useLayoutEffect(function () {
|
|
40
|
+
mountedRef.current = true;
|
|
41
|
+
return function () {
|
|
42
|
+
mountedRef.current = false;
|
|
43
|
+
};
|
|
44
|
+
}, []);
|
|
45
|
+
var contextValue = useMemo(function () {
|
|
46
|
+
return {
|
|
47
|
+
fallback: fallback,
|
|
48
|
+
setFallback: function setFallback(newFallback) {
|
|
49
|
+
if (hydrationFallback === newFallback) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setHydrationFallback(newFallback);
|
|
53
|
+
},
|
|
54
|
+
name: name
|
|
55
|
+
};
|
|
56
|
+
}, [fallback, hydrationFallback, name]);
|
|
57
|
+
var renderFallback = function renderFallback(outsideSuspense) {
|
|
58
|
+
return /*#__PURE__*/React.createElement(DynamicFallback, {
|
|
59
|
+
outsideSuspense: outsideSuspense
|
|
60
|
+
}, function (resolvedFallback) {
|
|
61
|
+
return outsideSuspense && hydrationFallback ? hydrationFallback : resolvedFallback;
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
return /*#__PURE__*/React.createElement(LazySuspenseContext.Provider, {
|
|
65
|
+
value: contextValue
|
|
66
|
+
}, isNodeEnvironment() ? children : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Suspense, {
|
|
67
|
+
fallback: renderFallback(false)
|
|
68
|
+
}, children), (!mountedRef.current || hydrationFallback) && renderFallback(true)));
|
|
69
|
+
};
|
|
70
|
+
LazySuspense.displayName = 'LazySuspense';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
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; } } }; }
|
|
3
|
+
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; } }
|
|
4
|
+
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; }
|
|
5
|
+
import { getConfig as getConfigUFO } from '../../../config';
|
|
6
|
+
var defaultAllowedParams = ['operationName', 'operation', 'q'];
|
|
7
|
+
var getAllowedParams = function getAllowedParams() {
|
|
8
|
+
var config = getConfigUFO();
|
|
9
|
+
return (config === null || config === void 0 ? void 0 : config.allowedResourcesParams) || defaultAllowedParams;
|
|
10
|
+
};
|
|
11
|
+
var handleQueryParams = function handleQueryParams(urlString) {
|
|
12
|
+
try {
|
|
13
|
+
if (typeof urlString !== 'string') {
|
|
14
|
+
return urlString;
|
|
15
|
+
}
|
|
16
|
+
var url = new URL(urlString);
|
|
17
|
+
var params = new URLSearchParams(url.search);
|
|
18
|
+
var allowedParams = getAllowedParams();
|
|
19
|
+
var _iterator = _createForOfIteratorHelper(params),
|
|
20
|
+
_step;
|
|
21
|
+
try {
|
|
22
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
23
|
+
var _step$value = _slicedToArray(_step.value, 1),
|
|
24
|
+
key = _step$value[0];
|
|
25
|
+
if (!allowedParams.includes(key)) {
|
|
26
|
+
url.searchParams.delete(key);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
} catch (err) {
|
|
30
|
+
_iterator.e(err);
|
|
31
|
+
} finally {
|
|
32
|
+
_iterator.f();
|
|
33
|
+
}
|
|
34
|
+
return url.toString();
|
|
35
|
+
} catch (e) {
|
|
36
|
+
return urlString;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var config = {
|
|
40
|
+
mapResources: function mapResources(url) {
|
|
41
|
+
return url;
|
|
42
|
+
},
|
|
43
|
+
sanitiseEndpoints: function sanitiseEndpoints(url) {
|
|
44
|
+
return handleQueryParams(url);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
export function configure(resourceTimingConfig) {
|
|
48
|
+
var newConfig = {
|
|
49
|
+
mapResources: resourceTimingConfig.mapResources,
|
|
50
|
+
sanitiseEndpoints: function sanitiseEndpoints(url) {
|
|
51
|
+
var sanitised = resourceTimingConfig.sanitiseEndpoints(url);
|
|
52
|
+
if (sanitised) {
|
|
53
|
+
return handleQueryParams(sanitised);
|
|
54
|
+
}
|
|
55
|
+
return sanitised;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
config = newConfig;
|
|
59
|
+
}
|
|
60
|
+
export var getConfig = function getConfig() {
|
|
61
|
+
return config;
|
|
62
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { roundEpsilon } from '../../../round-number';
|
|
3
|
+
var getPerformanceObject = function getPerformanceObject() {
|
|
4
|
+
var _window;
|
|
5
|
+
return ((_window = window) !== null && _window !== void 0 ? _window : {}).performance;
|
|
6
|
+
};
|
|
7
|
+
var getPerformanceObserverObject = function getPerformanceObserverObject() {
|
|
8
|
+
var _window2;
|
|
9
|
+
return ((_window2 = window) !== null && _window2 !== void 0 ? _window2 : {}).PerformanceObserver;
|
|
10
|
+
};
|
|
11
|
+
export var resourceTimingBuffer = {
|
|
12
|
+
timings: [],
|
|
13
|
+
maxSize: 1000,
|
|
14
|
+
observer: null,
|
|
15
|
+
transformResource: function transformResource(entry) {
|
|
16
|
+
var _entry$serverTiming, _entry$serverTiming2;
|
|
17
|
+
var duration = roundEpsilon(entry.duration);
|
|
18
|
+
|
|
19
|
+
// prioritising atl-edge
|
|
20
|
+
var totalBackendTimeEntry = ((_entry$serverTiming = entry.serverTiming) === null || _entry$serverTiming === void 0 ? void 0 : _entry$serverTiming.find(function (timing) {
|
|
21
|
+
return timing.name === 'atl-edge';
|
|
22
|
+
})) || ((_entry$serverTiming2 = entry.serverTiming) === null || _entry$serverTiming2 === void 0 ? void 0 : _entry$serverTiming2.find(
|
|
23
|
+
// timing name should come from per-product config in the future
|
|
24
|
+
function (timing) {
|
|
25
|
+
return timing.name === 'total' || timing.name === 'filter-request-papi';
|
|
26
|
+
}));
|
|
27
|
+
var serverTime = totalBackendTimeEntry ? roundEpsilon(totalBackendTimeEntry.duration) : undefined;
|
|
28
|
+
var networkTime = serverTime ? duration - serverTime : undefined;
|
|
29
|
+
return {
|
|
30
|
+
name: entry.name,
|
|
31
|
+
initiatorType: entry.initiatorType,
|
|
32
|
+
transferSize: entry.transferSize,
|
|
33
|
+
startTime: roundEpsilon(entry.startTime),
|
|
34
|
+
duration: roundEpsilon(entry.duration),
|
|
35
|
+
fetchStart: roundEpsilon(entry.fetchStart || 0),
|
|
36
|
+
workerStart: roundEpsilon(entry.workerStart || 0),
|
|
37
|
+
responseStart: roundEpsilon(entry.responseStart || 0),
|
|
38
|
+
requestStart: roundEpsilon(entry.requestStart || 0),
|
|
39
|
+
serverTime: serverTime,
|
|
40
|
+
networkTime: networkTime,
|
|
41
|
+
encodedSize: roundEpsilon(entry.encodedBodySize),
|
|
42
|
+
decodedSize: roundEpsilon(entry.decodedBodySize)
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
start: function start() {
|
|
46
|
+
var _performance$getEntri;
|
|
47
|
+
var performance = getPerformanceObject();
|
|
48
|
+
var PerformanceObserver = getPerformanceObserverObject();
|
|
49
|
+
if (!PerformanceObserver || !performance || typeof PerformanceObserver === 'undefined') {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (resourceTimingBuffer.observer) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
var resources = (_performance$getEntri = performance.getEntriesByType) === null || _performance$getEntri === void 0 ? void 0 : _performance$getEntri.call(performance, 'resource');
|
|
56
|
+
if (resources) {
|
|
57
|
+
resourceTimingBuffer.timings = resources.map(function (resource) {
|
|
58
|
+
return resourceTimingBuffer.transformResource(resource);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
resourceTimingBuffer.observer = new PerformanceObserver(resourceTimingBuffer.addTimings);
|
|
62
|
+
resourceTimingBuffer.observer.observe({
|
|
63
|
+
entryTypes: ['resource']
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
stop: function stop() {
|
|
67
|
+
if (resourceTimingBuffer.observer) {
|
|
68
|
+
resourceTimingBuffer.observer.disconnect();
|
|
69
|
+
resourceTimingBuffer.observer = null;
|
|
70
|
+
}
|
|
71
|
+
resourceTimingBuffer.timings = [];
|
|
72
|
+
},
|
|
73
|
+
addTimings: function addTimings(list) {
|
|
74
|
+
var _resourceTimingBuffer;
|
|
75
|
+
var entries = list.getEntries().map(function (entry) {
|
|
76
|
+
return resourceTimingBuffer.transformResource(entry);
|
|
77
|
+
});
|
|
78
|
+
var overflow = resourceTimingBuffer.timings.length + entries.length;
|
|
79
|
+
if (overflow > resourceTimingBuffer.maxSize) {
|
|
80
|
+
var fieldsToRemove = overflow - resourceTimingBuffer.maxSize;
|
|
81
|
+
resourceTimingBuffer.timings.splice(0, fieldsToRemove);
|
|
82
|
+
}
|
|
83
|
+
(_resourceTimingBuffer = resourceTimingBuffer.timings).push.apply(_resourceTimingBuffer, _toConsumableArray(entries));
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var isValidTiming = function isValidTiming(timing, startTime, endTime) {
|
|
87
|
+
return timing.startTime >= startTime && timing.startTime + timing.duration <= endTime;
|
|
88
|
+
};
|
|
89
|
+
export var filterResourceTimings = function filterResourceTimings(startTime, endTime) {
|
|
90
|
+
var performance = getPerformanceObject();
|
|
91
|
+
var PerformanceObserver = getPerformanceObserverObject();
|
|
92
|
+
if (!PerformanceObserver || !resourceTimingBuffer.observer) {
|
|
93
|
+
var resources = performance === null || performance === void 0 ? void 0 : performance.getEntriesByType('resource');
|
|
94
|
+
if (resources) {
|
|
95
|
+
return resources.filter(function (timing) {
|
|
96
|
+
return isValidTiming(timing, startTime, endTime);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return resourceTimingBuffer.timings.filter(function (timing) {
|
|
102
|
+
return isValidTiming(timing, startTime, endTime);
|
|
103
|
+
});
|
|
104
|
+
};
|