@kubesense/kubesense-browser-rum-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/cjs/boot/preStartRum.d.ts +7 -0
- package/cjs/boot/preStartRum.js +190 -0
- package/cjs/boot/preStartRum.js.map +1 -0
- package/cjs/boot/rumPublicApi.d.ts +409 -0
- package/cjs/boot/rumPublicApi.js +168 -0
- package/cjs/boot/rumPublicApi.js.map +1 -0
- package/cjs/boot/startRum.d.ts +109 -0
- package/cjs/boot/startRum.js +153 -0
- package/cjs/boot/startRum.js.map +1 -0
- package/cjs/browser/cookieObservable.d.ts +8 -0
- package/cjs/browser/cookieObservable.js +39 -0
- package/cjs/browser/cookieObservable.js.map +1 -0
- package/cjs/browser/domMutationObservable.d.ts +27 -0
- package/cjs/browser/domMutationObservable.js +58 -0
- package/cjs/browser/domMutationObservable.js.map +1 -0
- package/cjs/browser/firstInputPolyfill.d.ts +8 -0
- package/cjs/browser/firstInputPolyfill.js +68 -0
- package/cjs/browser/firstInputPolyfill.js.map +1 -0
- package/cjs/browser/htmlDomUtils.d.ts +13 -0
- package/cjs/browser/htmlDomUtils.js +46 -0
- package/cjs/browser/htmlDomUtils.js.map +1 -0
- package/cjs/browser/locationChangeObservable.d.ts +7 -0
- package/cjs/browser/locationChangeObservable.js +51 -0
- package/cjs/browser/locationChangeObservable.js.map +1 -0
- package/cjs/browser/performanceObservable.d.ts +174 -0
- package/cjs/browser/performanceObservable.js +126 -0
- package/cjs/browser/performanceObservable.js.map +1 -0
- package/cjs/browser/performanceUtils.d.ts +7 -0
- package/cjs/browser/performanceUtils.js +42 -0
- package/cjs/browser/performanceUtils.js.map +1 -0
- package/cjs/browser/scroll.d.ts +2 -0
- package/cjs/browser/scroll.js +33 -0
- package/cjs/browser/scroll.js.map +1 -0
- package/cjs/browser/viewportObservable.d.ts +10 -0
- package/cjs/browser/viewportObservable.js +37 -0
- package/cjs/browser/viewportObservable.js.map +1 -0
- package/cjs/browser/windowOpenObservable.d.ts +5 -0
- package/cjs/browser/windowOpenObservable.js +10 -0
- package/cjs/browser/windowOpenObservable.js.map +1 -0
- package/cjs/domain/action/actionCollection.d.ts +21 -0
- package/cjs/domain/action/actionCollection.js +96 -0
- package/cjs/domain/action/actionCollection.js.map +1 -0
- package/cjs/domain/action/actionNameConstants.d.ts +18 -0
- package/cjs/domain/action/actionNameConstants.js +11 -0
- package/cjs/domain/action/actionNameConstants.js.map +1 -0
- package/cjs/domain/action/clickChain.d.ts +8 -0
- package/cjs/domain/action/clickChain.js +61 -0
- package/cjs/domain/action/clickChain.js.map +1 -0
- package/cjs/domain/action/computeFrustration.d.ts +6 -0
- package/cjs/domain/action/computeFrustration.js +70 -0
- package/cjs/domain/action/computeFrustration.js.map +1 -0
- package/cjs/domain/action/getActionNameFromElement.d.ts +4 -0
- package/cjs/domain/action/getActionNameFromElement.js +239 -0
- package/cjs/domain/action/getActionNameFromElement.js.map +1 -0
- package/cjs/domain/action/interactionSelectorCache.d.ts +5 -0
- package/cjs/domain/action/interactionSelectorCache.js +23 -0
- package/cjs/domain/action/interactionSelectorCache.js.map +1 -0
- package/cjs/domain/action/listenActionEvents.d.ts +19 -0
- package/cjs/domain/action/listenActionEvents.js +61 -0
- package/cjs/domain/action/listenActionEvents.js.map +1 -0
- package/cjs/domain/action/trackClickActions.d.ts +81 -0
- package/cjs/domain/action/trackClickActions.js +237 -0
- package/cjs/domain/action/trackClickActions.js.map +1 -0
- package/cjs/domain/assembly.d.ts +5 -0
- package/cjs/domain/assembly.js +102 -0
- package/cjs/domain/assembly.js.map +1 -0
- package/cjs/domain/configuration/configuration.d.ts +325 -0
- package/cjs/domain/configuration/configuration.js +205 -0
- package/cjs/domain/configuration/configuration.js.map +1 -0
- package/cjs/domain/configuration/index.d.ts +2 -0
- package/cjs/domain/configuration/index.js +19 -0
- package/cjs/domain/configuration/index.js.map +1 -0
- package/cjs/domain/configuration/jsonPathParser.d.ts +28 -0
- package/cjs/domain/configuration/jsonPathParser.js +159 -0
- package/cjs/domain/configuration/jsonPathParser.js.map +1 -0
- package/cjs/domain/configuration/remoteConfiguration.d.ts +39 -0
- package/cjs/domain/configuration/remoteConfiguration.js +243 -0
- package/cjs/domain/configuration/remoteConfiguration.js.map +1 -0
- package/cjs/domain/configuration/remoteConfiguration.types.d.ts +138 -0
- package/cjs/domain/configuration/remoteConfiguration.types.js +7 -0
- package/cjs/domain/configuration/remoteConfiguration.types.js.map +1 -0
- package/cjs/domain/contexts/ciVisibilityContext.d.ts +12 -0
- package/cjs/domain/contexts/ciVisibilityContext.js +34 -0
- package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -0
- package/cjs/domain/contexts/connectivityContext.d.ts +2 -0
- package/cjs/domain/contexts/connectivityContext.js +11 -0
- package/cjs/domain/contexts/connectivityContext.js.map +1 -0
- package/cjs/domain/contexts/defaultContext.d.ts +4 -0
- package/cjs/domain/contexts/defaultContext.js +34 -0
- package/cjs/domain/contexts/defaultContext.js.map +1 -0
- package/cjs/domain/contexts/displayContext.d.ts +6 -0
- package/cjs/domain/contexts/displayContext.js +28 -0
- package/cjs/domain/contexts/displayContext.js.map +1 -0
- package/cjs/domain/contexts/featureFlagContext.d.ts +19 -0
- package/cjs/domain/contexts/featureFlagContext.js +53 -0
- package/cjs/domain/contexts/featureFlagContext.js.map +1 -0
- package/cjs/domain/contexts/internalContext.d.ts +12 -0
- package/cjs/domain/contexts/internalContext.js +26 -0
- package/cjs/domain/contexts/internalContext.js.map +1 -0
- package/cjs/domain/contexts/pageStateHistory.d.ts +23 -0
- package/cjs/domain/contexts/pageStateHistory.js +104 -0
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -0
- package/cjs/domain/contexts/sessionContext.d.ts +5 -0
- package/cjs/domain/contexts/sessionContext.js +47 -0
- package/cjs/domain/contexts/sessionContext.js.map +1 -0
- package/cjs/domain/contexts/syntheticsContext.d.ts +2 -0
- package/cjs/domain/contexts/syntheticsContext.js +25 -0
- package/cjs/domain/contexts/syntheticsContext.js.map +1 -0
- package/cjs/domain/contexts/trackingConsentContext.d.ts +3 -0
- package/cjs/domain/contexts/trackingConsentContext.js +14 -0
- package/cjs/domain/contexts/trackingConsentContext.js.map +1 -0
- package/cjs/domain/contexts/urlContexts.d.ts +22 -0
- package/cjs/domain/contexts/urlContexts.js +64 -0
- package/cjs/domain/contexts/urlContexts.js.map +1 -0
- package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -0
- package/cjs/domain/contexts/userAgentDataContext.js +31 -0
- package/cjs/domain/contexts/userAgentDataContext.js.map +1 -0
- package/cjs/domain/contexts/viewHistory.d.ts +17 -0
- package/cjs/domain/contexts/viewHistory.js +48 -0
- package/cjs/domain/contexts/viewHistory.js.map +1 -0
- package/cjs/domain/discardNegativeDuration.d.ts +2 -0
- package/cjs/domain/discardNegativeDuration.js +8 -0
- package/cjs/domain/discardNegativeDuration.js.map +1 -0
- package/cjs/domain/error/errorCollection.d.ts +17 -0
- package/cjs/domain/error/errorCollection.js +74 -0
- package/cjs/domain/error/errorCollection.js.map +1 -0
- package/cjs/domain/error/trackConsoleError.d.ts +4 -0
- package/cjs/domain/error/trackConsoleError.js +13 -0
- package/cjs/domain/error/trackConsoleError.js.map +1 -0
- package/cjs/domain/error/trackReportError.d.ts +5 -0
- package/cjs/domain/error/trackReportError.js +16 -0
- package/cjs/domain/error/trackReportError.js.map +1 -0
- package/cjs/domain/event/eventCollection.d.ts +10 -0
- package/cjs/domain/event/eventCollection.js +27 -0
- package/cjs/domain/event/eventCollection.js.map +1 -0
- package/cjs/domain/getSelectorFromElement.d.ts +64 -0
- package/cjs/domain/getSelectorFromElement.js +218 -0
- package/cjs/domain/getSelectorFromElement.js.map +1 -0
- package/cjs/domain/getSessionReplayUrl.d.ts +9 -0
- package/cjs/domain/getSessionReplayUrl.js +34 -0
- package/cjs/domain/getSessionReplayUrl.js.map +1 -0
- package/cjs/domain/hooks.d.ts +23 -0
- package/cjs/domain/hooks.js +6 -0
- package/cjs/domain/hooks.js.map +1 -0
- package/cjs/domain/lifeCycle.d.ts +73 -0
- package/cjs/domain/lifeCycle.js +6 -0
- package/cjs/domain/lifeCycle.js.map +1 -0
- package/cjs/domain/limitModification.d.ts +8 -0
- package/cjs/domain/limitModification.js +46 -0
- package/cjs/domain/limitModification.js.map +1 -0
- package/cjs/domain/longTask/longTaskCollection.d.ts +18 -0
- package/cjs/domain/longTask/longTaskCollection.js +91 -0
- package/cjs/domain/longTask/longTaskCollection.js.map +1 -0
- package/cjs/domain/plugins.d.ts +40 -0
- package/cjs/domain/plugins.js +15 -0
- package/cjs/domain/plugins.js.map +1 -0
- package/cjs/domain/privacy.d.ts +44 -0
- package/cjs/domain/privacy.js +313 -0
- package/cjs/domain/privacy.js.map +1 -0
- package/cjs/domain/privacyConstants.d.ts +23 -0
- package/cjs/domain/privacyConstants.js +39 -0
- package/cjs/domain/privacyConstants.js.map +1 -0
- package/cjs/domain/requestCollection.d.ts +54 -0
- package/cjs/domain/requestCollection.js +111 -0
- package/cjs/domain/requestCollection.js.map +1 -0
- package/cjs/domain/resource/graphql.d.ts +23 -0
- package/cjs/domain/resource/graphql.js +97 -0
- package/cjs/domain/resource/graphql.js.map +1 -0
- package/cjs/domain/resource/matchRequestResourceEntry.d.ts +16 -0
- package/cjs/domain/resource/matchRequestResourceEntry.js +49 -0
- package/cjs/domain/resource/matchRequestResourceEntry.js.map +1 -0
- package/cjs/domain/resource/requestRegistry.d.ts +9 -0
- package/cjs/domain/resource/requestRegistry.js +41 -0
- package/cjs/domain/resource/requestRegistry.js.map +1 -0
- package/cjs/domain/resource/resourceCollection.d.ts +7 -0
- package/cjs/domain/resource/resourceCollection.js +190 -0
- package/cjs/domain/resource/resourceCollection.js.map +1 -0
- package/cjs/domain/resource/resourceUtils.d.ts +55 -0
- package/cjs/domain/resource/resourceUtils.js +259 -0
- package/cjs/domain/resource/resourceUtils.js.map +1 -0
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +4 -0
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +24 -0
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +1 -0
- package/cjs/domain/rumSessionManager.d.ts +36 -0
- package/cjs/domain/rumSessionManager.js +77 -0
- package/cjs/domain/rumSessionManager.js.map +1 -0
- package/cjs/domain/sampler/sampler.d.ts +10 -0
- package/cjs/domain/sampler/sampler.js +63 -0
- package/cjs/domain/sampler/sampler.js.map +1 -0
- package/cjs/domain/startCustomerDataTelemetry.d.ts +4 -0
- package/cjs/domain/startCustomerDataTelemetry.js +56 -0
- package/cjs/domain/startCustomerDataTelemetry.js.map +1 -0
- package/cjs/domain/tracing/getDocumentTraceId.d.ts +12 -0
- package/cjs/domain/tracing/getDocumentTraceId.js +76 -0
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/cjs/domain/tracing/identifier.d.ts +13 -0
- package/cjs/domain/tracing/identifier.js +55 -0
- package/cjs/domain/tracing/identifier.js.map +1 -0
- package/cjs/domain/tracing/sampler.d.ts +10 -0
- package/cjs/domain/tracing/sampler.js +69 -0
- package/cjs/domain/tracing/sampler.js.map +1 -0
- package/cjs/domain/tracing/tracer.d.ts +30 -0
- package/cjs/domain/tracing/tracer.js +161 -0
- package/cjs/domain/tracing/tracer.js.map +1 -0
- package/cjs/domain/tracing/tracer.types.d.ts +12 -0
- package/cjs/domain/tracing/tracer.types.js +3 -0
- package/cjs/domain/tracing/tracer.types.js.map +1 -0
- package/cjs/domain/trackEventCounts.d.ts +17 -0
- package/cjs/domain/trackEventCounts.js +50 -0
- package/cjs/domain/trackEventCounts.js.map +1 -0
- package/cjs/domain/view/bfCacheSupport.d.ts +2 -0
- package/cjs/domain/view/bfCacheSupport.js +13 -0
- package/cjs/domain/view/bfCacheSupport.js.map +1 -0
- package/cjs/domain/view/trackViewEventCounts.d.ts +5 -0
- package/cjs/domain/view/trackViewEventCounts.js +16 -0
- package/cjs/domain/view/trackViewEventCounts.js.map +1 -0
- package/cjs/domain/view/trackViews.d.ts +65 -0
- package/cjs/domain/view/trackViews.js +275 -0
- package/cjs/domain/view/trackViews.js.map +1 -0
- package/cjs/domain/view/viewCollection.d.ts +18 -0
- package/cjs/domain/view/viewCollection.js +153 -0
- package/cjs/domain/view/viewCollection.js.map +1 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +6 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +32 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +18 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +44 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -0
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +6 -0
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +44 -0
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +8 -0
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +17 -0
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +21 -0
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +37 -0
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +37 -0
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +135 -0
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +13 -0
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +39 -0
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +10 -0
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js +33 -0
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +19 -0
- package/cjs/domain/view/viewMetrics/trackFirstInput.js +43 -0
- package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +15 -0
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +41 -0
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +25 -0
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +155 -0
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +18 -0
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +61 -0
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +14 -0
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js +50 -0
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +14 -0
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +43 -0
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -0
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +25 -0
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +78 -0
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -0
- package/cjs/domain/vital/vitalCollection.d.ts +55 -0
- package/cjs/domain/vital/vitalCollection.js +113 -0
- package/cjs/domain/vital/vitalCollection.js.map +1 -0
- package/cjs/domain/waitPageActivityEnd.d.ts +54 -0
- package/cjs/domain/waitPageActivityEnd.js +129 -0
- package/cjs/domain/waitPageActivityEnd.js.map +1 -0
- package/cjs/domainContext.types.d.ts +39 -0
- package/cjs/domainContext.types.js +6 -0
- package/cjs/domainContext.types.js.map +1 -0
- package/cjs/index.d.ts +41 -0
- package/cjs/index.js +59 -0
- package/cjs/index.js.map +1 -0
- package/cjs/rawRumEvent.types.d.ts +326 -0
- package/cjs/rawRumEvent.types.js +34 -0
- package/cjs/rawRumEvent.types.js.map +1 -0
- package/cjs/rumEvent.types.d.ts +2026 -0
- package/cjs/rumEvent.types.js +7 -0
- package/cjs/rumEvent.types.js.map +1 -0
- package/cjs/transport/formDataTransport.d.ts +16 -0
- package/cjs/transport/formDataTransport.js +46 -0
- package/cjs/transport/formDataTransport.js.map +1 -0
- package/cjs/transport/startRumBatch.d.ts +5 -0
- package/cjs/transport/startRumBatch.js +33 -0
- package/cjs/transport/startRumBatch.js.map +1 -0
- package/cjs/transport/startRumEventBridge.d.ts +2 -0
- package/cjs/transport/startRumEventBridge.js +11 -0
- package/cjs/transport/startRumEventBridge.js.map +1 -0
- package/esm/boot/preStartRum.d.ts +7 -0
- package/esm/boot/preStartRum.js +187 -0
- package/esm/boot/preStartRum.js.map +1 -0
- package/esm/boot/rumPublicApi.d.ts +409 -0
- package/esm/boot/rumPublicApi.js +165 -0
- package/esm/boot/rumPublicApi.js.map +1 -0
- package/esm/boot/startRum.d.ts +109 -0
- package/esm/boot/startRum.js +149 -0
- package/esm/boot/startRum.js.map +1 -0
- package/esm/browser/cookieObservable.d.ts +8 -0
- package/esm/browser/cookieObservable.js +35 -0
- package/esm/browser/cookieObservable.js.map +1 -0
- package/esm/browser/domMutationObservable.d.ts +27 -0
- package/esm/browser/domMutationObservable.js +54 -0
- package/esm/browser/domMutationObservable.js.map +1 -0
- package/esm/browser/firstInputPolyfill.d.ts +8 -0
- package/esm/browser/firstInputPolyfill.js +65 -0
- package/esm/browser/firstInputPolyfill.js.map +1 -0
- package/esm/browser/htmlDomUtils.d.ts +13 -0
- package/esm/browser/htmlDomUtils.js +36 -0
- package/esm/browser/htmlDomUtils.js.map +1 -0
- package/esm/browser/locationChangeObservable.d.ts +7 -0
- package/esm/browser/locationChangeObservable.js +48 -0
- package/esm/browser/locationChangeObservable.js.map +1 -0
- package/esm/browser/performanceObservable.d.ts +174 -0
- package/esm/browser/performanceObservable.js +121 -0
- package/esm/browser/performanceObservable.js.map +1 -0
- package/esm/browser/performanceUtils.d.ts +7 -0
- package/esm/browser/performanceUtils.js +38 -0
- package/esm/browser/performanceUtils.js.map +1 -0
- package/esm/browser/scroll.d.ts +2 -0
- package/esm/browser/scroll.js +29 -0
- package/esm/browser/scroll.js.map +1 -0
- package/esm/browser/viewportObservable.d.ts +10 -0
- package/esm/browser/viewportObservable.js +32 -0
- package/esm/browser/viewportObservable.js.map +1 -0
- package/esm/browser/windowOpenObservable.d.ts +5 -0
- package/esm/browser/windowOpenObservable.js +7 -0
- package/esm/browser/windowOpenObservable.js.map +1 -0
- package/esm/domain/action/actionCollection.d.ts +21 -0
- package/esm/domain/action/actionCollection.js +93 -0
- package/esm/domain/action/actionCollection.js.map +1 -0
- package/esm/domain/action/actionNameConstants.d.ts +18 -0
- package/esm/domain/action/actionNameConstants.js +8 -0
- package/esm/domain/action/actionNameConstants.js.map +1 -0
- package/esm/domain/action/clickChain.d.ts +8 -0
- package/esm/domain/action/clickChain.js +57 -0
- package/esm/domain/action/clickChain.js.map +1 -0
- package/esm/domain/action/computeFrustration.d.ts +6 -0
- package/esm/domain/action/computeFrustration.js +65 -0
- package/esm/domain/action/computeFrustration.js.map +1 -0
- package/esm/domain/action/getActionNameFromElement.d.ts +4 -0
- package/esm/domain/action/getActionNameFromElement.js +236 -0
- package/esm/domain/action/getActionNameFromElement.js.map +1 -0
- package/esm/domain/action/interactionSelectorCache.d.ts +5 -0
- package/esm/domain/action/interactionSelectorCache.js +18 -0
- package/esm/domain/action/interactionSelectorCache.js.map +1 -0
- package/esm/domain/action/listenActionEvents.d.ts +19 -0
- package/esm/domain/action/listenActionEvents.js +58 -0
- package/esm/domain/action/listenActionEvents.js.map +1 -0
- package/esm/domain/action/trackClickActions.d.ts +81 -0
- package/esm/domain/action/trackClickActions.js +232 -0
- package/esm/domain/action/trackClickActions.js.map +1 -0
- package/esm/domain/assembly.d.ts +5 -0
- package/esm/domain/assembly.js +99 -0
- package/esm/domain/assembly.js.map +1 -0
- package/esm/domain/configuration/configuration.d.ts +325 -0
- package/esm/domain/configuration/configuration.js +200 -0
- package/esm/domain/configuration/configuration.js.map +1 -0
- package/esm/domain/configuration/index.d.ts +2 -0
- package/esm/domain/configuration/index.js +3 -0
- package/esm/domain/configuration/index.js.map +1 -0
- package/esm/domain/configuration/jsonPathParser.d.ts +28 -0
- package/esm/domain/configuration/jsonPathParser.js +156 -0
- package/esm/domain/configuration/jsonPathParser.js.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.d.ts +39 -0
- package/esm/domain/configuration/remoteConfiguration.js +236 -0
- package/esm/domain/configuration/remoteConfiguration.js.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.types.d.ts +138 -0
- package/esm/domain/configuration/remoteConfiguration.types.js +6 -0
- package/esm/domain/configuration/remoteConfiguration.types.js.map +1 -0
- package/esm/domain/contexts/ciVisibilityContext.d.ts +12 -0
- package/esm/domain/contexts/ciVisibilityContext.js +30 -0
- package/esm/domain/contexts/ciVisibilityContext.js.map +1 -0
- package/esm/domain/contexts/connectivityContext.d.ts +2 -0
- package/esm/domain/contexts/connectivityContext.js +8 -0
- package/esm/domain/contexts/connectivityContext.js.map +1 -0
- package/esm/domain/contexts/defaultContext.d.ts +4 -0
- package/esm/domain/contexts/defaultContext.js +31 -0
- package/esm/domain/contexts/defaultContext.js.map +1 -0
- package/esm/domain/contexts/displayContext.d.ts +6 -0
- package/esm/domain/contexts/displayContext.js +25 -0
- package/esm/domain/contexts/displayContext.js.map +1 -0
- package/esm/domain/contexts/featureFlagContext.d.ts +19 -0
- package/esm/domain/contexts/featureFlagContext.js +49 -0
- package/esm/domain/contexts/featureFlagContext.js.map +1 -0
- package/esm/domain/contexts/internalContext.d.ts +12 -0
- package/esm/domain/contexts/internalContext.js +23 -0
- package/esm/domain/contexts/internalContext.js.map +1 -0
- package/esm/domain/contexts/pageStateHistory.d.ts +23 -0
- package/esm/domain/contexts/pageStateHistory.js +100 -0
- package/esm/domain/contexts/pageStateHistory.js.map +1 -0
- package/esm/domain/contexts/sessionContext.d.ts +5 -0
- package/esm/domain/contexts/sessionContext.js +44 -0
- package/esm/domain/contexts/sessionContext.js.map +1 -0
- package/esm/domain/contexts/syntheticsContext.d.ts +2 -0
- package/esm/domain/contexts/syntheticsContext.js +22 -0
- package/esm/domain/contexts/syntheticsContext.js.map +1 -0
- package/esm/domain/contexts/trackingConsentContext.d.ts +3 -0
- package/esm/domain/contexts/trackingConsentContext.js +11 -0
- package/esm/domain/contexts/trackingConsentContext.js.map +1 -0
- package/esm/domain/contexts/urlContexts.d.ts +22 -0
- package/esm/domain/contexts/urlContexts.js +60 -0
- package/esm/domain/contexts/urlContexts.js.map +1 -0
- package/esm/domain/contexts/userAgentDataContext.d.ts +2 -0
- package/esm/domain/contexts/userAgentDataContext.js +28 -0
- package/esm/domain/contexts/userAgentDataContext.js.map +1 -0
- package/esm/domain/contexts/viewHistory.d.ts +17 -0
- package/esm/domain/contexts/viewHistory.js +44 -0
- package/esm/domain/contexts/viewHistory.js.map +1 -0
- package/esm/domain/discardNegativeDuration.d.ts +2 -0
- package/esm/domain/discardNegativeDuration.js +5 -0
- package/esm/domain/discardNegativeDuration.js.map +1 -0
- package/esm/domain/error/errorCollection.d.ts +17 -0
- package/esm/domain/error/errorCollection.js +70 -0
- package/esm/domain/error/errorCollection.js.map +1 -0
- package/esm/domain/error/trackConsoleError.d.ts +4 -0
- package/esm/domain/error/trackConsoleError.js +10 -0
- package/esm/domain/error/trackConsoleError.js.map +1 -0
- package/esm/domain/error/trackReportError.d.ts +5 -0
- package/esm/domain/error/trackReportError.js +13 -0
- package/esm/domain/error/trackReportError.js.map +1 -0
- package/esm/domain/event/eventCollection.d.ts +10 -0
- package/esm/domain/event/eventCollection.js +24 -0
- package/esm/domain/event/eventCollection.js.map +1 -0
- package/esm/domain/getSelectorFromElement.d.ts +64 -0
- package/esm/domain/getSelectorFromElement.js +213 -0
- package/esm/domain/getSelectorFromElement.js.map +1 -0
- package/esm/domain/getSessionReplayUrl.d.ts +9 -0
- package/esm/domain/getSessionReplayUrl.js +30 -0
- package/esm/domain/getSessionReplayUrl.js.map +1 -0
- package/esm/domain/hooks.d.ts +23 -0
- package/esm/domain/hooks.js +3 -0
- package/esm/domain/hooks.js.map +1 -0
- package/esm/domain/lifeCycle.d.ts +73 -0
- package/esm/domain/lifeCycle.js +3 -0
- package/esm/domain/lifeCycle.js.map +1 -0
- package/esm/domain/limitModification.d.ts +8 -0
- package/esm/domain/limitModification.js +43 -0
- package/esm/domain/limitModification.js.map +1 -0
- package/esm/domain/longTask/longTaskCollection.d.ts +18 -0
- package/esm/domain/longTask/longTaskCollection.js +87 -0
- package/esm/domain/longTask/longTaskCollection.js.map +1 -0
- package/esm/domain/plugins.d.ts +40 -0
- package/esm/domain/plugins.js +12 -0
- package/esm/domain/plugins.js.map +1 -0
- package/esm/domain/privacy.d.ts +44 -0
- package/esm/domain/privacy.js +302 -0
- package/esm/domain/privacy.js.map +1 -0
- package/esm/domain/privacyConstants.d.ts +23 -0
- package/esm/domain/privacyConstants.js +35 -0
- package/esm/domain/privacyConstants.js.map +1 -0
- package/esm/domain/requestCollection.d.ts +54 -0
- package/esm/domain/requestCollection.js +106 -0
- package/esm/domain/requestCollection.js.map +1 -0
- package/esm/domain/resource/graphql.d.ts +23 -0
- package/esm/domain/resource/graphql.js +91 -0
- package/esm/domain/resource/graphql.js.map +1 -0
- package/esm/domain/resource/matchRequestResourceEntry.d.ts +16 -0
- package/esm/domain/resource/matchRequestResourceEntry.js +46 -0
- package/esm/domain/resource/matchRequestResourceEntry.js.map +1 -0
- package/esm/domain/resource/requestRegistry.d.ts +9 -0
- package/esm/domain/resource/requestRegistry.js +37 -0
- package/esm/domain/resource/requestRegistry.js.map +1 -0
- package/esm/domain/resource/resourceCollection.d.ts +7 -0
- package/esm/domain/resource/resourceCollection.js +187 -0
- package/esm/domain/resource/resourceCollection.js.map +1 -0
- package/esm/domain/resource/resourceUtils.d.ts +55 -0
- package/esm/domain/resource/resourceUtils.js +244 -0
- package/esm/domain/resource/resourceUtils.js.map +1 -0
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +4 -0
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +21 -0
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +1 -0
- package/esm/domain/rumSessionManager.d.ts +36 -0
- package/esm/domain/rumSessionManager.js +72 -0
- package/esm/domain/rumSessionManager.js.map +1 -0
- package/esm/domain/sampler/sampler.d.ts +10 -0
- package/esm/domain/sampler/sampler.js +58 -0
- package/esm/domain/sampler/sampler.js.map +1 -0
- package/esm/domain/startCustomerDataTelemetry.d.ts +4 -0
- package/esm/domain/startCustomerDataTelemetry.js +52 -0
- package/esm/domain/startCustomerDataTelemetry.js.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.d.ts +12 -0
- package/esm/domain/tracing/getDocumentTraceId.js +68 -0
- package/esm/domain/tracing/getDocumentTraceId.js.map +1 -0
- package/esm/domain/tracing/identifier.d.ts +13 -0
- package/esm/domain/tracing/identifier.js +50 -0
- package/esm/domain/tracing/identifier.js.map +1 -0
- package/esm/domain/tracing/sampler.d.ts +10 -0
- package/esm/domain/tracing/sampler.js +64 -0
- package/esm/domain/tracing/sampler.js.map +1 -0
- package/esm/domain/tracing/tracer.d.ts +30 -0
- package/esm/domain/tracing/tracer.js +156 -0
- package/esm/domain/tracing/tracer.js.map +1 -0
- package/esm/domain/tracing/tracer.types.d.ts +12 -0
- package/esm/domain/tracing/tracer.types.js +2 -0
- package/esm/domain/tracing/tracer.types.js.map +1 -0
- package/esm/domain/trackEventCounts.d.ts +17 -0
- package/esm/domain/trackEventCounts.js +47 -0
- package/esm/domain/trackEventCounts.js.map +1 -0
- package/esm/domain/view/bfCacheSupport.d.ts +2 -0
- package/esm/domain/view/bfCacheSupport.js +10 -0
- package/esm/domain/view/bfCacheSupport.js.map +1 -0
- package/esm/domain/view/trackViewEventCounts.d.ts +5 -0
- package/esm/domain/view/trackViewEventCounts.js +13 -0
- package/esm/domain/view/trackViewEventCounts.js.map +1 -0
- package/esm/domain/view/trackViews.d.ts +65 -0
- package/esm/domain/view/trackViews.js +271 -0
- package/esm/domain/view/trackViews.js.map +1 -0
- package/esm/domain/view/viewCollection.d.ts +18 -0
- package/esm/domain/view/viewCollection.js +150 -0
- package/esm/domain/view/viewCollection.js.map +1 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +6 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +28 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +18 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +39 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -0
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +6 -0
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +41 -0
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +8 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +21 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +34 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +37 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +130 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +13 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +34 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +10 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.js +30 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +19 -0
- package/esm/domain/view/viewMetrics/trackFirstInput.js +40 -0
- package/esm/domain/view/viewMetrics/trackFirstInput.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +15 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +38 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +25 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +149 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +18 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +57 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +14 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.js +47 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +14 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js +40 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +25 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js +72 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -0
- package/esm/domain/vital/vitalCollection.d.ts +55 -0
- package/esm/domain/vital/vitalCollection.js +107 -0
- package/esm/domain/vital/vitalCollection.js.map +1 -0
- package/esm/domain/waitPageActivityEnd.d.ts +54 -0
- package/esm/domain/waitPageActivityEnd.js +123 -0
- package/esm/domain/waitPageActivityEnd.js.map +1 -0
- package/esm/domainContext.types.d.ts +39 -0
- package/esm/domainContext.types.js +5 -0
- package/esm/domainContext.types.js.map +1 -0
- package/esm/index.d.ts +41 -0
- package/esm/index.js +21 -0
- package/esm/index.js.map +1 -0
- package/esm/rawRumEvent.types.d.ts +326 -0
- package/esm/rawRumEvent.types.js +31 -0
- package/esm/rawRumEvent.types.js.map +1 -0
- package/esm/rumEvent.types.d.ts +2026 -0
- package/esm/rumEvent.types.js +6 -0
- package/esm/rumEvent.types.js.map +1 -0
- package/esm/transport/formDataTransport.d.ts +16 -0
- package/esm/transport/formDataTransport.js +43 -0
- package/esm/transport/formDataTransport.js.map +1 -0
- package/esm/transport/startRumBatch.d.ts +5 -0
- package/esm/transport/startRumBatch.js +30 -0
- package/esm/transport/startRumBatch.js.map +1 -0
- package/esm/transport/startRumEventBridge.d.ts +2 -0
- package/esm/transport/startRumEventBridge.js +8 -0
- package/esm/transport/startRumEventBridge.js.map +1 -0
- package/package.json +29 -0
- package/src/boot/preStartRum.ts +298 -0
- package/src/boot/rumPublicApi.ts +830 -0
- package/src/boot/startRum.ts +280 -0
- package/src/browser/cookieObservable.ts +63 -0
- package/src/browser/domMutationObservable.ts +98 -0
- package/src/browser/firstInputPolyfill.ts +87 -0
- package/src/browser/htmlDomUtils.ts +45 -0
- package/src/browser/locationChangeObservable.ts +69 -0
- package/src/browser/performanceObservable.ts +324 -0
- package/src/browser/performanceUtils.ts +50 -0
- package/src/browser/scroll.ts +25 -0
- package/src/browser/viewportObservable.ts +44 -0
- package/src/browser/windowOpenObservable.ts +7 -0
- package/src/domain/action/actionCollection.ts +146 -0
- package/src/domain/action/actionNameConstants.ts +20 -0
- package/src/domain/action/clickChain.ts +83 -0
- package/src/domain/action/computeFrustration.ts +77 -0
- package/src/domain/action/getActionNameFromElement.ts +337 -0
- package/src/domain/action/interactionSelectorCache.ts +21 -0
- package/src/domain/action/listenActionEvents.ts +119 -0
- package/src/domain/action/trackClickActions.ts +388 -0
- package/src/domain/assembly.ts +141 -0
- package/src/domain/configuration/configuration.ts +548 -0
- package/src/domain/configuration/index.ts +2 -0
- package/src/domain/configuration/jsonPathParser.ts +214 -0
- package/src/domain/configuration/remoteConfiguration.ts +304 -0
- package/src/domain/configuration/remoteConfiguration.types.ts +147 -0
- package/src/domain/contexts/ciVisibilityContext.ts +50 -0
- package/src/domain/contexts/connectivityContext.ts +12 -0
- package/src/domain/contexts/defaultContext.ts +43 -0
- package/src/domain/contexts/displayContext.ts +38 -0
- package/src/domain/contexts/featureFlagContext.ts +71 -0
- package/src/domain/contexts/internalContext.ts +34 -0
- package/src/domain/contexts/pageStateHistory.ts +171 -0
- package/src/domain/contexts/sessionContext.ts +59 -0
- package/src/domain/contexts/syntheticsContext.ts +33 -0
- package/src/domain/contexts/trackingConsentContext.ts +15 -0
- package/src/domain/contexts/urlContexts.ts +97 -0
- package/src/domain/contexts/userAgentDataContext.ts +36 -0
- package/src/domain/contexts/viewHistory.ts +70 -0
- package/src/domain/discardNegativeDuration.ts +6 -0
- package/src/domain/error/errorCollection.ts +107 -0
- package/src/domain/error/trackConsoleError.ts +14 -0
- package/src/domain/error/trackReportError.ts +16 -0
- package/src/domain/event/eventCollection.ts +53 -0
- package/src/domain/getSelectorFromElement.ts +268 -0
- package/src/domain/getSessionReplayUrl.ts +47 -0
- package/src/domain/hooks.ts +31 -0
- package/src/domain/lifeCycle.ts +103 -0
- package/src/domain/limitModification.ts +66 -0
- package/src/domain/longTask/longTaskCollection.ts +133 -0
- package/src/domain/plugins.ts +59 -0
- package/src/domain/privacy.ts +355 -0
- package/src/domain/privacyConstants.ts +43 -0
- package/src/domain/requestCollection.ts +179 -0
- package/src/domain/resource/graphql.ts +135 -0
- package/src/domain/resource/matchRequestResourceEntry.ts +68 -0
- package/src/domain/resource/requestRegistry.ts +52 -0
- package/src/domain/resource/resourceCollection.ts +273 -0
- package/src/domain/resource/resourceUtils.ts +355 -0
- package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +27 -0
- package/src/domain/rumSessionManager.ts +134 -0
- package/src/domain/sampler/sampler.ts +63 -0
- package/src/domain/startCustomerDataTelemetry.ts +83 -0
- package/src/domain/tracing/getDocumentTraceId.ts +90 -0
- package/src/domain/tracing/identifier.ts +69 -0
- package/src/domain/tracing/sampler.ts +69 -0
- package/src/domain/tracing/tracer.ts +248 -0
- package/src/domain/tracing/tracer.types.ts +13 -0
- package/src/domain/trackEventCounts.ts +67 -0
- package/src/domain/view/bfCacheSupport.ts +20 -0
- package/src/domain/view/trackViewEventCounts.ts +15 -0
- package/src/domain/view/trackViews.ts +431 -0
- package/src/domain/view/viewCollection.ts +203 -0
- package/src/domain/view/viewMetrics/getClsAttributionImpactedArea.ts +34 -0
- package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +55 -0
- package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +70 -0
- package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +20 -0
- package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +78 -0
- package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +180 -0
- package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +47 -0
- package/src/domain/view/viewMetrics/trackFirstHidden.ts +53 -0
- package/src/domain/view/viewMetrics/trackFirstInput.ts +59 -0
- package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +66 -0
- package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +193 -0
- package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +87 -0
- package/src/domain/view/viewMetrics/trackLoadingTime.ts +69 -0
- package/src/domain/view/viewMetrics/trackNavigationTimings.ts +66 -0
- package/src/domain/view/viewMetrics/trackScrollMetrics.ts +119 -0
- package/src/domain/vital/vitalCollection.ts +207 -0
- package/src/domain/waitPageActivityEnd.ts +189 -0
- package/src/domainContext.types.ts +61 -0
- package/src/index.ts +76 -0
- package/src/rawRumEvent.types.ts +409 -0
- package/src/rumEvent.types.ts +2151 -0
- package/src/transport/formDataTransport.ts +85 -0
- package/src/transport/startRumBatch.ts +46 -0
- package/src/transport/startRumEventBridge.ts +12 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { getTimeZone, DISCARDED, isEmptyObject, mapValues, toServerDuration } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import { discardNegativeDuration } from '../discardNegativeDuration';
|
|
3
|
+
import { RumEventType } from '../../rawRumEvent.types';
|
|
4
|
+
import { trackViews } from './trackViews';
|
|
5
|
+
export function startViewCollection(lifeCycle, hooks, configuration, location, domMutationObservable, pageOpenObservable, locationChangeObservable, recorderApi, viewHistory, initialViewOptions) {
|
|
6
|
+
lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_UPDATED */, (view) => lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processViewUpdate(view, configuration, recorderApi)));
|
|
7
|
+
hooks.register(0 /* HookNames.Assemble */, ({ startTime, eventType }) => {
|
|
8
|
+
const view = viewHistory.findView(startTime);
|
|
9
|
+
if (!view) {
|
|
10
|
+
return DISCARDED;
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
type: eventType,
|
|
14
|
+
service: view.service,
|
|
15
|
+
version: view.version,
|
|
16
|
+
context: view.context,
|
|
17
|
+
view: {
|
|
18
|
+
id: view.id,
|
|
19
|
+
name: view.name,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
hooks.register(1 /* HookNames.AssembleTelemetry */, ({ startTime }) => {
|
|
24
|
+
var _a;
|
|
25
|
+
return ({
|
|
26
|
+
view: {
|
|
27
|
+
id: (_a = viewHistory.findView(startTime)) === null || _a === void 0 ? void 0 : _a.id,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
return trackViews(location, lifeCycle, domMutationObservable, pageOpenObservable, configuration, locationChangeObservable, !configuration.trackViewsManually, initialViewOptions);
|
|
32
|
+
}
|
|
33
|
+
function processViewUpdate(view, configuration, recorderApi) {
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
35
|
+
const replayStats = recorderApi.getReplayStats(view.id);
|
|
36
|
+
const clsDevicePixelRatio = (_b = (_a = view.commonViewMetrics) === null || _a === void 0 ? void 0 : _a.cumulativeLayoutShift) === null || _b === void 0 ? void 0 : _b.devicePixelRatio;
|
|
37
|
+
const viewEvent = {
|
|
38
|
+
_kubesense: {
|
|
39
|
+
document_version: view.documentVersion,
|
|
40
|
+
replay_stats: replayStats,
|
|
41
|
+
cls: clsDevicePixelRatio
|
|
42
|
+
? {
|
|
43
|
+
device_pixel_ratio: clsDevicePixelRatio,
|
|
44
|
+
}
|
|
45
|
+
: undefined,
|
|
46
|
+
configuration: {
|
|
47
|
+
start_session_replay_recording_manually: configuration.startSessionReplayRecordingManually,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
date: view.startClocks.timeStamp,
|
|
51
|
+
type: RumEventType.VIEW,
|
|
52
|
+
view: {
|
|
53
|
+
action: {
|
|
54
|
+
count: view.eventCounts.actionCount,
|
|
55
|
+
},
|
|
56
|
+
frustration: {
|
|
57
|
+
count: view.eventCounts.frustrationCount,
|
|
58
|
+
},
|
|
59
|
+
cumulative_layout_shift: (_c = view.commonViewMetrics.cumulativeLayoutShift) === null || _c === void 0 ? void 0 : _c.value,
|
|
60
|
+
cumulative_layout_shift_time: toServerDuration((_d = view.commonViewMetrics.cumulativeLayoutShift) === null || _d === void 0 ? void 0 : _d.time),
|
|
61
|
+
cumulative_layout_shift_target_selector: (_e = view.commonViewMetrics.cumulativeLayoutShift) === null || _e === void 0 ? void 0 : _e.targetSelector,
|
|
62
|
+
first_byte: toServerDuration((_f = view.initialViewMetrics.navigationTimings) === null || _f === void 0 ? void 0 : _f.firstByte),
|
|
63
|
+
dom_complete: toServerDuration((_g = view.initialViewMetrics.navigationTimings) === null || _g === void 0 ? void 0 : _g.domComplete),
|
|
64
|
+
dom_content_loaded: toServerDuration((_h = view.initialViewMetrics.navigationTimings) === null || _h === void 0 ? void 0 : _h.domContentLoaded),
|
|
65
|
+
dom_interactive: toServerDuration((_j = view.initialViewMetrics.navigationTimings) === null || _j === void 0 ? void 0 : _j.domInteractive),
|
|
66
|
+
error: {
|
|
67
|
+
count: view.eventCounts.errorCount,
|
|
68
|
+
},
|
|
69
|
+
first_contentful_paint: toServerDuration(view.initialViewMetrics.firstContentfulPaint),
|
|
70
|
+
first_input_delay: toServerDuration((_k = view.initialViewMetrics.firstInput) === null || _k === void 0 ? void 0 : _k.delay),
|
|
71
|
+
first_input_time: toServerDuration((_l = view.initialViewMetrics.firstInput) === null || _l === void 0 ? void 0 : _l.time),
|
|
72
|
+
first_input_target_selector: (_m = view.initialViewMetrics.firstInput) === null || _m === void 0 ? void 0 : _m.targetSelector,
|
|
73
|
+
interaction_to_next_paint: toServerDuration((_o = view.commonViewMetrics.interactionToNextPaint) === null || _o === void 0 ? void 0 : _o.value),
|
|
74
|
+
interaction_to_next_paint_time: toServerDuration((_p = view.commonViewMetrics.interactionToNextPaint) === null || _p === void 0 ? void 0 : _p.time),
|
|
75
|
+
interaction_to_next_paint_target_selector: (_q = view.commonViewMetrics.interactionToNextPaint) === null || _q === void 0 ? void 0 : _q.targetSelector,
|
|
76
|
+
is_active: view.isActive,
|
|
77
|
+
name: view.name,
|
|
78
|
+
largest_contentful_paint: toServerDuration((_r = view.initialViewMetrics.largestContentfulPaint) === null || _r === void 0 ? void 0 : _r.value),
|
|
79
|
+
largest_contentful_paint_target_selector: (_s = view.initialViewMetrics.largestContentfulPaint) === null || _s === void 0 ? void 0 : _s.targetSelector,
|
|
80
|
+
load_event: toServerDuration((_t = view.initialViewMetrics.navigationTimings) === null || _t === void 0 ? void 0 : _t.loadEvent),
|
|
81
|
+
loading_time: discardNegativeDuration(toServerDuration(view.commonViewMetrics.loadingTime)),
|
|
82
|
+
loading_type: view.loadingType,
|
|
83
|
+
long_task: {
|
|
84
|
+
count: view.eventCounts.longTaskCount,
|
|
85
|
+
},
|
|
86
|
+
performance: computeViewPerformanceData(view.commonViewMetrics, view.initialViewMetrics),
|
|
87
|
+
resource: {
|
|
88
|
+
count: view.eventCounts.resourceCount,
|
|
89
|
+
},
|
|
90
|
+
time_spent: toServerDuration(view.duration),
|
|
91
|
+
},
|
|
92
|
+
display: view.commonViewMetrics.scroll
|
|
93
|
+
? {
|
|
94
|
+
scroll: {
|
|
95
|
+
max_depth: view.commonViewMetrics.scroll.maxDepth,
|
|
96
|
+
max_depth_scroll_top: view.commonViewMetrics.scroll.maxDepthScrollTop,
|
|
97
|
+
max_scroll_height: view.commonViewMetrics.scroll.maxScrollHeight,
|
|
98
|
+
max_scroll_height_time: toServerDuration(view.commonViewMetrics.scroll.maxScrollHeightTime),
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
: undefined,
|
|
102
|
+
privacy: {
|
|
103
|
+
replay_level: configuration.defaultPrivacyLevel,
|
|
104
|
+
},
|
|
105
|
+
device: {
|
|
106
|
+
locale: navigator.language,
|
|
107
|
+
locales: navigator.languages,
|
|
108
|
+
time_zone: getTimeZone(),
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
if (!isEmptyObject(view.customTimings)) {
|
|
112
|
+
viewEvent.view.custom_timings = mapValues(view.customTimings, toServerDuration);
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
rawRumEvent: viewEvent,
|
|
116
|
+
startTime: view.startClocks.relative,
|
|
117
|
+
duration: view.duration,
|
|
118
|
+
domainContext: {
|
|
119
|
+
location: view.location,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function computeViewPerformanceData({ cumulativeLayoutShift, interactionToNextPaint }, { firstContentfulPaint, firstInput, largestContentfulPaint }) {
|
|
124
|
+
return {
|
|
125
|
+
cls: cumulativeLayoutShift && {
|
|
126
|
+
score: cumulativeLayoutShift.value,
|
|
127
|
+
timestamp: toServerDuration(cumulativeLayoutShift.time),
|
|
128
|
+
target_selector: cumulativeLayoutShift.targetSelector,
|
|
129
|
+
previous_rect: cumulativeLayoutShift.previousRect,
|
|
130
|
+
current_rect: cumulativeLayoutShift.currentRect,
|
|
131
|
+
},
|
|
132
|
+
fcp: firstContentfulPaint && { timestamp: toServerDuration(firstContentfulPaint) },
|
|
133
|
+
fid: firstInput && {
|
|
134
|
+
duration: toServerDuration(firstInput.delay),
|
|
135
|
+
timestamp: toServerDuration(firstInput.time),
|
|
136
|
+
target_selector: firstInput.targetSelector,
|
|
137
|
+
},
|
|
138
|
+
inp: interactionToNextPaint && {
|
|
139
|
+
duration: toServerDuration(interactionToNextPaint.value),
|
|
140
|
+
timestamp: toServerDuration(interactionToNextPaint.time),
|
|
141
|
+
target_selector: interactionToNextPaint.targetSelector,
|
|
142
|
+
},
|
|
143
|
+
lcp: largestContentfulPaint && {
|
|
144
|
+
timestamp: toServerDuration(largestContentfulPaint.value),
|
|
145
|
+
target_selector: largestContentfulPaint.targetSelector,
|
|
146
|
+
resource_url: largestContentfulPaint.resourceUrl,
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=viewCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewCollection.js","sourceRoot":"","sources":["../../../src/domain/view/viewCollection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAa,aAAa,EAAE,SAAS,EAAE,gBAAgB,EA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Ac;YACtD,YAAY,EAAE,sBAAsB,CAAC,WAAW;SACjD;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RumLayoutShiftAttribution } from '../../../browser/performanceObservable';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the total impacted area of a layout shift source
|
|
4
|
+
* This is the sum of the previous and current areas minus their intersection
|
|
5
|
+
*/
|
|
6
|
+
export declare const getClsAttributionImpactedArea: (source: RumLayoutShiftAttribution) => number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the area of a rectangle given its width and height
|
|
3
|
+
*/
|
|
4
|
+
const calculateArea = (width, height) => width * height;
|
|
5
|
+
/**
|
|
6
|
+
* Calculates the intersection area between two rectangles
|
|
7
|
+
*/
|
|
8
|
+
const calculateIntersectionArea = (rect1, rect2) => {
|
|
9
|
+
const left = Math.max(rect1.left, rect2.left);
|
|
10
|
+
const top = Math.max(rect1.top, rect2.top);
|
|
11
|
+
const right = Math.min(rect1.right, rect2.right);
|
|
12
|
+
const bottom = Math.min(rect1.bottom, rect2.bottom);
|
|
13
|
+
if (left >= right || top >= bottom) {
|
|
14
|
+
return 0;
|
|
15
|
+
}
|
|
16
|
+
return calculateArea(right - left, bottom - top);
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Calculates the total impacted area of a layout shift source
|
|
20
|
+
* This is the sum of the previous and current areas minus their intersection
|
|
21
|
+
*/
|
|
22
|
+
export const getClsAttributionImpactedArea = (source) => {
|
|
23
|
+
const previousArea = calculateArea(source.previousRect.width, source.previousRect.height);
|
|
24
|
+
const currentArea = calculateArea(source.currentRect.width, source.currentRect.height);
|
|
25
|
+
const intersectionArea = calculateIntersectionArea(source.previousRect, source.currentRect);
|
|
26
|
+
return previousArea + currentArea - intersectionArea;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=getClsAttributionImpactedArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getClsAttributionImpactedArea.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/getClsAttributionImpactedArea.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,MAAc,EAAU,EAAE,CAAC,KAAK,GAAG,MAAM,CAAA;AAE/E;;GAEG;AACH,MAAM,yBAAyB,GAAG,CAAC,KAAsB,EAAE,KAAsB,EAAU,EAAE;IAC3F,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;IAC7C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAEnD,IAAI,IAAI,IAAI,KAAK,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;QACnC,OAAO,CAAC,CAAA;IACV,CAAC;IAED,OAAO,aAAa,CAAC,KAAK,GAAG,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,CAAA;AAClD,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,MAAiC,EAAU,EAAE;IACzF,MAAM,YAAY,GAAG,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IACzF,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IACtF,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAA;IAE3F,OAAO,YAAY,GAAG,WAAW,GAAG,gBAAgB,CAAA;AACtD,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* performance.interactionCount polyfill
|
|
3
|
+
*
|
|
4
|
+
* The interactionCount is an integer which counts the total number of distinct user interactions,
|
|
5
|
+
* for which there was a unique interactionId.
|
|
6
|
+
*
|
|
7
|
+
* The interactionCount polyfill is an estimate based on a convention specific to Chrome. Cf: https://github.com/GoogleChrome/web-vitals/pull/213
|
|
8
|
+
* This is currently not an issue as the polyfill is only used for INP which is currently only supported on Chrome.
|
|
9
|
+
* Hopefully when/if other browsers will support INP, they will also implement performance.interactionCount at the same time, so we won't need that polyfill.
|
|
10
|
+
*
|
|
11
|
+
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/main/src/lib/polyfills/interactionCountPolyfill.ts
|
|
12
|
+
*/
|
|
13
|
+
export declare function initInteractionCountPolyfill(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the `interactionCount` value using the native API (if available)
|
|
16
|
+
* or the polyfill estimate in this module.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getInteractionCount: () => number;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* performance.interactionCount polyfill
|
|
3
|
+
*
|
|
4
|
+
* The interactionCount is an integer which counts the total number of distinct user interactions,
|
|
5
|
+
* for which there was a unique interactionId.
|
|
6
|
+
*
|
|
7
|
+
* The interactionCount polyfill is an estimate based on a convention specific to Chrome. Cf: https://github.com/GoogleChrome/web-vitals/pull/213
|
|
8
|
+
* This is currently not an issue as the polyfill is only used for INP which is currently only supported on Chrome.
|
|
9
|
+
* Hopefully when/if other browsers will support INP, they will also implement performance.interactionCount at the same time, so we won't need that polyfill.
|
|
10
|
+
*
|
|
11
|
+
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/main/src/lib/polyfills/interactionCountPolyfill.ts
|
|
12
|
+
*/
|
|
13
|
+
import { monitor } from '@kubesense/kubesense-browser-core';
|
|
14
|
+
let observer;
|
|
15
|
+
let interactionCountEstimate = 0;
|
|
16
|
+
let minKnownInteractionId = Infinity;
|
|
17
|
+
let maxKnownInteractionId = 0;
|
|
18
|
+
export function initInteractionCountPolyfill() {
|
|
19
|
+
if ('interactionCount' in performance || observer) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
observer = new window.PerformanceObserver(monitor((entries) => {
|
|
23
|
+
entries.getEntries().forEach((e) => {
|
|
24
|
+
const entry = e;
|
|
25
|
+
if (entry.interactionId) {
|
|
26
|
+
minKnownInteractionId = Math.min(minKnownInteractionId, entry.interactionId);
|
|
27
|
+
maxKnownInteractionId = Math.max(maxKnownInteractionId, entry.interactionId);
|
|
28
|
+
interactionCountEstimate = (maxKnownInteractionId - minKnownInteractionId) / 7 + 1;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}));
|
|
32
|
+
observer.observe({ type: 'event', buffered: true, durationThreshold: 0 });
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Returns the `interactionCount` value using the native API (if available)
|
|
36
|
+
* or the polyfill estimate in this module.
|
|
37
|
+
*/
|
|
38
|
+
export const getInteractionCount = () => observer ? interactionCountEstimate : window.performance.interactionCount || 0;
|
|
39
|
+
//# sourceMappingURL=interactionCountPolyfill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactionCountPolyfill.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/interactionCountPolyfill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAO3D,IAAI,QAA4C,CAAA;AAEhD,IAAI,wBAAwB,GAAG,CAAC,CAAA;AAChC,IAAI,qBAAqB,GAAG,QAAQ,CAAA;AACpC,IAAI,qBAAqB,GAAG,CAAC,CAAA;AAE7B,MAAM,UAAU,4BAA4B;IAC1C,IAAI,kBAAkB,IAAI,WAAW,IAAI,QAAQ,EAAE,CAAC;QAClD,OAAM;IACR,CAAC;IAED,QAAQ,GAAG,IAAK,MAAwB,CAAC,mBAAmB,CAC1D,OAAO,CAAC,CAAC,OAAqC,EAAE,EAAE;QAChD,OAAO,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,CAAyC,CAAA;YAEvD,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;gBACxB,qBAAqB,GAAG,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;gBAC5E,qBAAqB,GAAG,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;gBAE5E,wBAAwB,GAAG,CAAC,qBAAqB,GAAG,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YACpF,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CACH,CAAA;IAED,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAA;AAC3E,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CACtC,QAAQ,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAE,MAAwB,CAAC,WAAW,CAAC,gBAAiB,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Telemetry } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import { noop } from '@kubesense/kubesense-browser-core';
|
|
3
|
+
import type { LifeCycle } from '../../lifeCycle';
|
|
4
|
+
export declare function startInitialViewMetricsTelemetry(lifeCycle: LifeCycle, telemetry: Telemetry): {
|
|
5
|
+
stop: typeof noop;
|
|
6
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { addTelemetryMetrics, noop } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
export function startInitialViewMetricsTelemetry(lifeCycle, telemetry) {
|
|
3
|
+
if (!telemetry.metricsEnabled) {
|
|
4
|
+
return { stop: noop };
|
|
5
|
+
}
|
|
6
|
+
const { unsubscribe } = lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_UPDATED */, ({ initialViewMetrics }) => {
|
|
7
|
+
if (!initialViewMetrics.largestContentfulPaint || !initialViewMetrics.navigationTimings) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
// The navigation timings become available shortly after the load event fires, so
|
|
11
|
+
// we're snapshotting the LCP value available at that point. However, more LCP values
|
|
12
|
+
// can be emitted until the page is scrolled or interacted with, so it's possible that
|
|
13
|
+
// the final LCP value may differ. These metrics are intended to help diagnose
|
|
14
|
+
// performance issues early in the page load process, and using LCP-at-page-load is a
|
|
15
|
+
// good fit for that use case, but it's important to be aware that this is not
|
|
16
|
+
// necessarily equivalent to the normal LCP metric.
|
|
17
|
+
// monitor-until: 2026-07-01
|
|
18
|
+
addTelemetryMetrics("Initial view metrics" /* TelemetryMetrics.INITIAL_VIEW_METRICS_TELEMETRY_NAME */, {
|
|
19
|
+
metrics: createCoreInitialViewMetrics(initialViewMetrics.largestContentfulPaint, initialViewMetrics.navigationTimings),
|
|
20
|
+
});
|
|
21
|
+
unsubscribe();
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
stop: unsubscribe,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function createCoreInitialViewMetrics(lcp, navigation) {
|
|
28
|
+
return {
|
|
29
|
+
lcp: {
|
|
30
|
+
value: lcp.value,
|
|
31
|
+
},
|
|
32
|
+
navigation: {
|
|
33
|
+
domComplete: navigation.domComplete,
|
|
34
|
+
domContentLoaded: navigation.domContentLoaded,
|
|
35
|
+
domInteractive: navigation.domInteractive,
|
|
36
|
+
firstByte: navigation.firstByte,
|
|
37
|
+
loadEvent: navigation.loadEvent,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=startInitialViewMetricsTelemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startInitialViewMetricsTelemetry.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAoB,MAAM,mCAAmC,CAAA;AAmB/F,MAAM,UAAU,gCAAgC,CAAC,SAAoB,EAAE,SAAoB;IACzF,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IACvB,CAAC;IAED,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,SAAS,0CAAkC,CAAC,EAAE,kBAAkB,EAAE,EAAE,EAAE;QACtG,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,CAAC;YACxF,OAAM;QACR,CAAC;QAED,iFAAiF;QACjF,qFAAqF;QACrF,sFAAsF;QACtF,8EAA8E;QAC9E,qFAAqF;QACrF,8EAA8E;QAC9E,mDAAmD;QACnD,4BAA4B;QAC5B,mBAAmB,oFAAuD;YACxE,OAAO,EAAE,4BAA4B,CACnC,kBAAkB,CAAC,sBAAsB,EACzC,kBAAkB,CAAC,iBAAiB,CACrC;SACF,CAAC,CAAA;QAEF,WAAW,EAAE,CAAA;IACf,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,IAAI,EAAE,WAAW;KAClB,CAAA;AACH,CAAC;AAED,SAAS,4BAA4B,CACnC,GAA2B,EAC3B,UAA6B;IAE7B,OAAO;QACL,GAAG,EAAE;YACH,KAAK,EAAE,GAAG,CAAC,KAAK;SACjB;QACD,UAAU,EAAE;YACV,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;YAC7C,cAAc,EAAE,UAAU,CAAC,cAAc;YACzC,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,SAAS,EAAE,UAAU,CAAC,SAAS;SAChC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ClocksState } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { InitialViewMetrics } from './trackInitialViewMetrics';
|
|
3
|
+
/**
|
|
4
|
+
* BFCache keeps a full in-memory snapshot of the DOM. When the page is restored, nothing needs to be fetched, so the whole
|
|
5
|
+
* viewport repaints in a single frame. Consequently, LCP almost always equals FCP.
|
|
6
|
+
* (See: https://github.com/GoogleChrome/web-vitals/pull/87)
|
|
7
|
+
*/
|
|
8
|
+
export declare function trackBfcacheMetrics(viewStart: ClocksState, metrics: InitialViewMetrics, scheduleViewUpdate: () => void): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { trackRestoredFirstContentfulPaint } from './trackFirstContentfulPaint';
|
|
2
|
+
/**
|
|
3
|
+
* BFCache keeps a full in-memory snapshot of the DOM. When the page is restored, nothing needs to be fetched, so the whole
|
|
4
|
+
* viewport repaints in a single frame. Consequently, LCP almost always equals FCP.
|
|
5
|
+
* (See: https://github.com/GoogleChrome/web-vitals/pull/87)
|
|
6
|
+
*/
|
|
7
|
+
export function trackBfcacheMetrics(viewStart, metrics, scheduleViewUpdate) {
|
|
8
|
+
trackRestoredFirstContentfulPaint(viewStart.relative, (paintTime) => {
|
|
9
|
+
metrics.firstContentfulPaint = paintTime;
|
|
10
|
+
metrics.largestContentfulPaint = { value: paintTime };
|
|
11
|
+
scheduleViewUpdate();
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=trackBfcacheMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackBfcacheMetrics.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackBfcacheMetrics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAA;AAE/E;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAsB,EACtB,OAA2B,EAC3B,kBAA8B;IAE9B,iCAAiC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;QAClE,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAA;QACxC,OAAO,CAAC,sBAAsB,GAAG,EAAE,KAAK,EAAE,SAAyB,EAAE,CAAA;QACrE,kBAAkB,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ClocksState, Duration, Observable } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { ViewLoadingType } from '../../../rawRumEvent.types';
|
|
3
|
+
import type { RumConfiguration } from '../../configuration';
|
|
4
|
+
import type { LifeCycle } from '../../lifeCycle';
|
|
5
|
+
import type { RumMutationRecord } from '../../../browser/domMutationObservable';
|
|
6
|
+
import type { CumulativeLayoutShift } from './trackCumulativeLayoutShift';
|
|
7
|
+
import type { InteractionToNextPaint } from './trackInteractionToNextPaint';
|
|
8
|
+
import type { ScrollMetrics } from './trackScrollMetrics';
|
|
9
|
+
export interface CommonViewMetrics {
|
|
10
|
+
loadingTime?: Duration;
|
|
11
|
+
cumulativeLayoutShift?: CumulativeLayoutShift;
|
|
12
|
+
interactionToNextPaint?: InteractionToNextPaint;
|
|
13
|
+
scroll?: ScrollMetrics;
|
|
14
|
+
}
|
|
15
|
+
export declare function trackCommonViewMetrics(lifeCycle: LifeCycle, domMutationObservable: Observable<RumMutationRecord[]>, windowOpenObservable: Observable<void>, configuration: RumConfiguration, scheduleViewUpdate: () => void, loadingType: ViewLoadingType, viewStart: ClocksState): {
|
|
16
|
+
stop: () => void;
|
|
17
|
+
stopINPTracking: () => void;
|
|
18
|
+
setLoadEvent: (loadEvent: Duration) => void;
|
|
19
|
+
setViewEnd: (viewEndTime: import("@kubesense/kubesense-browser-core").RelativeTime) => void;
|
|
20
|
+
getCommonViewMetrics: () => CommonViewMetrics;
|
|
21
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { trackCumulativeLayoutShift } from './trackCumulativeLayoutShift';
|
|
2
|
+
import { trackInteractionToNextPaint } from './trackInteractionToNextPaint';
|
|
3
|
+
import { trackLoadingTime } from './trackLoadingTime';
|
|
4
|
+
import { trackScrollMetrics } from './trackScrollMetrics';
|
|
5
|
+
export function trackCommonViewMetrics(lifeCycle, domMutationObservable, windowOpenObservable, configuration, scheduleViewUpdate, loadingType, viewStart) {
|
|
6
|
+
const commonViewMetrics = {};
|
|
7
|
+
const { stop: stopLoadingTimeTracking, setLoadEvent } = trackLoadingTime(lifeCycle, domMutationObservable, windowOpenObservable, configuration, loadingType, viewStart, (newLoadingTime) => {
|
|
8
|
+
commonViewMetrics.loadingTime = newLoadingTime;
|
|
9
|
+
scheduleViewUpdate();
|
|
10
|
+
});
|
|
11
|
+
const { stop: stopScrollMetricsTracking } = trackScrollMetrics(configuration, viewStart, (newScrollMetrics) => {
|
|
12
|
+
commonViewMetrics.scroll = newScrollMetrics;
|
|
13
|
+
});
|
|
14
|
+
const { stop: stopCLSTracking } = trackCumulativeLayoutShift(configuration, viewStart.relative, (cumulativeLayoutShift) => {
|
|
15
|
+
commonViewMetrics.cumulativeLayoutShift = cumulativeLayoutShift;
|
|
16
|
+
scheduleViewUpdate();
|
|
17
|
+
});
|
|
18
|
+
const { stop: stopINPTracking, getInteractionToNextPaint, setViewEnd, } = trackInteractionToNextPaint(configuration, viewStart.relative, loadingType);
|
|
19
|
+
return {
|
|
20
|
+
stop: () => {
|
|
21
|
+
stopLoadingTimeTracking();
|
|
22
|
+
stopCLSTracking();
|
|
23
|
+
stopScrollMetricsTracking();
|
|
24
|
+
},
|
|
25
|
+
stopINPTracking,
|
|
26
|
+
setLoadEvent,
|
|
27
|
+
setViewEnd,
|
|
28
|
+
getCommonViewMetrics: () => {
|
|
29
|
+
commonViewMetrics.interactionToNextPaint = getInteractionToNextPaint();
|
|
30
|
+
return commonViewMetrics;
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=trackCommonViewMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackCommonViewMetrics.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackCommonViewMetrics.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AASzD,MAAM,UAAU,sBAAsB,CACpC,SAAoB,EACpB,qBAAsD,EACtD,oBAAsC,EACtC,aAA+B,EAC/B,kBAA8B,EAC9B,WAA4B,EAC5B,SAAsB;IAEtB,MAAM,iBAAiB,GAAsB,EAAE,CAAA;IAE/C,MAAM,EAAE,IAAI,EAAE,uBAAuB,EAAE,YAAY,EAAE,GAAG,gBAAgB,CACtE,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,SAAS,EACT,CAAC,cAAc,EAAE,EAAE;QACjB,iBAAiB,CAAC,WAAW,GAAG,cAAc,CAAA;QAC9C,kBAAkB,EAAE,CAAA;IACtB,CAAC,CACF,CAAA;IAED,MAAM,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,kBAAkB,CAAC,aAAa,EAAE,SAAS,EAAE,CAAC,gBAAgB,EAAE,EAAE;QAC5G,iBAAiB,CAAC,MAAM,GAAG,gBAAgB,CAAA;IAC7C,CAAC,CAAC,CAAA;IAEF,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,0BAA0B,CAC1D,aAAa,EACb,SAAS,CAAC,QAAQ,EAClB,CAAC,qBAAqB,EAAE,EAAE;QACxB,iBAAiB,CAAC,qBAAqB,GAAG,qBAAqB,CAAA;QAC/D,kBAAkB,EAAE,CAAA;IACtB,CAAC,CACF,CAAA;IAED,MAAM,EACJ,IAAI,EAAE,eAAe,EACrB,yBAAyB,EACzB,UAAU,GACX,GAAG,2BAA2B,CAAC,aAAa,EAAE,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;IAE/E,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,uBAAuB,EAAE,CAAA;YACzB,eAAe,EAAE,CAAA;YACjB,yBAAyB,EAAE,CAAA;QAC7B,CAAC;QACD,eAAe;QACf,YAAY;QACZ,UAAU;QACV,oBAAoB,EAAE,GAAG,EAAE;YACzB,iBAAiB,CAAC,sBAAsB,GAAG,yBAAyB,EAAE,CAAA;YACtE,OAAO,iBAAiB,CAAA;QAC1B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { noop } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { Duration, RelativeTime } from '@kubesense/kubesense-browser-core';
|
|
3
|
+
import type { RumConfiguration } from '../../configuration';
|
|
4
|
+
import type { RumRect } from '../../../rumEvent.types';
|
|
5
|
+
export interface CumulativeLayoutShift {
|
|
6
|
+
value: number;
|
|
7
|
+
targetSelector?: string;
|
|
8
|
+
time?: Duration;
|
|
9
|
+
previousRect?: RumRect;
|
|
10
|
+
currentRect?: RumRect;
|
|
11
|
+
devicePixelRatio?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Track the cumulative layout shifts (CLS).
|
|
15
|
+
* Layout shifts are grouped into session windows.
|
|
16
|
+
* The minimum gap between session windows is 1 second.
|
|
17
|
+
* The maximum duration of a session window is 5 second.
|
|
18
|
+
* The session window layout shift value is the sum of layout shifts inside it.
|
|
19
|
+
* The CLS value is the max of session windows values.
|
|
20
|
+
*
|
|
21
|
+
* This yields a new value whenever the CLS value is updated (a higher session window value is computed).
|
|
22
|
+
*
|
|
23
|
+
* See isLayoutShiftSupported to check for browser support.
|
|
24
|
+
*
|
|
25
|
+
* Documentation:
|
|
26
|
+
* https://web.dev/cls/
|
|
27
|
+
* https://web.dev/evolving-cls/
|
|
28
|
+
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/getCLS.ts
|
|
29
|
+
*/
|
|
30
|
+
export declare function trackCumulativeLayoutShift(configuration: RumConfiguration, viewStart: RelativeTime, callback: (cumulativeLayoutShift: CumulativeLayoutShift) => void): {
|
|
31
|
+
stop: typeof noop;
|
|
32
|
+
};
|
|
33
|
+
export declare const MAX_WINDOW_DURATION: number;
|
|
34
|
+
/**
|
|
35
|
+
* Check whether `layout-shift` is supported by the browser.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isLayoutShiftSupported(): boolean;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { round, ONE_SECOND, noop, elapsed } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import { isElementNode } from '../../../browser/htmlDomUtils';
|
|
3
|
+
import { supportPerformanceTimingEvent, RumPerformanceEntryType, createPerformanceObservable, } from '../../../browser/performanceObservable';
|
|
4
|
+
import { getSelectorFromElement } from '../../getSelectorFromElement';
|
|
5
|
+
import { getClsAttributionImpactedArea } from './getClsAttributionImpactedArea';
|
|
6
|
+
/**
|
|
7
|
+
* Track the cumulative layout shifts (CLS).
|
|
8
|
+
* Layout shifts are grouped into session windows.
|
|
9
|
+
* The minimum gap between session windows is 1 second.
|
|
10
|
+
* The maximum duration of a session window is 5 second.
|
|
11
|
+
* The session window layout shift value is the sum of layout shifts inside it.
|
|
12
|
+
* The CLS value is the max of session windows values.
|
|
13
|
+
*
|
|
14
|
+
* This yields a new value whenever the CLS value is updated (a higher session window value is computed).
|
|
15
|
+
*
|
|
16
|
+
* See isLayoutShiftSupported to check for browser support.
|
|
17
|
+
*
|
|
18
|
+
* Documentation:
|
|
19
|
+
* https://web.dev/cls/
|
|
20
|
+
* https://web.dev/evolving-cls/
|
|
21
|
+
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/getCLS.ts
|
|
22
|
+
*/
|
|
23
|
+
export function trackCumulativeLayoutShift(configuration, viewStart, callback) {
|
|
24
|
+
if (!isLayoutShiftSupported()) {
|
|
25
|
+
return {
|
|
26
|
+
stop: noop,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
let maxClsValue = 0;
|
|
30
|
+
let biggestShift;
|
|
31
|
+
// if no layout shift happen the value should be reported as 0
|
|
32
|
+
callback({
|
|
33
|
+
value: 0,
|
|
34
|
+
});
|
|
35
|
+
const slidingWindow = slidingSessionWindow();
|
|
36
|
+
const performanceSubscription = createPerformanceObservable(configuration, {
|
|
37
|
+
type: RumPerformanceEntryType.LAYOUT_SHIFT,
|
|
38
|
+
buffered: true,
|
|
39
|
+
}).subscribe((entries) => {
|
|
40
|
+
var _a;
|
|
41
|
+
for (const entry of entries) {
|
|
42
|
+
if (entry.hadRecentInput || entry.startTime < viewStart) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const { cumulatedValue, isMaxValue } = slidingWindow.update(entry);
|
|
46
|
+
if (isMaxValue) {
|
|
47
|
+
const attribution = getTopImpactedElement(entry.sources);
|
|
48
|
+
biggestShift = {
|
|
49
|
+
target: (attribution === null || attribution === void 0 ? void 0 : attribution.node) ? new WeakRef(attribution.node) : undefined,
|
|
50
|
+
time: elapsed(viewStart, entry.startTime),
|
|
51
|
+
previousRect: attribution === null || attribution === void 0 ? void 0 : attribution.previousRect,
|
|
52
|
+
currentRect: attribution === null || attribution === void 0 ? void 0 : attribution.currentRect,
|
|
53
|
+
devicePixelRatio: window.devicePixelRatio,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (cumulatedValue > maxClsValue) {
|
|
57
|
+
maxClsValue = cumulatedValue;
|
|
58
|
+
const target = (_a = biggestShift === null || biggestShift === void 0 ? void 0 : biggestShift.target) === null || _a === void 0 ? void 0 : _a.deref();
|
|
59
|
+
callback({
|
|
60
|
+
value: round(maxClsValue, 4),
|
|
61
|
+
targetSelector: target && getSelectorFromElement(target, configuration.actionNameAttribute),
|
|
62
|
+
time: biggestShift === null || biggestShift === void 0 ? void 0 : biggestShift.time,
|
|
63
|
+
previousRect: (biggestShift === null || biggestShift === void 0 ? void 0 : biggestShift.previousRect) ? asRumRect(biggestShift.previousRect) : undefined,
|
|
64
|
+
currentRect: (biggestShift === null || biggestShift === void 0 ? void 0 : biggestShift.currentRect) ? asRumRect(biggestShift.currentRect) : undefined,
|
|
65
|
+
devicePixelRatio: biggestShift === null || biggestShift === void 0 ? void 0 : biggestShift.devicePixelRatio,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
stop: () => {
|
|
72
|
+
performanceSubscription.unsubscribe();
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function getTopImpactedElement(sources) {
|
|
77
|
+
let topImpactedSource;
|
|
78
|
+
for (const source of sources) {
|
|
79
|
+
if (source.node && isElementNode(source.node)) {
|
|
80
|
+
const currentImpactedArea = getClsAttributionImpactedArea(source);
|
|
81
|
+
if (!topImpactedSource || getClsAttributionImpactedArea(topImpactedSource) < currentImpactedArea) {
|
|
82
|
+
topImpactedSource = source;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return topImpactedSource;
|
|
87
|
+
}
|
|
88
|
+
function asRumRect({ x, y, width, height }) {
|
|
89
|
+
return { x, y, width, height };
|
|
90
|
+
}
|
|
91
|
+
export const MAX_WINDOW_DURATION = 5 * ONE_SECOND;
|
|
92
|
+
const MAX_UPDATE_GAP = ONE_SECOND;
|
|
93
|
+
function slidingSessionWindow() {
|
|
94
|
+
let cumulatedValue = 0;
|
|
95
|
+
let startTime;
|
|
96
|
+
let endTime;
|
|
97
|
+
let maxValue = 0;
|
|
98
|
+
return {
|
|
99
|
+
update: (entry) => {
|
|
100
|
+
const shouldCreateNewWindow = startTime === undefined ||
|
|
101
|
+
entry.startTime - endTime >= MAX_UPDATE_GAP ||
|
|
102
|
+
entry.startTime - startTime >= MAX_WINDOW_DURATION;
|
|
103
|
+
let isMaxValue;
|
|
104
|
+
if (shouldCreateNewWindow) {
|
|
105
|
+
startTime = endTime = entry.startTime;
|
|
106
|
+
maxValue = cumulatedValue = entry.value;
|
|
107
|
+
isMaxValue = true;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
cumulatedValue += entry.value;
|
|
111
|
+
endTime = entry.startTime;
|
|
112
|
+
isMaxValue = entry.value > maxValue;
|
|
113
|
+
if (isMaxValue) {
|
|
114
|
+
maxValue = entry.value;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
cumulatedValue,
|
|
119
|
+
isMaxValue,
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Check whether `layout-shift` is supported by the browser.
|
|
126
|
+
*/
|
|
127
|
+
export function isLayoutShiftSupported() {
|
|
128
|
+
return supportPerformanceTimingEvent(RumPerformanceEntryType.LAYOUT_SHIFT) && 'WeakRef' in window;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=trackCumulativeLayoutShift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackCumulativeLayoutShift.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAEpF,OAAO,EAA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QAAQ,GAAG,cAAc,GAAG,KAAK,CAAC,KAAK,CAAA;gBACvC,UAAU,GAAG,IAAI,CAAA;YACnB,CAAC;iBAAM,CAAC;gBACN,cAAc,IAAI,KAAK,CAAC,KAAK,CAAA;gBAC7B,OAAO,GAAG,KAAK,CAAC,SAAS,CAAA;gBACzB,UAAU,GAAG,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAA;gBAEnC,IAAI,UAAU,EAAE,CAAC;oBACf,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAA;gBACxB,CAAC;YACH,CAAC;YAED,OAAO;gBACL,cAAc;gBACd,UAAU;aACX,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,6BAA6B,CAAC,uBAAuB,CAAC,YAAY,CAAC,IAAI,SAAS,IAAI,MAAM,CAAA;AACnG,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Duration, RelativeTime } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { RumConfiguration } from '../../configuration';
|
|
3
|
+
import type { FirstHidden } from './trackFirstHidden';
|
|
4
|
+
export declare const FCP_MAXIMUM_DELAY: number;
|
|
5
|
+
export declare function trackFirstContentfulPaint(configuration: RumConfiguration, firstHidden: FirstHidden, callback: (fcpTiming: RelativeTime) => void): {
|
|
6
|
+
stop: () => void;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Measure the First Contentful Paint after a BFCache restoration.
|
|
10
|
+
* The DOM is restored synchronously, so we approximate the FCP with the first frame
|
|
11
|
+
* rendered just after the pageshow event, using two nested requestAnimationFrame calls.
|
|
12
|
+
*/
|
|
13
|
+
export declare function trackRestoredFirstContentfulPaint(viewStartRelative: RelativeTime, callback: (fcp: Duration) => void): void;
|