@kubesense/kubesense-browser-rum-core 1.7.0 → 2.0.0-beta.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/LICENSE +1 -1
- package/cjs/boot/preStartRum.d.ts +4 -3
- package/cjs/boot/preStartRum.js +229 -204
- package/cjs/boot/preStartRum.js.map +1 -1
- package/cjs/boot/rumPublicApi.d.ts +190 -51
- package/cjs/boot/rumPublicApi.js +267 -164
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRum.d.ts +42 -31
- package/cjs/boot/startRum.js +157 -150
- package/cjs/boot/startRum.js.map +1 -1
- package/cjs/browser/cookieObservable.d.ts +1 -5
- package/cjs/browser/cookieObservable.js +30 -34
- package/cjs/browser/cookieObservable.js.map +1 -1
- package/cjs/browser/domMutationObservable.d.ts +3 -3
- package/cjs/browser/domMutationObservable.js +29 -53
- package/cjs/browser/domMutationObservable.js.map +1 -1
- package/cjs/browser/htmlDomUtils.d.ts +5 -0
- package/cjs/browser/htmlDomUtils.js +38 -28
- package/cjs/browser/htmlDomUtils.js.map +1 -1
- package/cjs/browser/locationChangeObservable.d.ts +1 -2
- package/cjs/browser/locationChangeObservable.js +44 -45
- package/cjs/browser/locationChangeObservable.js.map +1 -1
- package/cjs/browser/performanceObservable.d.ts +4 -4
- package/cjs/browser/performanceObservable.js +50 -114
- package/cjs/browser/performanceObservable.js.map +1 -1
- package/cjs/browser/performanceUtils.d.ts +13 -1
- package/cjs/browser/performanceUtils.js +63 -37
- package/cjs/browser/performanceUtils.js.map +1 -1
- package/cjs/browser/scroll.js +17 -28
- package/cjs/browser/scroll.js.map +1 -1
- package/cjs/browser/viewportObservable.d.ts +2 -3
- package/cjs/browser/viewportObservable.js +29 -31
- package/cjs/browser/viewportObservable.js.map +1 -1
- package/cjs/browser/windowOpenObservable.js +11 -7
- package/cjs/browser/windowOpenObservable.js.map +1 -1
- package/cjs/domain/action/actionCollection.d.ts +11 -12
- package/cjs/domain/action/actionCollection.js +82 -89
- package/cjs/domain/action/actionCollection.js.map +1 -1
- package/cjs/domain/action/actionNameConstants.js +10 -9
- package/cjs/domain/action/actionNameConstants.js.map +1 -1
- package/cjs/domain/action/clickChain.js +51 -54
- package/cjs/domain/action/clickChain.js.map +1 -1
- package/cjs/domain/action/computeFrustration.js +30 -62
- package/cjs/domain/action/computeFrustration.js.map +1 -1
- package/cjs/domain/action/frustrationIgnore.d.ts +9 -0
- package/cjs/domain/action/frustrationIgnore.js +32 -0
- package/cjs/domain/action/frustrationIgnore.js.map +1 -0
- package/cjs/domain/action/getActionNameFromElement.js +141 -217
- package/cjs/domain/action/getActionNameFromElement.js.map +1 -1
- package/cjs/domain/action/interactionSelectorCache.d.ts +1 -1
- package/cjs/domain/action/interactionSelectorCache.js +17 -18
- package/cjs/domain/action/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/action/isActionChildEvent.d.ts +2 -0
- package/cjs/domain/action/isActionChildEvent.js +8 -0
- package/cjs/domain/action/isActionChildEvent.js.map +1 -0
- package/cjs/domain/action/listenActionEvents.d.ts +2 -3
- package/cjs/domain/action/listenActionEvents.js +51 -55
- package/cjs/domain/action/listenActionEvents.js.map +1 -1
- package/cjs/domain/action/trackClickActions.d.ts +15 -21
- package/cjs/domain/action/trackClickActions.js +188 -226
- package/cjs/domain/action/trackClickActions.js.map +1 -1
- package/cjs/domain/action/trackManualActions.d.ts +45 -0
- package/cjs/domain/action/trackManualActions.js +48 -0
- package/cjs/domain/action/trackManualActions.js.map +1 -0
- package/cjs/domain/assembly.d.ts +1 -2
- package/cjs/domain/assembly.js +80 -95
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/configuration/configuration.d.ts +575 -81
- package/cjs/domain/configuration/configuration.js +464 -199
- package/cjs/domain/configuration/configuration.js.map +1 -1
- package/cjs/domain/configuration/index.d.ts +1 -0
- package/cjs/domain/configuration/index.js +27 -21
- package/cjs/domain/configuration/jsonPathParser.js +125 -139
- package/cjs/domain/configuration/jsonPathParser.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.d.ts +18 -5
- package/cjs/domain/configuration/remoteConfiguration.js +268 -226
- package/cjs/domain/configuration/remoteConfiguration.js.map +1 -1
- package/cjs/domain/configuration/remoteConfiguration.types.d.ts +49 -0
- package/cjs/domain/configuration/remoteConfigurationCache.d.ts +42 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js +95 -0
- package/cjs/domain/configuration/remoteConfigurationCache.js.map +1 -0
- package/cjs/domain/configuration/remoteSdkConfiguration.d.ts +11 -2
- package/cjs/domain/configuration/remoteSdkConfiguration.js +185 -117
- package/cjs/domain/configuration/remoteSdkConfiguration.js.map +1 -1
- package/cjs/domain/configuration/sessionReplayRoutes.d.ts +1 -6
- package/cjs/domain/configuration/sessionReplayRoutes.js +20 -63
- package/cjs/domain/configuration/sessionReplayRoutes.js.map +1 -1
- package/cjs/domain/contexts/ciVisibilityContext.d.ts +2 -4
- package/cjs/domain/contexts/ciVisibilityContext.js +36 -32
- package/cjs/domain/contexts/ciVisibilityContext.js.map +1 -1
- package/cjs/domain/contexts/connectivityContext.d.ts +2 -2
- package/cjs/domain/contexts/connectivityContext.js +10 -9
- package/cjs/domain/contexts/connectivityContext.js.map +1 -1
- package/cjs/domain/contexts/defaultContext.d.ts +3 -3
- package/cjs/domain/contexts/defaultContext.js +28 -32
- package/cjs/domain/contexts/defaultContext.js.map +1 -1
- package/cjs/domain/contexts/displayContext.d.ts +2 -3
- package/cjs/domain/contexts/displayContext.js +22 -26
- package/cjs/domain/contexts/displayContext.js.map +1 -1
- package/cjs/domain/contexts/featureFlagContext.d.ts +2 -2
- package/cjs/domain/contexts/featureFlagContext.js +38 -50
- package/cjs/domain/contexts/featureFlagContext.js.map +1 -1
- package/cjs/domain/contexts/internalContext.d.ts +2 -3
- package/cjs/domain/contexts/internalContext.js +26 -22
- package/cjs/domain/contexts/internalContext.js.map +1 -1
- package/cjs/domain/contexts/pageStateHistory.d.ts +3 -4
- package/cjs/domain/contexts/pageStateHistory.js +76 -96
- package/cjs/domain/contexts/pageStateHistory.js.map +1 -1
- package/cjs/domain/contexts/sessionContext.d.ts +9 -3
- package/cjs/domain/contexts/sessionContext.js +31 -45
- package/cjs/domain/contexts/sessionContext.js.map +1 -1
- package/cjs/domain/contexts/sourceCodeMfeContext.d.ts +10 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js +35 -0
- package/cjs/domain/contexts/sourceCodeMfeContext.js.map +1 -0
- package/cjs/domain/contexts/syntheticsContext.d.ts +2 -2
- package/cjs/domain/contexts/syntheticsContext.js +19 -23
- package/cjs/domain/contexts/syntheticsContext.js.map +1 -1
- package/cjs/domain/contexts/trackingConsentContext.d.ts +2 -2
- package/cjs/domain/contexts/trackingConsentContext.js +10 -12
- package/cjs/domain/contexts/trackingConsentContext.js.map +1 -1
- package/cjs/domain/contexts/urlContexts.d.ts +4 -3
- package/cjs/domain/contexts/urlContexts.js +65 -61
- package/cjs/domain/contexts/urlContexts.js.map +1 -1
- package/cjs/domain/contexts/userAgentDataContext.d.ts +2 -2
- package/cjs/domain/contexts/userAgentDataContext.js +20 -29
- package/cjs/domain/contexts/userAgentDataContext.js.map +1 -1
- package/cjs/domain/contexts/viewHistory.d.ts +5 -2
- package/cjs/domain/contexts/viewHistory.js +41 -45
- package/cjs/domain/contexts/viewHistory.js.map +1 -1
- package/cjs/domain/discardNegativeDuration.d.ts +1 -1
- package/cjs/domain/discardNegativeDuration.js +6 -5
- package/cjs/domain/discardNegativeDuration.js.map +1 -1
- package/cjs/domain/error/errorCollection.d.ts +3 -3
- package/cjs/domain/error/errorCollection.js +67 -68
- package/cjs/domain/error/errorCollection.js.map +1 -1
- package/cjs/domain/error/trackReportError.d.ts +1 -2
- package/cjs/domain/error/trackReportError.js +10 -14
- package/cjs/domain/error/trackReportError.js.map +1 -1
- package/cjs/domain/event/eventCollection.d.ts +2 -1
- package/cjs/domain/event/eventCollection.js +21 -22
- package/cjs/domain/event/eventCollection.js.map +1 -1
- package/cjs/domain/eventTracker.d.ts +37 -0
- package/cjs/domain/eventTracker.js +94 -0
- package/cjs/domain/eventTracker.js.map +1 -0
- package/cjs/domain/extractRegexMatch.d.ts +5 -0
- package/cjs/domain/extractRegexMatch.js +16 -0
- package/cjs/domain/extractRegexMatch.js.map +1 -0
- package/cjs/domain/getComposedPathSelector.d.ts +22 -0
- package/cjs/domain/getComposedPathSelector.js +95 -0
- package/cjs/domain/getComposedPathSelector.js.map +1 -0
- package/cjs/domain/getSelectorFromElement.d.ts +18 -6
- package/cjs/domain/getSelectorFromElement.js +199 -191
- package/cjs/domain/getSelectorFromElement.js.map +1 -1
- package/cjs/domain/getSessionReplayUrl.d.ts +2 -2
- package/cjs/domain/getSessionReplayUrl.js +17 -30
- package/cjs/domain/getSessionReplayUrl.js.map +1 -1
- package/cjs/domain/hooks.d.ts +26 -17
- package/cjs/domain/hooks.js +12 -5
- package/cjs/domain/hooks.js.map +1 -1
- package/cjs/domain/lifeCycle.d.ts +26 -12
- package/cjs/domain/lifeCycle.js +28 -5
- package/cjs/domain/lifeCycle.js.map +1 -1
- package/cjs/domain/limitModification.d.ts +5 -1
- package/cjs/domain/limitModification.js +32 -36
- package/cjs/domain/limitModification.js.map +1 -1
- package/cjs/domain/longTask/longTaskCollection.d.ts +0 -13
- package/cjs/domain/longTask/longTaskCollection.js +75 -87
- package/cjs/domain/longTask/longTaskCollection.js.map +1 -1
- package/cjs/domain/plugins.d.ts +37 -14
- package/cjs/domain/plugins.js +22 -13
- package/cjs/domain/plugins.js.map +1 -1
- package/cjs/domain/privacy.d.ts +6 -1
- package/cjs/domain/privacy.js +143 -286
- package/cjs/domain/privacy.js.map +1 -1
- package/cjs/domain/privacyConstants.js +43 -34
- package/cjs/domain/privacyConstants.js.map +1 -1
- package/cjs/domain/requestCollection.d.ts +6 -5
- package/cjs/domain/requestCollection.js +82 -105
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/resource/graphql.d.ts +1 -1
- package/cjs/domain/resource/graphql.js +85 -86
- package/cjs/domain/resource/graphql.js.map +1 -1
- package/cjs/domain/resource/requestRegistry.js +30 -38
- package/cjs/domain/resource/requestRegistry.js.map +1 -1
- package/cjs/domain/resource/resourceCollection.d.ts +5 -3
- package/cjs/domain/resource/resourceCollection.js +241 -175
- package/cjs/domain/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/resource/resourceUtils.d.ts +13 -13
- package/cjs/domain/resource/resourceUtils.js +323 -221
- package/cjs/domain/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/resource/trackManualResources.d.ts +55 -0
- package/cjs/domain/resource/trackManualResources.js +53 -0
- package/cjs/domain/resource/trackManualResources.js.map +1 -0
- package/cjs/domain/resource/webSocketCollection.d.ts +46 -0
- package/cjs/domain/resource/webSocketCollection.js +163 -0
- package/cjs/domain/resource/webSocketCollection.js.map +1 -0
- package/cjs/domain/session/session.types.d.ts +4 -0
- package/cjs/domain/sessionReplayState.d.ts +8 -0
- package/cjs/domain/sessionReplayState.js +19 -0
- package/cjs/domain/sessionReplayState.js.map +1 -0
- package/cjs/domain/startCustomerDataTelemetry.js +39 -43
- package/cjs/domain/startCustomerDataTelemetry.js.map +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.d.ts +1 -1
- package/cjs/domain/tracing/getDocumentTraceId.js +42 -63
- package/cjs/domain/tracing/getDocumentTraceId.js.map +1 -1
- package/cjs/domain/tracing/identifier.js +13 -46
- package/cjs/domain/tracing/identifier.js.map +1 -1
- package/cjs/domain/tracing/tracer.d.ts +2 -5
- package/cjs/domain/tracing/tracer.js +110 -150
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/trackEventCounts.js +43 -48
- package/cjs/domain/trackEventCounts.js.map +1 -1
- package/cjs/domain/view/bfCacheSupport.d.ts +1 -2
- package/cjs/domain/view/bfCacheSupport.js +10 -11
- package/cjs/domain/view/bfCacheSupport.js.map +1 -1
- package/cjs/domain/view/trackViewEventCounts.js +14 -13
- package/cjs/domain/view/trackViewEventCounts.js.map +1 -1
- package/cjs/domain/view/trackViews.d.ts +8 -2
- package/cjs/domain/view/trackViews.js +221 -270
- package/cjs/domain/view/trackViews.js.map +1 -1
- package/cjs/domain/view/viewCollection.d.ts +4 -3
- package/cjs/domain/view/viewCollection.js +124 -148
- package/cjs/domain/view/viewCollection.js.map +1 -1
- package/cjs/domain/view/viewDiff.d.ts +22 -0
- package/cjs/domain/view/viewDiff.js +62 -0
- package/cjs/domain/view/viewDiff.js.map +1 -0
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js +20 -22
- package/cjs/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +1 -1
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.d.ts +1 -0
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js +35 -33
- package/cjs/domain/view/viewMetrics/interactionCountPolyfill.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js +14 -13
- package/cjs/domain/view/viewMetrics/trackBfcacheMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +4 -2
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js +51 -34
- package/cjs/domain/view/viewMetrics/trackCommonViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +1 -1
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js +106 -122
- package/cjs/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js +26 -34
- package/cjs/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackFirstHidden.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js +31 -31
- package/cjs/domain/view/viewMetrics/trackFirstHidden.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +1 -3
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js +33 -38
- package/cjs/domain/view/viewMetrics/trackInitialViewMetrics.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +10 -1
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js +202 -144
- package/cjs/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +6 -1
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js +65 -55
- package/cjs/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.d.ts +2 -1
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js +42 -46
- package/cjs/domain/view/viewMetrics/trackLoadingTime.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.d.ts +2 -3
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js +28 -36
- package/cjs/domain/view/viewMetrics/trackNavigationTimings.js.map +1 -1
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.d.ts +3 -4
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js +63 -72
- package/cjs/domain/view/viewMetrics/trackScrollMetrics.js.map +1 -1
- package/cjs/domain/vital/vitalCollection.d.ts +44 -20
- package/cjs/domain/vital/vitalCollection.js +81 -109
- package/cjs/domain/vital/vitalCollection.js.map +1 -1
- package/cjs/domain/waitPageActivityEnd.d.ts +1 -4
- package/cjs/domain/waitPageActivityEnd.js +99 -119
- package/cjs/domain/waitPageActivityEnd.js.map +1 -1
- package/cjs/domainContext.types.d.ts +21 -13
- package/cjs/index.d.ts +11 -10
- package/cjs/index.js +84 -62
- package/cjs/rawRumEvent.types.d.ts +79 -13
- package/cjs/rawRumEvent.types.js +40 -27
- package/cjs/rawRumEvent.types.js.map +1 -1
- package/cjs/rumEvent.types.d.ts +906 -669
- package/cjs/transport/formDataTransport.js +43 -41
- package/cjs/transport/formDataTransport.js.map +1 -1
- package/cjs/transport/startRumBatch.d.ts +27 -3
- package/cjs/transport/startRumBatch.js +132 -31
- package/cjs/transport/startRumBatch.js.map +1 -1
- package/cjs/transport/startRumEventBridge.js +10 -8
- package/cjs/transport/startRumEventBridge.js.map +1 -1
- package/esm/boot/preStartRum.mjs +233 -0
- package/esm/boot/preStartRum.mjs.map +1 -0
- package/esm/boot/rumPublicApi.mjs +271 -0
- package/esm/boot/rumPublicApi.mjs.map +1 -0
- package/esm/boot/startRum.mjs +159 -0
- package/esm/boot/startRum.mjs.map +1 -0
- package/esm/browser/cookieObservable.mjs +34 -0
- package/esm/browser/cookieObservable.mjs.map +1 -0
- package/esm/browser/domMutationObservable.mjs +33 -0
- package/esm/browser/domMutationObservable.mjs.map +1 -0
- package/esm/browser/htmlDomUtils.mjs +48 -0
- package/esm/browser/htmlDomUtils.mjs.map +1 -0
- package/esm/browser/locationChangeObservable.mjs +50 -0
- package/esm/browser/locationChangeObservable.mjs.map +1 -0
- package/esm/browser/performanceObservable.mjs +60 -0
- package/esm/browser/performanceObservable.mjs.map +1 -0
- package/esm/browser/performanceUtils.mjs +64 -0
- package/esm/browser/performanceUtils.mjs.map +1 -0
- package/esm/browser/scroll.mjs +21 -0
- package/esm/browser/scroll.mjs.map +1 -0
- package/esm/browser/viewportObservable.mjs +33 -0
- package/esm/browser/viewportObservable.mjs.map +1 -0
- package/esm/browser/windowOpenObservable.mjs +14 -0
- package/esm/browser/windowOpenObservable.mjs.map +1 -0
- package/esm/domain/action/actionCollection.mjs +89 -0
- package/esm/domain/action/actionCollection.mjs.map +1 -0
- package/esm/domain/action/actionNameConstants.mjs +11 -0
- package/esm/domain/action/actionNameConstants.mjs.map +1 -0
- package/esm/domain/action/clickChain.mjs +57 -0
- package/esm/domain/action/clickChain.mjs.map +1 -0
- package/esm/domain/action/computeFrustration.mjs +36 -0
- package/esm/domain/action/computeFrustration.mjs.map +1 -0
- package/esm/domain/action/frustrationIgnore.mjs +31 -0
- package/esm/domain/action/frustrationIgnore.mjs.map +1 -0
- package/esm/domain/action/getActionNameFromElement.mjs +163 -0
- package/esm/domain/action/getActionNameFromElement.mjs.map +1 -0
- package/esm/domain/action/interactionSelectorCache.mjs +19 -0
- package/esm/domain/action/interactionSelectorCache.mjs.map +1 -0
- package/esm/domain/action/isActionChildEvent.mjs +8 -0
- package/esm/domain/action/isActionChildEvent.mjs.map +1 -0
- package/esm/domain/action/listenActionEvents.mjs +57 -0
- package/esm/domain/action/listenActionEvents.mjs.map +1 -0
- package/esm/domain/action/trackClickActions.mjs +198 -0
- package/esm/domain/action/trackClickActions.mjs.map +1 -0
- package/esm/domain/action/trackManualActions.mjs +48 -0
- package/esm/domain/action/trackManualActions.mjs.map +1 -0
- package/esm/domain/assembly.mjs +87 -0
- package/esm/domain/assembly.mjs.map +1 -0
- package/esm/domain/configuration/configuration.mjs +474 -0
- package/esm/domain/configuration/configuration.mjs.map +1 -0
- package/esm/domain/configuration/index.mjs +6 -0
- package/esm/domain/configuration/jsonPathParser.mjs +145 -0
- package/esm/domain/configuration/jsonPathParser.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfiguration.mjs +279 -0
- package/esm/domain/configuration/remoteConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs +92 -0
- package/esm/domain/configuration/remoteConfigurationCache.mjs.map +1 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs +208 -0
- package/esm/domain/configuration/remoteSdkConfiguration.mjs.map +1 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs +26 -0
- package/esm/domain/configuration/sessionReplayRoutes.mjs.map +1 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs +37 -0
- package/esm/domain/contexts/ciVisibilityContext.mjs.map +1 -0
- package/esm/domain/contexts/connectivityContext.mjs +12 -0
- package/esm/domain/contexts/connectivityContext.mjs.map +1 -0
- package/esm/domain/contexts/defaultContext.mjs +30 -0
- package/esm/domain/contexts/defaultContext.mjs.map +1 -0
- package/esm/domain/contexts/displayContext.mjs +24 -0
- package/esm/domain/contexts/displayContext.mjs.map +1 -0
- package/esm/domain/contexts/featureFlagContext.mjs +40 -0
- package/esm/domain/contexts/featureFlagContext.mjs.map +1 -0
- package/esm/domain/contexts/internalContext.mjs +30 -0
- package/esm/domain/contexts/internalContext.mjs.map +1 -0
- package/esm/domain/contexts/pageStateHistory.mjs +82 -0
- package/esm/domain/contexts/pageStateHistory.mjs.map +1 -0
- package/esm/domain/contexts/sessionContext.mjs +33 -0
- package/esm/domain/contexts/sessionContext.mjs.map +1 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs +35 -0
- package/esm/domain/contexts/sourceCodeMfeContext.mjs.map +1 -0
- package/esm/domain/contexts/syntheticsContext.mjs +21 -0
- package/esm/domain/contexts/syntheticsContext.mjs.map +1 -0
- package/esm/domain/contexts/trackingConsentContext.mjs +12 -0
- package/esm/domain/contexts/trackingConsentContext.mjs.map +1 -0
- package/esm/domain/contexts/urlContexts.mjs +67 -0
- package/esm/domain/contexts/urlContexts.mjs.map +1 -0
- package/esm/domain/contexts/userAgentDataContext.mjs +22 -0
- package/esm/domain/contexts/userAgentDataContext.mjs.map +1 -0
- package/esm/domain/contexts/viewHistory.mjs +43 -0
- package/esm/domain/contexts/viewHistory.mjs.map +1 -0
- package/esm/domain/discardNegativeDuration.mjs +9 -0
- package/esm/domain/discardNegativeDuration.mjs.map +1 -0
- package/esm/domain/error/errorCollection.mjs +72 -0
- package/esm/domain/error/errorCollection.mjs.map +1 -0
- package/esm/domain/error/trackReportError.mjs +12 -0
- package/esm/domain/error/trackReportError.mjs.map +1 -0
- package/esm/domain/event/eventCollection.mjs +26 -0
- package/esm/domain/event/eventCollection.mjs.map +1 -0
- package/esm/domain/eventTracker.mjs +93 -0
- package/esm/domain/eventTracker.mjs.map +1 -0
- package/esm/domain/extractRegexMatch.mjs +16 -0
- package/esm/domain/extractRegexMatch.mjs.map +1 -0
- package/esm/domain/getComposedPathSelector.mjs +93 -0
- package/esm/domain/getComposedPathSelector.mjs.map +1 -0
- package/esm/domain/getSelectorFromElement.mjs +218 -0
- package/esm/domain/getSelectorFromElement.mjs.map +1 -0
- package/esm/domain/getSessionReplayUrl.mjs +20 -0
- package/esm/domain/getSessionReplayUrl.mjs.map +1 -0
- package/esm/domain/hooks.mjs +13 -0
- package/esm/domain/hooks.mjs.map +1 -0
- package/esm/domain/lifeCycle.mjs +28 -0
- package/esm/domain/lifeCycle.mjs.map +1 -0
- package/esm/domain/limitModification.mjs +42 -0
- package/esm/domain/limitModification.mjs.map +1 -0
- package/esm/domain/longTask/longTaskCollection.mjs +79 -0
- package/esm/domain/longTask/longTaskCollection.mjs.map +1 -0
- package/esm/domain/plugins.mjs +23 -0
- package/esm/domain/plugins.mjs.map +1 -0
- package/esm/domain/privacy.mjs +161 -0
- package/esm/domain/privacy.mjs.map +1 -0
- package/esm/domain/privacyConstants.mjs +36 -0
- package/esm/domain/privacyConstants.mjs.map +1 -0
- package/esm/domain/requestCollection.mjs +86 -0
- package/esm/domain/requestCollection.mjs.map +1 -0
- package/esm/domain/resource/graphql.mjs +93 -0
- package/esm/domain/resource/graphql.mjs.map +1 -0
- package/esm/domain/resource/requestRegistry.mjs +32 -0
- package/esm/domain/resource/requestRegistry.mjs.map +1 -0
- package/esm/domain/resource/resourceCollection.mjs +256 -0
- package/esm/domain/resource/resourceCollection.mjs.map +1 -0
- package/esm/domain/resource/resourceUtils.mjs +349 -0
- package/esm/domain/resource/resourceUtils.mjs.map +1 -0
- package/esm/domain/resource/trackManualResources.mjs +53 -0
- package/esm/domain/resource/trackManualResources.mjs.map +1 -0
- package/esm/domain/resource/webSocketCollection.mjs +160 -0
- package/esm/domain/resource/webSocketCollection.mjs.map +1 -0
- package/esm/domain/sessionReplayState.mjs +18 -0
- package/esm/domain/sessionReplayState.mjs.map +1 -0
- package/esm/domain/startCustomerDataTelemetry.mjs +51 -0
- package/esm/domain/startCustomerDataTelemetry.mjs.map +1 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs +50 -0
- package/esm/domain/tracing/getDocumentTraceId.mjs.map +1 -0
- package/esm/domain/tracing/identifier.mjs +20 -0
- package/esm/domain/tracing/identifier.mjs.map +1 -0
- package/esm/domain/tracing/tracer.mjs +120 -0
- package/esm/domain/tracing/tracer.mjs.map +1 -0
- package/esm/domain/trackEventCounts.mjs +45 -0
- package/esm/domain/trackEventCounts.mjs.map +1 -0
- package/esm/domain/view/bfCacheSupport.mjs +12 -0
- package/esm/domain/view/bfCacheSupport.mjs.map +1 -0
- package/esm/domain/view/trackViewEventCounts.mjs +17 -0
- package/esm/domain/view/trackViewEventCounts.mjs.map +1 -0
- package/esm/domain/view/trackViews.mjs +230 -0
- package/esm/domain/view/trackViews.mjs.map +1 -0
- package/esm/domain/view/viewCollection.mjs +129 -0
- package/esm/domain/view/viewCollection.mjs.map +1 -0
- package/esm/domain/view/viewDiff.mjs +61 -0
- package/esm/domain/view/viewDiff.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs +30 -0
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs +45 -0
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs +18 -0
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs +54 -0
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs +117 -0
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs +29 -0
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs +33 -0
- package/esm/domain/view/viewMetrics/trackFirstHidden.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs +36 -0
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs +210 -0
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs +70 -0
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs +46 -0
- package/esm/domain/view/viewMetrics/trackLoadingTime.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs +35 -0
- package/esm/domain/view/viewMetrics/trackNavigationTimings.mjs.map +1 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs +66 -0
- package/esm/domain/view/viewMetrics/trackScrollMetrics.mjs.map +1 -0
- package/esm/domain/vital/vitalCollection.mjs +85 -0
- package/esm/domain/vital/vitalCollection.mjs.map +1 -0
- package/esm/domain/waitPageActivityEnd.mjs +107 -0
- package/esm/domain/waitPageActivityEnd.mjs.map +1 -0
- package/esm/index.mjs +23 -0
- package/esm/rawRumEvent.types.mjs +42 -0
- package/esm/rawRumEvent.types.mjs.map +1 -0
- package/esm/transport/formDataTransport.mjs +48 -0
- package/esm/transport/formDataTransport.mjs.map +1 -0
- package/esm/transport/startRumBatch.mjs +132 -0
- package/esm/transport/startRumBatch.mjs.map +1 -0
- package/esm/transport/startRumEventBridge.mjs +13 -0
- package/esm/transport/startRumEventBridge.mjs.map +1 -0
- package/package.json +19 -11
- package/src/boot/preStartRum.ts +216 -88
- package/src/boot/rumPublicApi.ts +358 -119
- package/src/boot/startRum.ts +88 -84
- package/src/browser/cookieObservable.ts +19 -28
- package/src/browser/domMutationObservable.ts +7 -12
- package/src/browser/htmlDomUtils.ts +15 -0
- package/src/browser/locationChangeObservable.ts +23 -12
- package/src/browser/performanceObservable.ts +23 -73
- package/src/browser/performanceUtils.ts +52 -4
- package/src/browser/viewportObservable.ts +4 -6
- package/src/domain/action/actionCollection.ts +94 -87
- package/src/domain/action/clickChain.ts +11 -10
- package/src/domain/action/computeFrustration.ts +19 -5
- package/src/domain/action/frustrationIgnore.ts +54 -0
- package/src/domain/action/getActionNameFromElement.ts +27 -61
- package/src/domain/action/interactionSelectorCache.ts +2 -2
- package/src/domain/action/isActionChildEvent.ts +6 -0
- package/src/domain/action/listenActionEvents.ts +2 -11
- package/src/domain/action/trackClickActions.ts +92 -82
- package/src/domain/action/trackManualActions.ts +104 -0
- package/src/domain/assembly.ts +57 -70
- package/src/domain/configuration/configuration.ts +587 -208
- package/src/domain/configuration/index.ts +1 -0
- package/src/domain/configuration/remoteConfiguration.ts +152 -29
- package/src/domain/configuration/remoteConfiguration.types.ts +51 -1
- package/src/domain/configuration/remoteConfigurationCache.ts +153 -0
- package/src/domain/configuration/remoteSdkConfiguration.ts +131 -13
- package/src/domain/configuration/sessionReplayRoutes.ts +2 -47
- package/src/domain/contexts/ciVisibilityContext.ts +23 -12
- package/src/domain/contexts/connectivityContext.ts +7 -10
- package/src/domain/contexts/defaultContext.ts +11 -14
- package/src/domain/contexts/displayContext.ts +8 -12
- package/src/domain/contexts/featureFlagContext.ts +5 -4
- package/src/domain/contexts/internalContext.ts +3 -3
- package/src/domain/contexts/pageStateHistory.ts +20 -31
- package/src/domain/contexts/sessionContext.ts +16 -22
- package/src/domain/contexts/sourceCodeMfeContext.ts +53 -0
- package/src/domain/contexts/syntheticsContext.ts +7 -17
- package/src/domain/contexts/trackingConsentContext.ts +7 -4
- package/src/domain/contexts/urlContexts.ts +13 -9
- package/src/domain/contexts/userAgentDataContext.ts +12 -13
- package/src/domain/contexts/viewHistory.ts +4 -3
- package/src/domain/discardNegativeDuration.ts +1 -1
- package/src/domain/error/errorCollection.ts +12 -22
- package/src/domain/error/trackReportError.ts +4 -7
- package/src/domain/event/eventCollection.ts +4 -2
- package/src/domain/eventTracker.ts +169 -0
- package/src/domain/extractRegexMatch.ts +15 -0
- package/src/domain/getComposedPathSelector.ts +130 -0
- package/src/domain/getSelectorFromElement.ts +125 -31
- package/src/domain/getSessionReplayUrl.ts +4 -13
- package/src/domain/hooks.ts +34 -21
- package/src/domain/lifeCycle.ts +21 -8
- package/src/domain/limitModification.ts +20 -4
- package/src/domain/longTask/longTaskCollection.ts +18 -47
- package/src/domain/plugins.ts +54 -25
- package/src/domain/privacy.ts +16 -24
- package/src/domain/requestCollection.ts +108 -97
- package/src/domain/resource/graphql.ts +71 -25
- package/src/domain/resource/requestRegistry.ts +1 -3
- package/src/domain/resource/resourceCollection.ts +319 -137
- package/src/domain/resource/resourceUtils.ts +24 -26
- package/src/domain/resource/trackManualResources.ts +121 -0
- package/src/domain/resource/webSocketCollection.ts +281 -0
- package/src/domain/session/session.types.ts +5 -0
- package/src/domain/sessionReplayState.ts +36 -0
- package/src/domain/startCustomerDataTelemetry.ts +2 -2
- package/src/domain/tracing/getDocumentTraceId.ts +5 -4
- package/src/domain/tracing/identifier.ts +6 -37
- package/src/domain/tracing/tracer.ts +22 -21
- package/src/domain/tracing/tracer.types.ts +3 -3
- package/src/domain/view/bfCacheSupport.ts +1 -6
- package/src/domain/view/trackViews.ts +40 -37
- package/src/domain/view/viewCollection.ts +29 -23
- package/src/domain/view/viewDiff.ts +115 -0
- package/src/domain/view/viewMetrics/interactionCountPolyfill.ts +13 -2
- package/src/domain/view/viewMetrics/trackBfcacheMetrics.ts +1 -1
- package/src/domain/view/viewMetrics/trackCommonViewMetrics.ts +27 -6
- package/src/domain/view/viewMetrics/trackCumulativeLayoutShift.ts +5 -3
- package/src/domain/view/viewMetrics/trackFirstContentfulPaint.ts +4 -9
- package/src/domain/view/viewMetrics/trackFirstHidden.ts +2 -8
- package/src/domain/view/viewMetrics/trackInitialViewMetrics.ts +4 -13
- package/src/domain/view/viewMetrics/trackInteractionToNextPaint.ts +180 -35
- package/src/domain/view/viewMetrics/trackLargestContentfulPaint.ts +47 -6
- package/src/domain/view/viewMetrics/trackLoadingTime.ts +4 -3
- package/src/domain/view/viewMetrics/trackNavigationTimings.ts +10 -18
- package/src/domain/view/viewMetrics/trackScrollMetrics.ts +23 -37
- package/src/domain/vital/vitalCollection.ts +83 -102
- package/src/domain/waitPageActivityEnd.ts +7 -11
- package/src/domainContext.types.ts +23 -15
- package/src/index.ts +17 -11
- package/src/rawRumEvent.types.ts +80 -26
- package/src/rumEvent.types.ts +730 -505
- package/src/transport/formDataTransport.ts +16 -6
- package/src/transport/startRumBatch.ts +181 -24
- package/cjs/browser/firstInputPolyfill.d.ts +0 -8
- package/cjs/browser/firstInputPolyfill.js +0 -68
- package/cjs/browser/firstInputPolyfill.js.map +0 -1
- package/cjs/domain/configuration/index.js.map +0 -1
- package/cjs/domain/configuration/remoteConfiguration.types.js +0 -7
- package/cjs/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/cjs/domain/error/trackConsoleError.d.ts +0 -4
- package/cjs/domain/error/trackConsoleError.js +0 -13
- package/cjs/domain/error/trackConsoleError.js.map +0 -1
- package/cjs/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/cjs/domain/resource/matchRequestResourceEntry.js +0 -49
- package/cjs/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -24
- package/cjs/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/cjs/domain/rumSessionManager.d.ts +0 -36
- package/cjs/domain/rumSessionManager.js +0 -77
- package/cjs/domain/rumSessionManager.js.map +0 -1
- package/cjs/domain/sampler/sampler.d.ts +0 -10
- package/cjs/domain/sampler/sampler.js +0 -63
- package/cjs/domain/sampler/sampler.js.map +0 -1
- package/cjs/domain/tracing/sampler.d.ts +0 -10
- package/cjs/domain/tracing/sampler.js +0 -69
- package/cjs/domain/tracing/sampler.js.map +0 -1
- package/cjs/domain/tracing/tracer.types.js +0 -3
- package/cjs/domain/tracing/tracer.types.js.map +0 -1
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -44
- package/cjs/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/cjs/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/cjs/domain/view/viewMetrics/trackFirstInput.js +0 -43
- package/cjs/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/cjs/domainContext.types.js +0 -6
- package/cjs/domainContext.types.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/rumEvent.types.js +0 -7
- package/cjs/rumEvent.types.js.map +0 -1
- package/esm/boot/preStartRum.d.ts +0 -7
- package/esm/boot/preStartRum.js +0 -205
- package/esm/boot/preStartRum.js.map +0 -1
- package/esm/boot/rumPublicApi.d.ts +0 -409
- package/esm/boot/rumPublicApi.js +0 -165
- package/esm/boot/rumPublicApi.js.map +0 -1
- package/esm/boot/startRum.d.ts +0 -109
- package/esm/boot/startRum.js +0 -149
- package/esm/boot/startRum.js.map +0 -1
- package/esm/browser/cookieObservable.d.ts +0 -8
- package/esm/browser/cookieObservable.js +0 -35
- package/esm/browser/cookieObservable.js.map +0 -1
- package/esm/browser/domMutationObservable.d.ts +0 -27
- package/esm/browser/domMutationObservable.js +0 -54
- package/esm/browser/domMutationObservable.js.map +0 -1
- package/esm/browser/firstInputPolyfill.d.ts +0 -8
- package/esm/browser/firstInputPolyfill.js +0 -65
- package/esm/browser/firstInputPolyfill.js.map +0 -1
- package/esm/browser/htmlDomUtils.d.ts +0 -13
- package/esm/browser/htmlDomUtils.js +0 -36
- package/esm/browser/htmlDomUtils.js.map +0 -1
- package/esm/browser/locationChangeObservable.d.ts +0 -7
- package/esm/browser/locationChangeObservable.js +0 -48
- package/esm/browser/locationChangeObservable.js.map +0 -1
- package/esm/browser/performanceObservable.d.ts +0 -174
- package/esm/browser/performanceObservable.js +0 -121
- package/esm/browser/performanceObservable.js.map +0 -1
- package/esm/browser/performanceUtils.d.ts +0 -7
- package/esm/browser/performanceUtils.js +0 -38
- package/esm/browser/performanceUtils.js.map +0 -1
- package/esm/browser/scroll.d.ts +0 -2
- package/esm/browser/scroll.js +0 -29
- package/esm/browser/scroll.js.map +0 -1
- package/esm/browser/viewportObservable.d.ts +0 -10
- package/esm/browser/viewportObservable.js +0 -32
- package/esm/browser/viewportObservable.js.map +0 -1
- package/esm/browser/windowOpenObservable.d.ts +0 -5
- package/esm/browser/windowOpenObservable.js +0 -7
- package/esm/browser/windowOpenObservable.js.map +0 -1
- package/esm/domain/action/actionCollection.d.ts +0 -21
- package/esm/domain/action/actionCollection.js +0 -93
- package/esm/domain/action/actionCollection.js.map +0 -1
- package/esm/domain/action/actionNameConstants.d.ts +0 -18
- package/esm/domain/action/actionNameConstants.js +0 -8
- package/esm/domain/action/actionNameConstants.js.map +0 -1
- package/esm/domain/action/clickChain.d.ts +0 -8
- package/esm/domain/action/clickChain.js +0 -57
- package/esm/domain/action/clickChain.js.map +0 -1
- package/esm/domain/action/computeFrustration.d.ts +0 -6
- package/esm/domain/action/computeFrustration.js +0 -65
- package/esm/domain/action/computeFrustration.js.map +0 -1
- package/esm/domain/action/getActionNameFromElement.d.ts +0 -4
- package/esm/domain/action/getActionNameFromElement.js +0 -236
- package/esm/domain/action/getActionNameFromElement.js.map +0 -1
- package/esm/domain/action/interactionSelectorCache.d.ts +0 -5
- package/esm/domain/action/interactionSelectorCache.js +0 -18
- package/esm/domain/action/interactionSelectorCache.js.map +0 -1
- package/esm/domain/action/listenActionEvents.d.ts +0 -19
- package/esm/domain/action/listenActionEvents.js +0 -58
- package/esm/domain/action/listenActionEvents.js.map +0 -1
- package/esm/domain/action/trackClickActions.d.ts +0 -81
- package/esm/domain/action/trackClickActions.js +0 -232
- package/esm/domain/action/trackClickActions.js.map +0 -1
- package/esm/domain/assembly.d.ts +0 -5
- package/esm/domain/assembly.js +0 -99
- package/esm/domain/assembly.js.map +0 -1
- package/esm/domain/configuration/configuration.d.ts +0 -358
- package/esm/domain/configuration/configuration.js +0 -209
- package/esm/domain/configuration/configuration.js.map +0 -1
- package/esm/domain/configuration/index.d.ts +0 -4
- package/esm/domain/configuration/index.js +0 -5
- package/esm/domain/configuration/index.js.map +0 -1
- package/esm/domain/configuration/jsonPathParser.d.ts +0 -28
- package/esm/domain/configuration/jsonPathParser.js +0 -156
- package/esm/domain/configuration/jsonPathParser.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.d.ts +0 -39
- package/esm/domain/configuration/remoteConfiguration.js +0 -236
- package/esm/domain/configuration/remoteConfiguration.js.map +0 -1
- package/esm/domain/configuration/remoteConfiguration.types.d.ts +0 -138
- package/esm/domain/configuration/remoteConfiguration.types.js +0 -6
- package/esm/domain/configuration/remoteConfiguration.types.js.map +0 -1
- package/esm/domain/configuration/remoteSdkConfiguration.d.ts +0 -18
- package/esm/domain/configuration/remoteSdkConfiguration.js +0 -137
- package/esm/domain/configuration/remoteSdkConfiguration.js.map +0 -1
- package/esm/domain/configuration/sessionReplayRoutes.d.ts +0 -35
- package/esm/domain/configuration/sessionReplayRoutes.js +0 -65
- package/esm/domain/configuration/sessionReplayRoutes.js.map +0 -1
- package/esm/domain/contexts/ciVisibilityContext.d.ts +0 -12
- package/esm/domain/contexts/ciVisibilityContext.js +0 -30
- package/esm/domain/contexts/ciVisibilityContext.js.map +0 -1
- package/esm/domain/contexts/connectivityContext.d.ts +0 -2
- package/esm/domain/contexts/connectivityContext.js +0 -8
- package/esm/domain/contexts/connectivityContext.js.map +0 -1
- package/esm/domain/contexts/defaultContext.d.ts +0 -4
- package/esm/domain/contexts/defaultContext.js +0 -31
- package/esm/domain/contexts/defaultContext.js.map +0 -1
- package/esm/domain/contexts/displayContext.d.ts +0 -6
- package/esm/domain/contexts/displayContext.js +0 -25
- package/esm/domain/contexts/displayContext.js.map +0 -1
- package/esm/domain/contexts/featureFlagContext.d.ts +0 -19
- package/esm/domain/contexts/featureFlagContext.js +0 -49
- package/esm/domain/contexts/featureFlagContext.js.map +0 -1
- package/esm/domain/contexts/internalContext.d.ts +0 -12
- package/esm/domain/contexts/internalContext.js +0 -23
- package/esm/domain/contexts/internalContext.js.map +0 -1
- package/esm/domain/contexts/pageStateHistory.d.ts +0 -23
- package/esm/domain/contexts/pageStateHistory.js +0 -100
- package/esm/domain/contexts/pageStateHistory.js.map +0 -1
- package/esm/domain/contexts/sessionContext.d.ts +0 -5
- package/esm/domain/contexts/sessionContext.js +0 -44
- package/esm/domain/contexts/sessionContext.js.map +0 -1
- package/esm/domain/contexts/syntheticsContext.d.ts +0 -2
- package/esm/domain/contexts/syntheticsContext.js +0 -22
- package/esm/domain/contexts/syntheticsContext.js.map +0 -1
- package/esm/domain/contexts/trackingConsentContext.d.ts +0 -3
- package/esm/domain/contexts/trackingConsentContext.js +0 -11
- package/esm/domain/contexts/trackingConsentContext.js.map +0 -1
- package/esm/domain/contexts/urlContexts.d.ts +0 -22
- package/esm/domain/contexts/urlContexts.js +0 -60
- package/esm/domain/contexts/urlContexts.js.map +0 -1
- package/esm/domain/contexts/userAgentDataContext.d.ts +0 -2
- package/esm/domain/contexts/userAgentDataContext.js +0 -28
- package/esm/domain/contexts/userAgentDataContext.js.map +0 -1
- package/esm/domain/contexts/viewHistory.d.ts +0 -17
- package/esm/domain/contexts/viewHistory.js +0 -44
- package/esm/domain/contexts/viewHistory.js.map +0 -1
- package/esm/domain/discardNegativeDuration.d.ts +0 -2
- package/esm/domain/discardNegativeDuration.js +0 -5
- package/esm/domain/discardNegativeDuration.js.map +0 -1
- package/esm/domain/error/errorCollection.d.ts +0 -17
- package/esm/domain/error/errorCollection.js +0 -70
- package/esm/domain/error/errorCollection.js.map +0 -1
- package/esm/domain/error/trackConsoleError.d.ts +0 -4
- package/esm/domain/error/trackConsoleError.js +0 -10
- package/esm/domain/error/trackConsoleError.js.map +0 -1
- package/esm/domain/error/trackReportError.d.ts +0 -5
- package/esm/domain/error/trackReportError.js +0 -13
- package/esm/domain/error/trackReportError.js.map +0 -1
- package/esm/domain/event/eventCollection.d.ts +0 -10
- package/esm/domain/event/eventCollection.js +0 -24
- package/esm/domain/event/eventCollection.js.map +0 -1
- package/esm/domain/getSelectorFromElement.d.ts +0 -64
- package/esm/domain/getSelectorFromElement.js +0 -213
- package/esm/domain/getSelectorFromElement.js.map +0 -1
- package/esm/domain/getSessionReplayUrl.d.ts +0 -9
- package/esm/domain/getSessionReplayUrl.js +0 -30
- package/esm/domain/getSessionReplayUrl.js.map +0 -1
- package/esm/domain/hooks.d.ts +0 -23
- package/esm/domain/hooks.js +0 -3
- package/esm/domain/hooks.js.map +0 -1
- package/esm/domain/lifeCycle.d.ts +0 -73
- package/esm/domain/lifeCycle.js +0 -3
- package/esm/domain/lifeCycle.js.map +0 -1
- package/esm/domain/limitModification.d.ts +0 -8
- package/esm/domain/limitModification.js +0 -43
- package/esm/domain/limitModification.js.map +0 -1
- package/esm/domain/longTask/longTaskCollection.d.ts +0 -18
- package/esm/domain/longTask/longTaskCollection.js +0 -87
- package/esm/domain/longTask/longTaskCollection.js.map +0 -1
- package/esm/domain/plugins.d.ts +0 -40
- package/esm/domain/plugins.js +0 -12
- package/esm/domain/plugins.js.map +0 -1
- package/esm/domain/privacy.d.ts +0 -44
- package/esm/domain/privacy.js +0 -302
- package/esm/domain/privacy.js.map +0 -1
- package/esm/domain/privacyConstants.d.ts +0 -23
- package/esm/domain/privacyConstants.js +0 -35
- package/esm/domain/privacyConstants.js.map +0 -1
- package/esm/domain/requestCollection.d.ts +0 -54
- package/esm/domain/requestCollection.js +0 -106
- package/esm/domain/requestCollection.js.map +0 -1
- package/esm/domain/resource/graphql.d.ts +0 -23
- package/esm/domain/resource/graphql.js +0 -91
- package/esm/domain/resource/graphql.js.map +0 -1
- package/esm/domain/resource/matchRequestResourceEntry.d.ts +0 -16
- package/esm/domain/resource/matchRequestResourceEntry.js +0 -46
- package/esm/domain/resource/matchRequestResourceEntry.js.map +0 -1
- package/esm/domain/resource/requestRegistry.d.ts +0 -9
- package/esm/domain/resource/requestRegistry.js +0 -37
- package/esm/domain/resource/requestRegistry.js.map +0 -1
- package/esm/domain/resource/resourceCollection.d.ts +0 -7
- package/esm/domain/resource/resourceCollection.js +0 -187
- package/esm/domain/resource/resourceCollection.js.map +0 -1
- package/esm/domain/resource/resourceUtils.d.ts +0 -55
- package/esm/domain/resource/resourceUtils.js +0 -244
- package/esm/domain/resource/resourceUtils.js.map +0 -1
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.d.ts +0 -4
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js +0 -21
- package/esm/domain/resource/retrieveInitialDocumentResourceTiming.js.map +0 -1
- package/esm/domain/rumSessionManager.d.ts +0 -36
- package/esm/domain/rumSessionManager.js +0 -72
- package/esm/domain/rumSessionManager.js.map +0 -1
- package/esm/domain/sampler/sampler.d.ts +0 -10
- package/esm/domain/sampler/sampler.js +0 -58
- package/esm/domain/sampler/sampler.js.map +0 -1
- package/esm/domain/startCustomerDataTelemetry.d.ts +0 -4
- package/esm/domain/startCustomerDataTelemetry.js +0 -52
- package/esm/domain/startCustomerDataTelemetry.js.map +0 -1
- package/esm/domain/tracing/getDocumentTraceId.d.ts +0 -12
- package/esm/domain/tracing/getDocumentTraceId.js +0 -68
- package/esm/domain/tracing/getDocumentTraceId.js.map +0 -1
- package/esm/domain/tracing/identifier.d.ts +0 -13
- package/esm/domain/tracing/identifier.js +0 -50
- package/esm/domain/tracing/identifier.js.map +0 -1
- package/esm/domain/tracing/sampler.d.ts +0 -10
- package/esm/domain/tracing/sampler.js +0 -64
- package/esm/domain/tracing/sampler.js.map +0 -1
- package/esm/domain/tracing/tracer.d.ts +0 -30
- package/esm/domain/tracing/tracer.js +0 -156
- package/esm/domain/tracing/tracer.js.map +0 -1
- package/esm/domain/tracing/tracer.types.d.ts +0 -12
- package/esm/domain/tracing/tracer.types.js +0 -2
- package/esm/domain/tracing/tracer.types.js.map +0 -1
- package/esm/domain/trackEventCounts.d.ts +0 -17
- package/esm/domain/trackEventCounts.js +0 -47
- package/esm/domain/trackEventCounts.js.map +0 -1
- package/esm/domain/view/bfCacheSupport.d.ts +0 -2
- package/esm/domain/view/bfCacheSupport.js +0 -10
- package/esm/domain/view/bfCacheSupport.js.map +0 -1
- package/esm/domain/view/trackViewEventCounts.d.ts +0 -5
- package/esm/domain/view/trackViewEventCounts.js +0 -13
- package/esm/domain/view/trackViewEventCounts.js.map +0 -1
- package/esm/domain/view/trackViews.d.ts +0 -65
- package/esm/domain/view/trackViews.js +0 -278
- package/esm/domain/view/trackViews.js.map +0 -1
- package/esm/domain/view/viewCollection.d.ts +0 -18
- package/esm/domain/view/viewCollection.js +0 -150
- package/esm/domain/view/viewCollection.js.map +0 -1
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.d.ts +0 -6
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js +0 -28
- package/esm/domain/view/viewMetrics/getClsAttributionImpactedArea.js.map +0 -1
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.d.ts +0 -18
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js +0 -39
- package/esm/domain/view/viewMetrics/interactionCountPolyfill.js.map +0 -1
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.d.ts +0 -6
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js +0 -41
- package/esm/domain/view/viewMetrics/startInitialViewMetricsTelemetry.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.d.ts +0 -8
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js +0 -14
- package/esm/domain/view/viewMetrics/trackBfcacheMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.d.ts +0 -21
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js +0 -34
- package/esm/domain/view/viewMetrics/trackCommonViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.d.ts +0 -37
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js +0 -130
- package/esm/domain/view/viewMetrics/trackCumulativeLayoutShift.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.d.ts +0 -13
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js +0 -34
- package/esm/domain/view/viewMetrics/trackFirstContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstHidden.d.ts +0 -10
- package/esm/domain/view/viewMetrics/trackFirstHidden.js +0 -30
- package/esm/domain/view/viewMetrics/trackFirstHidden.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackFirstInput.d.ts +0 -19
- package/esm/domain/view/viewMetrics/trackFirstInput.js +0 -40
- package/esm/domain/view/viewMetrics/trackFirstInput.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.d.ts +0 -15
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js +0 -38
- package/esm/domain/view/viewMetrics/trackInitialViewMetrics.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js +0 -149
- package/esm/domain/view/viewMetrics/trackInteractionToNextPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.d.ts +0 -18
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js +0 -57
- package/esm/domain/view/viewMetrics/trackLargestContentfulPaint.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackLoadingTime.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackLoadingTime.js +0 -47
- package/esm/domain/view/viewMetrics/trackLoadingTime.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackNavigationTimings.d.ts +0 -14
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js +0 -40
- package/esm/domain/view/viewMetrics/trackNavigationTimings.js.map +0 -1
- package/esm/domain/view/viewMetrics/trackScrollMetrics.d.ts +0 -25
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js +0 -72
- package/esm/domain/view/viewMetrics/trackScrollMetrics.js.map +0 -1
- package/esm/domain/vital/vitalCollection.d.ts +0 -55
- package/esm/domain/vital/vitalCollection.js +0 -107
- package/esm/domain/vital/vitalCollection.js.map +0 -1
- package/esm/domain/waitPageActivityEnd.d.ts +0 -54
- package/esm/domain/waitPageActivityEnd.js +0 -123
- package/esm/domain/waitPageActivityEnd.js.map +0 -1
- package/esm/domainContext.types.d.ts +0 -39
- package/esm/domainContext.types.js +0 -5
- package/esm/domainContext.types.js.map +0 -1
- package/esm/index.d.ts +0 -42
- package/esm/index.js +0 -22
- package/esm/index.js.map +0 -1
- package/esm/rawRumEvent.types.d.ts +0 -326
- package/esm/rawRumEvent.types.js +0 -31
- package/esm/rawRumEvent.types.js.map +0 -1
- package/esm/rumEvent.types.d.ts +0 -2038
- package/esm/rumEvent.types.js +0 -6
- package/esm/rumEvent.types.js.map +0 -1
- package/esm/transport/formDataTransport.d.ts +0 -16
- package/esm/transport/formDataTransport.js +0 -43
- package/esm/transport/formDataTransport.js.map +0 -1
- package/esm/transport/startRumBatch.d.ts +0 -5
- package/esm/transport/startRumBatch.js +0 -30
- package/esm/transport/startRumBatch.js.map +0 -1
- package/esm/transport/startRumEventBridge.d.ts +0 -2
- package/esm/transport/startRumEventBridge.js +0 -8
- package/esm/transport/startRumEventBridge.js.map +0 -1
- package/src/browser/firstInputPolyfill.ts +0 -87
- package/src/domain/error/trackConsoleError.ts +0 -14
- package/src/domain/resource/matchRequestResourceEntry.ts +0 -68
- package/src/domain/resource/retrieveInitialDocumentResourceTiming.ts +0 -27
- package/src/domain/rumSessionManager.ts +0 -134
- package/src/domain/sampler/sampler.ts +0 -63
- package/src/domain/tracing/sampler.ts +0 -69
- package/src/domain/view/viewMetrics/startInitialViewMetricsTelemetry.ts +0 -70
- package/src/domain/view/viewMetrics/trackFirstInput.ts +0 -59
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { elapsed, noop, ONE_MINUTE } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { createPerformanceObservable, RumPerformanceEntryType, supportPerformanceTimingEvent, } from '../../../browser/performanceObservable';
|
|
3
|
-
import { ViewLoadingType } from '../../../rawRumEvent.types';
|
|
4
|
-
import { getSelectorFromElement } from '../../getSelectorFromElement';
|
|
5
|
-
import { isElementNode } from '../../../browser/htmlDomUtils';
|
|
6
|
-
import { getInteractionSelector } from '../../action/interactionSelectorCache';
|
|
7
|
-
import { getInteractionCount, initInteractionCountPolyfill } from './interactionCountPolyfill';
|
|
8
|
-
// Arbitrary value to prevent unnecessary memory usage on views with lots of interactions.
|
|
9
|
-
const MAX_INTERACTION_ENTRIES = 10;
|
|
10
|
-
// Arbitrary value to cap INP outliers
|
|
11
|
-
export const MAX_INP_VALUE = (1 * ONE_MINUTE);
|
|
12
|
-
/**
|
|
13
|
-
* Track the interaction to next paint (INP).
|
|
14
|
-
* To avoid outliers, return the p98 worst interaction of the view.
|
|
15
|
-
* Documentation: https://web.dev/inp/
|
|
16
|
-
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/main/src/onINP.ts
|
|
17
|
-
*/
|
|
18
|
-
export function trackInteractionToNextPaint(configuration, viewStart, viewLoadingType) {
|
|
19
|
-
if (!isInteractionToNextPaintSupported()) {
|
|
20
|
-
return {
|
|
21
|
-
getInteractionToNextPaint: () => undefined,
|
|
22
|
-
setViewEnd: noop,
|
|
23
|
-
stop: noop,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
const { getViewInteractionCount, stopViewInteractionCount } = trackViewInteractionCount(viewLoadingType);
|
|
27
|
-
let viewEnd = Infinity;
|
|
28
|
-
const longestInteractions = trackLongestInteractions(getViewInteractionCount);
|
|
29
|
-
let interactionToNextPaint = -1;
|
|
30
|
-
let interactionToNextPaintTargetSelector;
|
|
31
|
-
let interactionToNextPaintStartTime;
|
|
32
|
-
function handleEntries(entries) {
|
|
33
|
-
for (const entry of entries) {
|
|
34
|
-
if (entry.interactionId &&
|
|
35
|
-
// Check the entry start time is inside the view bounds because some view interactions can be reported after the view end (if long duration).
|
|
36
|
-
entry.startTime >= viewStart &&
|
|
37
|
-
entry.startTime <= viewEnd) {
|
|
38
|
-
longestInteractions.process(entry);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const newInteraction = longestInteractions.estimateP98Interaction();
|
|
42
|
-
if (newInteraction && newInteraction.duration !== interactionToNextPaint) {
|
|
43
|
-
interactionToNextPaint = newInteraction.duration;
|
|
44
|
-
interactionToNextPaintStartTime = elapsed(viewStart, newInteraction.startTime);
|
|
45
|
-
interactionToNextPaintTargetSelector = getInteractionSelector(newInteraction.startTime);
|
|
46
|
-
if (!interactionToNextPaintTargetSelector && newInteraction.target && isElementNode(newInteraction.target)) {
|
|
47
|
-
interactionToNextPaintTargetSelector = getSelectorFromElement(newInteraction.target, configuration.actionNameAttribute);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
const firstInputSubscription = createPerformanceObservable(configuration, {
|
|
52
|
-
type: RumPerformanceEntryType.FIRST_INPUT,
|
|
53
|
-
buffered: true,
|
|
54
|
-
}).subscribe(handleEntries);
|
|
55
|
-
const eventSubscription = createPerformanceObservable(configuration, {
|
|
56
|
-
type: RumPerformanceEntryType.EVENT,
|
|
57
|
-
// durationThreshold only impact PerformanceEventTiming entries used for INP computation which requires a threshold at 40 (default is 104ms)
|
|
58
|
-
// cf: https://github.com/GoogleChrome/web-vitals/blob/3806160ffbc93c3c4abf210a167b81228172b31c/src/onINP.ts#L202-L210
|
|
59
|
-
durationThreshold: 40,
|
|
60
|
-
buffered: true,
|
|
61
|
-
}).subscribe(handleEntries);
|
|
62
|
-
return {
|
|
63
|
-
getInteractionToNextPaint: () => {
|
|
64
|
-
// If no INP duration where captured because of the performanceObserver 40ms threshold
|
|
65
|
-
// but the view interaction count > 0 then report 0
|
|
66
|
-
if (interactionToNextPaint >= 0) {
|
|
67
|
-
return {
|
|
68
|
-
value: Math.min(interactionToNextPaint, MAX_INP_VALUE),
|
|
69
|
-
targetSelector: interactionToNextPaintTargetSelector,
|
|
70
|
-
time: interactionToNextPaintStartTime,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
else if (getViewInteractionCount()) {
|
|
74
|
-
return {
|
|
75
|
-
value: 0,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
setViewEnd: (viewEndTime) => {
|
|
80
|
-
viewEnd = viewEndTime;
|
|
81
|
-
stopViewInteractionCount();
|
|
82
|
-
},
|
|
83
|
-
stop: () => {
|
|
84
|
-
eventSubscription.unsubscribe();
|
|
85
|
-
firstInputSubscription.unsubscribe();
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function trackLongestInteractions(getViewInteractionCount) {
|
|
90
|
-
const longestInteractions = [];
|
|
91
|
-
function sortAndTrimLongestInteractions() {
|
|
92
|
-
longestInteractions.sort((a, b) => b.duration - a.duration).splice(MAX_INTERACTION_ENTRIES);
|
|
93
|
-
}
|
|
94
|
-
return {
|
|
95
|
-
/**
|
|
96
|
-
* Process the performance entry:
|
|
97
|
-
* - if its duration is long enough, add the performance entry to the list of worst interactions
|
|
98
|
-
* - if an entry with the same interaction id exists and its duration is lower than the new one, then replace it in the list of worst interactions
|
|
99
|
-
*/
|
|
100
|
-
process(entry) {
|
|
101
|
-
const interactionIndex = longestInteractions.findIndex((interaction) => entry.interactionId === interaction.interactionId);
|
|
102
|
-
const minLongestInteraction = longestInteractions[longestInteractions.length - 1];
|
|
103
|
-
if (interactionIndex !== -1) {
|
|
104
|
-
if (entry.duration > longestInteractions[interactionIndex].duration) {
|
|
105
|
-
longestInteractions[interactionIndex] = entry;
|
|
106
|
-
sortAndTrimLongestInteractions();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else if (longestInteractions.length < MAX_INTERACTION_ENTRIES ||
|
|
110
|
-
entry.duration > minLongestInteraction.duration) {
|
|
111
|
-
longestInteractions.push(entry);
|
|
112
|
-
sortAndTrimLongestInteractions();
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
/**
|
|
116
|
-
* Compute the p98 longest interaction.
|
|
117
|
-
* For better performance the computation is based on 10 longest interactions and the interaction count of the current view.
|
|
118
|
-
*/
|
|
119
|
-
estimateP98Interaction() {
|
|
120
|
-
const interactionIndex = Math.min(longestInteractions.length - 1, Math.floor(getViewInteractionCount() / 50));
|
|
121
|
-
return longestInteractions[interactionIndex];
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
export function trackViewInteractionCount(viewLoadingType) {
|
|
126
|
-
initInteractionCountPolyfill();
|
|
127
|
-
const previousInteractionCount = viewLoadingType === ViewLoadingType.INITIAL_LOAD ? 0 : getInteractionCount();
|
|
128
|
-
let state = { stopped: false };
|
|
129
|
-
function computeViewInteractionCount() {
|
|
130
|
-
return getInteractionCount() - previousInteractionCount;
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
getViewInteractionCount: () => {
|
|
134
|
-
if (state.stopped) {
|
|
135
|
-
return state.interactionCount;
|
|
136
|
-
}
|
|
137
|
-
return computeViewInteractionCount();
|
|
138
|
-
},
|
|
139
|
-
stopViewInteractionCount: () => {
|
|
140
|
-
state = { stopped: true, interactionCount: computeViewInteractionCount() };
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
export function isInteractionToNextPaintSupported() {
|
|
145
|
-
return (supportPerformanceTimingEvent(RumPerformanceEntryType.EVENT) &&
|
|
146
|
-
window.PerformanceEventTiming &&
|
|
147
|
-
'interactionId' in PerformanceEventTiming.prototype);
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=trackInteractionToNextPaint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackInteractionToNextPaint.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackInteractionToNextPaint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAE7E,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,wCAAwC,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAA;AAE9E,OAAO,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAA;AAE9F,0FAA0F;AAC1F,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAClC,sCAAsC;AACtC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,GAAG,UAAU,CAAa,CAAA;AAOzD;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,aAA+B,EAC/B,SAAuB,EACvB,eAAgC;IAEhC,IAAI,CAAC,iCAAiC,EAAE,EAAE,CAAC;QACzC,OAAO;YACL,yBAAyB,EAAE,GAAG,EAAE,CAAC,SAAS;YAC1C,UAAU,EAAE,IAAI;YAChB,IAAI,EAAE,IAAI;SACX,CAAA;IACH,CAAC;IAED,MAAM,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,GAAG,yBAAyB,CAAC,eAAe,CAAC,CAAA;IAExG,IAAI,OAAO,GAAG,QAAwB,CAAA;IAEtC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,uBAAuB,CAAC,CAAA;IAC7E,IAAI,sBAAsB,GAAG,CAAC,CAAa,CAAA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A;QACtC,CAAC;QACD,wBAAwB,EAAE,GAAG,EAAE;YAC7B,KAAK,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,EAAE,CAAA;QAC5E,CAAC;KACF,CAAA;AACH,CAAC;AAED,MAAM,UAAU,iCAAiC;IAC/C,OAAO,CACL,6BAA6B,CAAC,uBAAuB,CAAC,KAAK,CAAC;QAC5D,MAAM,CAAC,sBAAsB;QAC7B,eAAe,IAAI,sBAAsB,CAAC,SAAS,CACpD,CAAA;AACH,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { RelativeTime } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { RumConfiguration } from '../../configuration';
|
|
3
|
-
import type { FirstHidden } from './trackFirstHidden';
|
|
4
|
-
export declare const LCP_MAXIMUM_DELAY: number;
|
|
5
|
-
export interface LargestContentfulPaint {
|
|
6
|
-
value: RelativeTime;
|
|
7
|
-
targetSelector?: string;
|
|
8
|
-
resourceUrl?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Track the largest contentful paint (LCP) occurring during the initial View. This can yield
|
|
12
|
-
* multiple values, only the most recent one should be used.
|
|
13
|
-
* Documentation: https://web.dev/lcp/
|
|
14
|
-
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/onLCP.ts
|
|
15
|
-
*/
|
|
16
|
-
export declare function trackLargestContentfulPaint(configuration: RumConfiguration, firstHidden: FirstHidden, eventTarget: Window, callback: (largestContentfulPaint: LargestContentfulPaint) => void): {
|
|
17
|
-
stop: () => void;
|
|
18
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ONE_MINUTE, addEventListeners, findLast } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { createPerformanceObservable, RumPerformanceEntryType } from '../../../browser/performanceObservable';
|
|
3
|
-
import { getSelectorFromElement } from '../../getSelectorFromElement';
|
|
4
|
-
// Discard LCP timings above a certain delay to avoid incorrect data
|
|
5
|
-
// It happens in some cases like sleep mode or some browser implementations
|
|
6
|
-
export const LCP_MAXIMUM_DELAY = 10 * ONE_MINUTE;
|
|
7
|
-
/**
|
|
8
|
-
* Track the largest contentful paint (LCP) occurring during the initial View. This can yield
|
|
9
|
-
* multiple values, only the most recent one should be used.
|
|
10
|
-
* Documentation: https://web.dev/lcp/
|
|
11
|
-
* Reference implementation: https://github.com/GoogleChrome/web-vitals/blob/master/src/onLCP.ts
|
|
12
|
-
*/
|
|
13
|
-
export function trackLargestContentfulPaint(configuration, firstHidden, eventTarget, callback) {
|
|
14
|
-
// Ignore entries that come after the first user interaction. According to the documentation, the
|
|
15
|
-
// browser should not send largest-contentful-paint entries after a user interact with the page,
|
|
16
|
-
// but the web-vitals reference implementation uses this as a safeguard.
|
|
17
|
-
let firstInteractionTimestamp = Infinity;
|
|
18
|
-
const { stop: stopEventListener } = addEventListeners(configuration, eventTarget, ["pointerdown" /* DOM_EVENT.POINTER_DOWN */, "keydown" /* DOM_EVENT.KEY_DOWN */], (event) => {
|
|
19
|
-
firstInteractionTimestamp = event.timeStamp;
|
|
20
|
-
}, { capture: true, once: true });
|
|
21
|
-
let biggestLcpSize = 0;
|
|
22
|
-
const performanceLcpSubscription = createPerformanceObservable(configuration, {
|
|
23
|
-
type: RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT,
|
|
24
|
-
buffered: true,
|
|
25
|
-
}).subscribe((entries) => {
|
|
26
|
-
const lcpEntry = findLast(entries, (entry) => entry.entryType === RumPerformanceEntryType.LARGEST_CONTENTFUL_PAINT &&
|
|
27
|
-
entry.startTime < firstInteractionTimestamp &&
|
|
28
|
-
entry.startTime < firstHidden.timeStamp &&
|
|
29
|
-
entry.startTime < LCP_MAXIMUM_DELAY &&
|
|
30
|
-
// Ensure to get the LCP entry with the biggest size, see
|
|
31
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=1516655
|
|
32
|
-
entry.size > biggestLcpSize);
|
|
33
|
-
if (lcpEntry) {
|
|
34
|
-
let lcpTargetSelector;
|
|
35
|
-
if (lcpEntry.element) {
|
|
36
|
-
lcpTargetSelector = getSelectorFromElement(lcpEntry.element, configuration.actionNameAttribute);
|
|
37
|
-
}
|
|
38
|
-
callback({
|
|
39
|
-
value: lcpEntry.startTime,
|
|
40
|
-
targetSelector: lcpTargetSelector,
|
|
41
|
-
resourceUrl: computeLcpEntryUrl(lcpEntry),
|
|
42
|
-
});
|
|
43
|
-
biggestLcpSize = lcpEntry.size;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
return {
|
|
47
|
-
stop: () => {
|
|
48
|
-
stopEventListener();
|
|
49
|
-
performanceLcpSubscription.unsubscribe();
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
// The property url report an empty string if the value is not available, we shouldn't report it in this case.
|
|
54
|
-
function computeLcpEntryUrl(entry) {
|
|
55
|
-
return entry.url === '' ? undefined : entry.url;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=trackLargestContentfulPaint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackLargestContentfulPaint.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackLargestContentfulPaint.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAEtG,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAA;AAE7G,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAGrE,oEAAoE;AACpE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,UAAU,CAAA;AAQhD;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,aAA+B,EAC/B,WAAwB,EACxB,WAAmB,EACnB,QAAkE;IAElE,iGAAiG;IACjG,gGAAgG;IAChG,wEAAwE;IAC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C,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,iBAAiB,EAAE,CAAA;YACnB,0BAA0B,CAAC,WAAW,EAAE,CAAA;QAC1C,CAAC;KACF,CAAA;AACH,CAAC;AAED,8GAA8G;AAC9G,SAAS,kBAAkB,CAAC,KAAsC;IAChE,OAAO,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAA;AACjD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ClocksState, Duration, Observable } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { RumConfiguration } from '../../configuration';
|
|
3
|
-
import type { LifeCycle } from '../../lifeCycle';
|
|
4
|
-
import { ViewLoadingType } from '../../../rawRumEvent.types';
|
|
5
|
-
import type { RumMutationRecord } from '../../../browser/domMutationObservable';
|
|
6
|
-
/**
|
|
7
|
-
* For non-initial views (such as route changes or BFCache restores), the regular load event does not fire
|
|
8
|
-
* In these cases, trackLoadingTime can only emit a loadingTime if waitPageActivityEnd detects some post-restore activity.
|
|
9
|
-
* If nothing happens after the view starts,no candidate is recorded and loadingTime stays undefined.
|
|
10
|
-
*/
|
|
11
|
-
export declare function trackLoadingTime(lifeCycle: LifeCycle, domMutationObservable: Observable<RumMutationRecord[]>, windowOpenObservable: Observable<void>, configuration: RumConfiguration, loadType: ViewLoadingType, viewStart: ClocksState, callback: (loadingTime: Duration) => void): {
|
|
12
|
-
stop: () => void;
|
|
13
|
-
setLoadEvent: (loadEvent: Duration) => void;
|
|
14
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { elapsed } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { waitPageActivityEnd } from '../../waitPageActivityEnd';
|
|
3
|
-
import { ViewLoadingType } from '../../../rawRumEvent.types';
|
|
4
|
-
import { trackFirstHidden } from './trackFirstHidden';
|
|
5
|
-
/**
|
|
6
|
-
* For non-initial views (such as route changes or BFCache restores), the regular load event does not fire
|
|
7
|
-
* In these cases, trackLoadingTime can only emit a loadingTime if waitPageActivityEnd detects some post-restore activity.
|
|
8
|
-
* If nothing happens after the view starts,no candidate is recorded and loadingTime stays undefined.
|
|
9
|
-
*/
|
|
10
|
-
export function trackLoadingTime(lifeCycle, domMutationObservable, windowOpenObservable, configuration, loadType, viewStart, callback) {
|
|
11
|
-
let isWaitingForLoadEvent = loadType === ViewLoadingType.INITIAL_LOAD;
|
|
12
|
-
let isWaitingForActivityLoadingTime = true;
|
|
13
|
-
const loadingTimeCandidates = [];
|
|
14
|
-
const firstHidden = trackFirstHidden(configuration, viewStart);
|
|
15
|
-
function invokeCallbackIfAllCandidatesAreReceived() {
|
|
16
|
-
if (!isWaitingForActivityLoadingTime && !isWaitingForLoadEvent && loadingTimeCandidates.length > 0) {
|
|
17
|
-
const loadingTime = Math.max(...loadingTimeCandidates);
|
|
18
|
-
// firstHidden is a relative time from time origin, so we use the relative start time of the view to compare with the loading time
|
|
19
|
-
if (loadingTime < firstHidden.timeStamp - viewStart.relative) {
|
|
20
|
-
callback(loadingTime);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
const { stop } = waitPageActivityEnd(lifeCycle, domMutationObservable, windowOpenObservable, configuration, (event) => {
|
|
25
|
-
if (isWaitingForActivityLoadingTime) {
|
|
26
|
-
isWaitingForActivityLoadingTime = false;
|
|
27
|
-
if (event.hadActivity) {
|
|
28
|
-
loadingTimeCandidates.push(elapsed(viewStart.timeStamp, event.end));
|
|
29
|
-
}
|
|
30
|
-
invokeCallbackIfAllCandidatesAreReceived();
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
stop: () => {
|
|
35
|
-
stop();
|
|
36
|
-
firstHidden.stop();
|
|
37
|
-
},
|
|
38
|
-
setLoadEvent: (loadEvent) => {
|
|
39
|
-
if (isWaitingForLoadEvent) {
|
|
40
|
-
isWaitingForLoadEvent = false;
|
|
41
|
-
loadingTimeCandidates.push(loadEvent);
|
|
42
|
-
invokeCallbackIfAllCandidatesAreReceived();
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=trackLoadingTime.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackLoadingTime.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackLoadingTime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAG/D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;GAIG;AAEH,MAAM,UAAU,gBAAgB,CAC9B,SAAoB,EACpB,qBAAsD,EACtD,oBAAsC,EACtC,aAA+B,EAC/B,QAAyB,EACzB,SAAsB,EACtB,QAAyC;IAEzC,IAAI,qBAAqB,GAAG,QAAQ,KAAK,eAAe,CAAC,YAAY,CAAA;IACrE,IAAI,+BAA+B,GAAG,IAAI,CAAA;IAC1C,MAAM,qBAAqB,GAAe,EAAE,CAAA;IAC5C,MAAM,WAAW,GAAG,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;IAE9D,SAAS,wCAAwC;QAC/C,IAAI,CAAC,+BAA+B,IAAI,CAAC,qBAAqB,IAAI,qBAAqB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnG,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,qBAAqB,CAAC,CAAA;YACtD,kIAAkI;YAClI,IAAI,WAAW,GAAG,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;gBAC7D,QAAQ,CAAC,WAAuB,CAAC,CAAA;YACnC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,mBAAmB,CAClC,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,CAAC,KAAK,EAAE,EAAE;QACR,IAAI,+BAA+B,EAAE,CAAC;YACpC,+BAA+B,GAAG,KAAK,CAAA;YACvC,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;gBACtB,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;YACrE,CAAC;YACD,wCAAwC,EAAE,CAAA;QAC5C,CAAC;IACH,CAAC,CACF,CAAA;IAED,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,IAAI,EAAE,CAAA;YACN,WAAW,CAAC,IAAI,EAAE,CAAA;QACpB,CAAC;QACD,YAAY,EAAE,CAAC,SAAmB,EAAE,EAAE;YACpC,IAAI,qBAAqB,EAAE,CAAC;gBAC1B,qBAAqB,GAAG,KAAK,CAAA;gBAC7B,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBACrC,wCAAwC,EAAE,CAAA;YAC5C,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Duration } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { RumPerformanceNavigationTiming } from '../../../browser/performanceObservable';
|
|
3
|
-
import type { RumConfiguration } from '../../configuration';
|
|
4
|
-
export interface NavigationTimings {
|
|
5
|
-
domComplete: Duration;
|
|
6
|
-
domContentLoaded: Duration;
|
|
7
|
-
domInteractive: Duration;
|
|
8
|
-
loadEvent: Duration;
|
|
9
|
-
firstByte: Duration | undefined;
|
|
10
|
-
}
|
|
11
|
-
export type RelevantNavigationTiming = Pick<RumPerformanceNavigationTiming, 'domComplete' | 'domContentLoadedEventEnd' | 'domInteractive' | 'loadEventEnd' | 'responseStart'>;
|
|
12
|
-
export declare function trackNavigationTimings(configuration: RumConfiguration, callback: (timings: NavigationTimings) => void, getNavigationEntryImpl?: () => RelevantNavigationTiming): {
|
|
13
|
-
stop: () => void;
|
|
14
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { setTimeout, relativeNow, runOnReadyState, clearTimeout } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { getNavigationEntry } from '../../../browser/performanceUtils';
|
|
3
|
-
export function trackNavigationTimings(configuration, callback, getNavigationEntryImpl = getNavigationEntry) {
|
|
4
|
-
return waitAfterLoadEvent(configuration, () => {
|
|
5
|
-
const entry = getNavigationEntryImpl();
|
|
6
|
-
if (!isIncompleteNavigation(entry)) {
|
|
7
|
-
callback(processNavigationEntry(entry));
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
function processNavigationEntry(entry) {
|
|
12
|
-
return {
|
|
13
|
-
domComplete: entry.domComplete,
|
|
14
|
-
domContentLoaded: entry.domContentLoadedEventEnd,
|
|
15
|
-
domInteractive: entry.domInteractive,
|
|
16
|
-
loadEvent: entry.loadEventEnd,
|
|
17
|
-
// In some cases the value reported is negative, zero (meaning unavailable, e.g. cross-origin
|
|
18
|
-
// without Timing-Allow-Origin), or larger than the current page time. Ignore these cases:
|
|
19
|
-
// https://github.com/GoogleChrome/web-vitals/issues/137
|
|
20
|
-
// https://github.com/GoogleChrome/web-vitals/issues/162
|
|
21
|
-
firstByte: entry.responseStart > 0 && entry.responseStart <= relativeNow() ? entry.responseStart : undefined,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function isIncompleteNavigation(entry) {
|
|
25
|
-
return entry.loadEventEnd <= 0;
|
|
26
|
-
}
|
|
27
|
-
function waitAfterLoadEvent(configuration, callback) {
|
|
28
|
-
let timeoutId;
|
|
29
|
-
const { stop: stopOnReadyState } = runOnReadyState(configuration, 'complete', () => {
|
|
30
|
-
// Invoke the callback a bit after the actual load event, so the "loadEventEnd" timing is accurate
|
|
31
|
-
timeoutId = setTimeout(() => callback());
|
|
32
|
-
});
|
|
33
|
-
return {
|
|
34
|
-
stop: () => {
|
|
35
|
-
stopOnReadyState();
|
|
36
|
-
clearTimeout(timeoutId);
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=trackNavigationTimings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackNavigationTimings.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackNavigationTimings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAG1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAiBtE,MAAM,UAAU,sBAAsB,CACpC,aAA+B,EAC/B,QAA8C,EAC9C,yBAAyD,kBAAkB;IAE3E,OAAO,kBAAkB,CAAC,aAAa,EAAE,GAAG,EAAE;QAC5C,MAAM,KAAK,GAAG,sBAAsB,EAAE,CAAA;QAEtC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,QAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAA;QACzC,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA+B;IAC7D,OAAO;QACL,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,gBAAgB,EAAE,KAAK,CAAC,wBAAwB;QAChD,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,SAAS,EAAE,KAAK,CAAC,YAAY;QAC7B,6FAA6F;QAC7F,0FAA0F;QAC1F,wDAAwD;QACxD,wDAAwD;QACxD,SAAS,EAAE,KAAK,CAAC,aAAa,GAAG,CAAC,IAAI,KAAK,CAAC,aAAa,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;KAC7G,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA+B;IAC7D,OAAO,KAAK,CAAC,YAAY,IAAI,CAAC,CAAA;AAChC,CAAC;AAED,SAAS,kBAAkB,CAAC,aAA+B,EAAE,QAAoB;IAC/E,IAAI,SAAgC,CAAA;IACpC,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,eAAe,CAAC,aAAa,EAAE,UAAU,EAAE,GAAG,EAAE;QACjF,kGAAkG;QAClG,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IACF,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,gBAAgB,EAAE,CAAA;YAClB,YAAY,CAAC,SAAS,CAAC,CAAA;QACzB,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ClocksState, Duration } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { Observable } from '@kubesense/kubesense-browser-core';
|
|
3
|
-
import type { RumConfiguration } from '../../configuration';
|
|
4
|
-
/** Arbitrary scroll throttle duration */
|
|
5
|
-
export declare const THROTTLE_SCROLL_DURATION = 1000;
|
|
6
|
-
export interface ScrollMetrics {
|
|
7
|
-
maxDepth: number;
|
|
8
|
-
maxScrollHeight: number;
|
|
9
|
-
maxDepthScrollTop: number;
|
|
10
|
-
maxScrollHeightTime: Duration;
|
|
11
|
-
}
|
|
12
|
-
export declare function trackScrollMetrics(configuration: RumConfiguration, viewStart: ClocksState, callback: (scrollMetrics: ScrollMetrics) => void, scrollValues?: Observable<ScrollValues>): {
|
|
13
|
-
stop: () => void;
|
|
14
|
-
};
|
|
15
|
-
export interface ScrollValues {
|
|
16
|
-
scrollDepth: number;
|
|
17
|
-
scrollTop: number;
|
|
18
|
-
scrollHeight: number;
|
|
19
|
-
}
|
|
20
|
-
export declare function computeScrollValues(): {
|
|
21
|
-
scrollHeight: number;
|
|
22
|
-
scrollDepth: number;
|
|
23
|
-
scrollTop: number;
|
|
24
|
-
};
|
|
25
|
-
export declare function createScrollValuesObservable(configuration: RumConfiguration, throttleDuration?: number): Observable<ScrollValues>;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Observable, ONE_SECOND, elapsed, relativeNow, throttle, addEventListener, monitor, } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { getScrollY } from '../../../browser/scroll';
|
|
3
|
-
import { getViewportDimension } from '../../../browser/viewportObservable';
|
|
4
|
-
/** Arbitrary scroll throttle duration */
|
|
5
|
-
export const THROTTLE_SCROLL_DURATION = ONE_SECOND;
|
|
6
|
-
export function trackScrollMetrics(configuration, viewStart, callback, scrollValues = createScrollValuesObservable(configuration)) {
|
|
7
|
-
let maxScrollDepth = 0;
|
|
8
|
-
let maxScrollHeight = 0;
|
|
9
|
-
let maxScrollHeightTime = 0;
|
|
10
|
-
const subscription = scrollValues.subscribe(({ scrollDepth, scrollTop, scrollHeight }) => {
|
|
11
|
-
let shouldUpdate = false;
|
|
12
|
-
if (scrollDepth > maxScrollDepth) {
|
|
13
|
-
maxScrollDepth = scrollDepth;
|
|
14
|
-
shouldUpdate = true;
|
|
15
|
-
}
|
|
16
|
-
if (scrollHeight > maxScrollHeight) {
|
|
17
|
-
maxScrollHeight = scrollHeight;
|
|
18
|
-
const now = relativeNow();
|
|
19
|
-
maxScrollHeightTime = elapsed(viewStart.relative, now);
|
|
20
|
-
shouldUpdate = true;
|
|
21
|
-
}
|
|
22
|
-
if (shouldUpdate) {
|
|
23
|
-
callback({
|
|
24
|
-
maxDepth: Math.min(maxScrollDepth, maxScrollHeight),
|
|
25
|
-
maxDepthScrollTop: scrollTop,
|
|
26
|
-
maxScrollHeight,
|
|
27
|
-
maxScrollHeightTime,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return {
|
|
32
|
-
stop: () => subscription.unsubscribe(),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export function computeScrollValues() {
|
|
36
|
-
const scrollTop = getScrollY();
|
|
37
|
-
const { height } = getViewportDimension();
|
|
38
|
-
const scrollHeight = Math.round((document.scrollingElement || document.documentElement).scrollHeight);
|
|
39
|
-
const scrollDepth = Math.round(height + scrollTop);
|
|
40
|
-
return {
|
|
41
|
-
scrollHeight,
|
|
42
|
-
scrollDepth,
|
|
43
|
-
scrollTop,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export function createScrollValuesObservable(configuration, throttleDuration = THROTTLE_SCROLL_DURATION) {
|
|
47
|
-
return new Observable((observable) => {
|
|
48
|
-
function notify() {
|
|
49
|
-
observable.notify(computeScrollValues());
|
|
50
|
-
}
|
|
51
|
-
if (window.ResizeObserver) {
|
|
52
|
-
const throttledNotify = throttle(notify, throttleDuration, {
|
|
53
|
-
leading: false,
|
|
54
|
-
trailing: true,
|
|
55
|
-
});
|
|
56
|
-
const observerTarget = document.scrollingElement || document.documentElement;
|
|
57
|
-
const resizeObserver = new ResizeObserver(monitor(throttledNotify.throttled));
|
|
58
|
-
if (observerTarget) {
|
|
59
|
-
resizeObserver.observe(observerTarget);
|
|
60
|
-
}
|
|
61
|
-
const eventListener = addEventListener(configuration, window, "scroll" /* DOM_EVENT.SCROLL */, throttledNotify.throttled, {
|
|
62
|
-
passive: true,
|
|
63
|
-
});
|
|
64
|
-
return () => {
|
|
65
|
-
throttledNotify.cancel();
|
|
66
|
-
resizeObserver.disconnect();
|
|
67
|
-
eventListener.stop();
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=trackScrollMetrics.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackScrollMetrics.js","sourceRoot":"","sources":["../../../../src/domain/view/viewMetrics/trackScrollMetrics.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EAC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,OAAO,GAAG,EAAE;gBACV,eAAe,CAAC,MAAM,EAAE,CAAA;gBACxB,cAAc,CAAC,UAAU,EAAE,CAAA;gBAC3B,aAAa,CAAC,IAAI,EAAE,CAAA;YACtB,CAAC,CAAA;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { ClocksState, Duration } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { LifeCycle } from '../lifeCycle';
|
|
3
|
-
import { VitalType } from '../../rawRumEvent.types';
|
|
4
|
-
import type { PageStateHistory } from '../contexts/pageStateHistory';
|
|
5
|
-
export interface VitalOptions {
|
|
6
|
-
context?: any;
|
|
7
|
-
description?: string;
|
|
8
|
-
}
|
|
9
|
-
export type DurationVitalOptions = VitalOptions;
|
|
10
|
-
export interface FeatureOperationOptions extends VitalOptions {
|
|
11
|
-
operationKey?: string;
|
|
12
|
-
}
|
|
13
|
-
export type FailureReason = 'error' | 'abandoned' | 'other';
|
|
14
|
-
export interface AddDurationVitalOptions extends DurationVitalOptions {
|
|
15
|
-
startTime: number;
|
|
16
|
-
duration: number;
|
|
17
|
-
}
|
|
18
|
-
export interface DurationVitalReference {
|
|
19
|
-
__kubesense_vital_reference: true;
|
|
20
|
-
}
|
|
21
|
-
export interface DurationVitalStart extends DurationVitalOptions {
|
|
22
|
-
name: string;
|
|
23
|
-
startClocks: ClocksState;
|
|
24
|
-
}
|
|
25
|
-
interface BaseVital extends VitalOptions {
|
|
26
|
-
name: string;
|
|
27
|
-
startClocks: ClocksState;
|
|
28
|
-
}
|
|
29
|
-
export interface DurationVital extends BaseVital {
|
|
30
|
-
type: typeof VitalType.DURATION;
|
|
31
|
-
duration: Duration;
|
|
32
|
-
}
|
|
33
|
-
export interface OperationStepVital extends BaseVital {
|
|
34
|
-
type: typeof VitalType.OPERATION_STEP;
|
|
35
|
-
stepType: 'start' | 'end';
|
|
36
|
-
operationKey?: string;
|
|
37
|
-
failureReason?: string;
|
|
38
|
-
}
|
|
39
|
-
export interface CustomVitalsState {
|
|
40
|
-
vitalsByName: Map<string, DurationVitalStart>;
|
|
41
|
-
vitalsByReference: WeakMap<DurationVitalReference, DurationVitalStart>;
|
|
42
|
-
}
|
|
43
|
-
export declare function createCustomVitalsState(): {
|
|
44
|
-
vitalsByName: Map<string, DurationVitalStart>;
|
|
45
|
-
vitalsByReference: WeakMap<DurationVitalReference, DurationVitalStart>;
|
|
46
|
-
};
|
|
47
|
-
export declare function startVitalCollection(lifeCycle: LifeCycle, pageStateHistory: PageStateHistory, customVitalsState: CustomVitalsState): {
|
|
48
|
-
addOperationStepVital: (name: string, stepType: "start" | "end", options?: FeatureOperationOptions, failureReason?: FailureReason) => void;
|
|
49
|
-
addDurationVital: (vital: DurationVital) => void;
|
|
50
|
-
startDurationVital: (name: string, options?: DurationVitalOptions) => DurationVitalReference;
|
|
51
|
-
stopDurationVital: (nameOrRef: string | DurationVitalReference, options?: DurationVitalOptions) => void;
|
|
52
|
-
};
|
|
53
|
-
export declare function startDurationVital({ vitalsByName, vitalsByReference }: CustomVitalsState, name: string, options?: DurationVitalOptions): DurationVitalReference;
|
|
54
|
-
export declare function stopDurationVital(stopCallback: (vital: DurationVital) => void, { vitalsByName, vitalsByReference }: CustomVitalsState, nameOrRef: string | DurationVitalReference, options?: DurationVitalOptions): void;
|
|
55
|
-
export {};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { clocksNow, combine, elapsed, ExperimentalFeature, generateUUID, isExperimentalFeatureEnabled, sanitize, toServerDuration, } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { RumEventType, VitalType } from '../../rawRumEvent.types';
|
|
3
|
-
export function createCustomVitalsState() {
|
|
4
|
-
const vitalsByName = new Map();
|
|
5
|
-
const vitalsByReference = new WeakMap();
|
|
6
|
-
return { vitalsByName, vitalsByReference };
|
|
7
|
-
}
|
|
8
|
-
export function startVitalCollection(lifeCycle, pageStateHistory, customVitalsState) {
|
|
9
|
-
function isValid(vital) {
|
|
10
|
-
return !pageStateHistory.wasInPageStateDuringPeriod("frozen" /* PageState.FROZEN */, vital.startClocks.relative, vital.duration);
|
|
11
|
-
}
|
|
12
|
-
function addDurationVital(vital) {
|
|
13
|
-
if (isValid(vital)) {
|
|
14
|
-
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processVital(vital));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function addOperationStepVital(name, stepType, options, failureReason) {
|
|
18
|
-
if (!isExperimentalFeatureEnabled(ExperimentalFeature.FEATURE_OPERATION_VITAL)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const { operationKey, context, description } = options || {};
|
|
22
|
-
const vital = {
|
|
23
|
-
name,
|
|
24
|
-
type: VitalType.OPERATION_STEP,
|
|
25
|
-
operationKey,
|
|
26
|
-
failureReason,
|
|
27
|
-
stepType,
|
|
28
|
-
startClocks: clocksNow(),
|
|
29
|
-
context: sanitize(context),
|
|
30
|
-
description,
|
|
31
|
-
};
|
|
32
|
-
lifeCycle.notify(12 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, processVital(vital));
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
addOperationStepVital,
|
|
36
|
-
addDurationVital,
|
|
37
|
-
startDurationVital: (name, options = {}) => startDurationVital(customVitalsState, name, options),
|
|
38
|
-
stopDurationVital: (nameOrRef, options = {}) => {
|
|
39
|
-
stopDurationVital(addDurationVital, customVitalsState, nameOrRef, options);
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export function startDurationVital({ vitalsByName, vitalsByReference }, name, options = {}) {
|
|
44
|
-
const vital = {
|
|
45
|
-
name,
|
|
46
|
-
startClocks: clocksNow(),
|
|
47
|
-
...options,
|
|
48
|
-
};
|
|
49
|
-
// To avoid leaking implementation details of the vital, we return a reference to it.
|
|
50
|
-
const reference = { __kubesense_vital_reference: true };
|
|
51
|
-
vitalsByName.set(name, vital);
|
|
52
|
-
// To avoid memory leaks caused by the creation of numerous references (e.g., from improper useEffect implementations), we use a WeakMap.
|
|
53
|
-
vitalsByReference.set(reference, vital);
|
|
54
|
-
return reference;
|
|
55
|
-
}
|
|
56
|
-
export function stopDurationVital(stopCallback, { vitalsByName, vitalsByReference }, nameOrRef, options = {}) {
|
|
57
|
-
const vitalStart = typeof nameOrRef === 'string' ? vitalsByName.get(nameOrRef) : vitalsByReference.get(nameOrRef);
|
|
58
|
-
if (!vitalStart) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
stopCallback(buildDurationVital(vitalStart, vitalStart.startClocks, options, clocksNow()));
|
|
62
|
-
if (typeof nameOrRef === 'string') {
|
|
63
|
-
vitalsByName.delete(nameOrRef);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
vitalsByReference.delete(nameOrRef);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
function buildDurationVital(vitalStart, startClocks, stopOptions, stopClocks) {
|
|
70
|
-
var _a;
|
|
71
|
-
return {
|
|
72
|
-
name: vitalStart.name,
|
|
73
|
-
type: VitalType.DURATION,
|
|
74
|
-
startClocks,
|
|
75
|
-
duration: elapsed(startClocks.timeStamp, stopClocks.timeStamp),
|
|
76
|
-
context: combine(vitalStart.context, stopOptions.context),
|
|
77
|
-
description: (_a = stopOptions.description) !== null && _a !== void 0 ? _a : vitalStart.description,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function processVital(vital) {
|
|
81
|
-
const { startClocks, type, name, description, context } = vital;
|
|
82
|
-
const vitalData = {
|
|
83
|
-
id: generateUUID(),
|
|
84
|
-
type,
|
|
85
|
-
name,
|
|
86
|
-
description,
|
|
87
|
-
...(type === VitalType.DURATION
|
|
88
|
-
? { duration: toServerDuration(vital.duration) }
|
|
89
|
-
: {
|
|
90
|
-
step_type: vital.stepType,
|
|
91
|
-
operation_key: vital.operationKey,
|
|
92
|
-
failure_reason: vital.failureReason,
|
|
93
|
-
}),
|
|
94
|
-
};
|
|
95
|
-
return {
|
|
96
|
-
rawRumEvent: {
|
|
97
|
-
date: startClocks.timeStamp,
|
|
98
|
-
vital: vitalData,
|
|
99
|
-
type: RumEventType.VITAL,
|
|
100
|
-
context,
|
|
101
|
-
},
|
|
102
|
-
startTime: startClocks.relative,
|
|
103
|
-
duration: type === VitalType.DURATION ? vital.duration : undefined,
|
|
104
|
-
domainContext: {},
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=vitalCollection.js.map
|