@kubesense/kubesense-browser-rum-core 1.8.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,278 +0,0 @@
|
|
|
1
|
-
import { noop, PageExitReason, shallowClone, elapsed, generateUUID, ONE_MINUTE, throttle, clocksNow, clocksOrigin, relativeToClocks, timeStampNow, display, looksLikeRelativeTime, setInterval, clearInterval, setTimeout, Observable, createContextManager, } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { ViewLoadingType } from '../../rawRumEvent.types';
|
|
3
|
-
import { trackViewEventCounts } from './trackViewEventCounts';
|
|
4
|
-
import { trackInitialViewMetrics } from './viewMetrics/trackInitialViewMetrics';
|
|
5
|
-
import { trackCommonViewMetrics } from './viewMetrics/trackCommonViewMetrics';
|
|
6
|
-
import { onBFCacheRestore } from './bfCacheSupport';
|
|
7
|
-
import { trackBfcacheMetrics } from './viewMetrics/trackBfcacheMetrics';
|
|
8
|
-
export const THROTTLE_VIEW_UPDATE_PERIOD = 3000;
|
|
9
|
-
export const SESSION_KEEP_ALIVE_INTERVAL = 5 * ONE_MINUTE;
|
|
10
|
-
// Some events or metrics can be captured after the end of the view. To avoid missing those;
|
|
11
|
-
// an arbitrary delay is added for stopping their tracking after the view ends.
|
|
12
|
-
//
|
|
13
|
-
// Ideally, we would not stop and keep tracking events or metrics until the end of the session.
|
|
14
|
-
// But this might have a small performance impact if there are many many views.
|
|
15
|
-
// So let's have a fairly short delay improving the situation in most cases and avoid impacting performances too much.
|
|
16
|
-
export const KEEP_TRACKING_AFTER_VIEW_DELAY = 5 * ONE_MINUTE;
|
|
17
|
-
export function trackViews(location, lifeCycle, domMutationObservable, windowOpenObservable, configuration, locationChangeObservable, areViewsTrackedAutomatically, initialViewOptions) {
|
|
18
|
-
const activeViews = new Set();
|
|
19
|
-
let currentView = startNewView(ViewLoadingType.INITIAL_LOAD, clocksOrigin(), initialViewOptions);
|
|
20
|
-
let stopOnBFCacheRestore;
|
|
21
|
-
startViewLifeCycle();
|
|
22
|
-
let locationChangeSubscription;
|
|
23
|
-
if (areViewsTrackedAutomatically) {
|
|
24
|
-
locationChangeSubscription = renewViewOnLocationChange(locationChangeObservable);
|
|
25
|
-
if (configuration.trackBfcacheViews) {
|
|
26
|
-
stopOnBFCacheRestore = onBFCacheRestore(configuration, (pageshowEvent) => {
|
|
27
|
-
currentView.end();
|
|
28
|
-
const startClocks = relativeToClocks(pageshowEvent.timeStamp);
|
|
29
|
-
currentView = startNewView(ViewLoadingType.BF_CACHE, startClocks, undefined);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function startNewView(loadingType, startClocks, viewOptions) {
|
|
34
|
-
const newlyCreatedView = newView(lifeCycle, domMutationObservable, windowOpenObservable, configuration, location, loadingType, startClocks, viewOptions);
|
|
35
|
-
activeViews.add(newlyCreatedView);
|
|
36
|
-
newlyCreatedView.stopObservable.subscribe(() => {
|
|
37
|
-
activeViews.delete(newlyCreatedView);
|
|
38
|
-
});
|
|
39
|
-
return newlyCreatedView;
|
|
40
|
-
}
|
|
41
|
-
function startViewLifeCycle() {
|
|
42
|
-
lifeCycle.subscribe(10 /* LifeCycleEventType.SESSION_RENEWED */, () => {
|
|
43
|
-
// Renew view on session renewal
|
|
44
|
-
currentView = startNewView(ViewLoadingType.ROUTE_CHANGE, undefined, {
|
|
45
|
-
name: currentView.name,
|
|
46
|
-
service: currentView.service,
|
|
47
|
-
version: currentView.version,
|
|
48
|
-
context: currentView.contextManager.getContext(),
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
lifeCycle.subscribe(9 /* LifeCycleEventType.SESSION_EXPIRED */, () => {
|
|
52
|
-
currentView.end({ sessionIsActive: false });
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function renewViewOnLocationChange(locationChangeObservable) {
|
|
56
|
-
return locationChangeObservable.subscribe(({ oldLocation, newLocation }) => {
|
|
57
|
-
if (areDifferentLocation(oldLocation, newLocation)) {
|
|
58
|
-
currentView.end();
|
|
59
|
-
currentView = startNewView(ViewLoadingType.ROUTE_CHANGE);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
addTiming: (name, time = timeStampNow()) => {
|
|
65
|
-
currentView.addTiming(name, time);
|
|
66
|
-
},
|
|
67
|
-
startView: (options, startClocks) => {
|
|
68
|
-
currentView.end({ endClocks: startClocks });
|
|
69
|
-
currentView = startNewView(ViewLoadingType.ROUTE_CHANGE, startClocks, options);
|
|
70
|
-
},
|
|
71
|
-
setViewContext: (context) => {
|
|
72
|
-
currentView.contextManager.setContext(context);
|
|
73
|
-
},
|
|
74
|
-
setViewContextProperty: (key, value) => {
|
|
75
|
-
currentView.contextManager.setContextProperty(key, value);
|
|
76
|
-
},
|
|
77
|
-
setViewName: (name) => {
|
|
78
|
-
currentView.setViewName(name);
|
|
79
|
-
},
|
|
80
|
-
getViewContext: () => currentView.contextManager.getContext(),
|
|
81
|
-
stop: () => {
|
|
82
|
-
if (locationChangeSubscription) {
|
|
83
|
-
locationChangeSubscription.unsubscribe();
|
|
84
|
-
}
|
|
85
|
-
if (stopOnBFCacheRestore) {
|
|
86
|
-
stopOnBFCacheRestore();
|
|
87
|
-
}
|
|
88
|
-
currentView.end();
|
|
89
|
-
activeViews.forEach((view) => view.stop());
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function newView(lifeCycle, domMutationObservable, windowOpenObservable, configuration, initialLocation, loadingType, startClocks = clocksNow(), viewOptions) {
|
|
94
|
-
// Setup initial values
|
|
95
|
-
const id = generateUUID();
|
|
96
|
-
const stopObservable = new Observable();
|
|
97
|
-
const customTimings = {};
|
|
98
|
-
let documentVersion = 0;
|
|
99
|
-
let endClocks;
|
|
100
|
-
const location = shallowClone(initialLocation);
|
|
101
|
-
const contextManager = createContextManager();
|
|
102
|
-
let sessionIsActive = true;
|
|
103
|
-
let name = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.name;
|
|
104
|
-
const service = (viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.service) || configuration.service;
|
|
105
|
-
const version = (viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.version) || configuration.version;
|
|
106
|
-
const context = viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.context;
|
|
107
|
-
if (context) {
|
|
108
|
-
contextManager.setContext(context);
|
|
109
|
-
}
|
|
110
|
-
const viewCreatedEvent = {
|
|
111
|
-
id,
|
|
112
|
-
name,
|
|
113
|
-
startClocks,
|
|
114
|
-
service,
|
|
115
|
-
version,
|
|
116
|
-
context,
|
|
117
|
-
};
|
|
118
|
-
lifeCycle.notify(1 /* LifeCycleEventType.BEFORE_VIEW_CREATED */, viewCreatedEvent);
|
|
119
|
-
lifeCycle.notify(2 /* LifeCycleEventType.VIEW_CREATED */, viewCreatedEvent);
|
|
120
|
-
// Update the view every time the measures are changing
|
|
121
|
-
const { throttled, cancel: cancelScheduleViewUpdate } = throttle(triggerViewUpdate, THROTTLE_VIEW_UPDATE_PERIOD, {
|
|
122
|
-
leading: false,
|
|
123
|
-
});
|
|
124
|
-
const { setLoadEvent, setViewEnd, stop: stopCommonViewMetricsTracking, stopINPTracking, getCommonViewMetrics, } = trackCommonViewMetrics(lifeCycle, domMutationObservable, windowOpenObservable, configuration, scheduleViewUpdate, loadingType, startClocks);
|
|
125
|
-
const { stop: stopInitialViewMetricsTracking, initialViewMetrics } = loadingType === ViewLoadingType.INITIAL_LOAD
|
|
126
|
-
? trackInitialViewMetrics(configuration, startClocks, setLoadEvent, scheduleViewUpdate)
|
|
127
|
-
: { stop: noop, initialViewMetrics: {} };
|
|
128
|
-
// Start BFCache-specific metrics when restoring from BFCache
|
|
129
|
-
if (loadingType === ViewLoadingType.BF_CACHE) {
|
|
130
|
-
trackBfcacheMetrics(startClocks, initialViewMetrics, scheduleViewUpdate);
|
|
131
|
-
}
|
|
132
|
-
const { stop: stopEventCountsTracking, eventCounts } = trackViewEventCounts(lifeCycle, id, scheduleViewUpdate);
|
|
133
|
-
// Session keep alive
|
|
134
|
-
const keepAliveIntervalId = setInterval(triggerViewUpdate, SESSION_KEEP_ALIVE_INTERVAL);
|
|
135
|
-
const pageMayExitSubscription = lifeCycle.subscribe(11 /* LifeCycleEventType.PAGE_MAY_EXIT */, (pageMayExitEvent) => {
|
|
136
|
-
// beforeunload is the unreliable half of this: it is skipped on mobile and
|
|
137
|
-
// when a tab is discarded, while pagehide fires on the paths it misses. The
|
|
138
|
-
// replay recorder already flushes on every exit reason, which is how a
|
|
139
|
-
// session ends up with a segment recorded after the last view update the
|
|
140
|
-
// backend ever saw — the view then stays active, and the session's duration
|
|
141
|
-
// is reported without its final and usually longest view.
|
|
142
|
-
if (pageMayExitEvent.reason === PageExitReason.UNLOADING ||
|
|
143
|
-
pageMayExitEvent.reason === PageExitReason.PAGEHIDE) {
|
|
144
|
-
// Force the final emission's isActive=false without mutating endClocks.
|
|
145
|
-
// Why this matters: the regular triggerViewUpdate computes
|
|
146
|
-
// `isActive: endClocks === undefined`, which is `true` here because we
|
|
147
|
-
// haven't called end(). If we leave the final pre-unload event with
|
|
148
|
-
// isActive=true the view sits in rum_view_raw permanently active —
|
|
149
|
-
// the backend cron only aggregates inactive views, so the view stays
|
|
150
|
-
// invisible to rum_view (and session aggregations) until a 10-minute
|
|
151
|
-
// stale-view fallback force-finalizes it.
|
|
152
|
-
// Why not just set endClocks here: beforeunload is not guaranteed to
|
|
153
|
-
// be followed by an actual unload (the user can cancel navigation in
|
|
154
|
-
// some flows). If we permanently set endClocks, setViewEnd() would
|
|
155
|
-
// also fire — which calls stopViewInteractionCount() and stops INP /
|
|
156
|
-
// interaction tracking for the rest of the page's life, and any later
|
|
157
|
-
// addTiming() calls are silently dropped (see the endClocks guard in
|
|
158
|
-
// addTiming). Forcing the override only on this one emission keeps
|
|
159
|
-
// the view fully recoverable if the page survives.
|
|
160
|
-
triggerViewUpdate(true);
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
// Initial view update
|
|
164
|
-
triggerViewUpdate();
|
|
165
|
-
// View context update should always be throttled
|
|
166
|
-
contextManager.changeObservable.subscribe(scheduleViewUpdate);
|
|
167
|
-
function triggerBeforeViewUpdate() {
|
|
168
|
-
lifeCycle.notify(3 /* LifeCycleEventType.BEFORE_VIEW_UPDATED */, {
|
|
169
|
-
id,
|
|
170
|
-
name,
|
|
171
|
-
context: contextManager.getContext(),
|
|
172
|
-
startClocks,
|
|
173
|
-
sessionIsActive,
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
function scheduleViewUpdate() {
|
|
177
|
-
triggerBeforeViewUpdate();
|
|
178
|
-
throttled();
|
|
179
|
-
}
|
|
180
|
-
function triggerViewUpdate(forceInactive = false) {
|
|
181
|
-
cancelScheduleViewUpdate();
|
|
182
|
-
triggerBeforeViewUpdate();
|
|
183
|
-
documentVersion += 1;
|
|
184
|
-
const currentEnd = endClocks === undefined ? timeStampNow() : endClocks.timeStamp;
|
|
185
|
-
lifeCycle.notify(4 /* LifeCycleEventType.VIEW_UPDATED */, {
|
|
186
|
-
customTimings,
|
|
187
|
-
documentVersion,
|
|
188
|
-
id,
|
|
189
|
-
name,
|
|
190
|
-
service,
|
|
191
|
-
version,
|
|
192
|
-
context: contextManager.getContext(),
|
|
193
|
-
loadingType,
|
|
194
|
-
location,
|
|
195
|
-
startClocks,
|
|
196
|
-
commonViewMetrics: getCommonViewMetrics(),
|
|
197
|
-
initialViewMetrics,
|
|
198
|
-
duration: elapsed(startClocks.timeStamp, currentEnd),
|
|
199
|
-
// forceInactive is set by the page-unload handler so the final emission
|
|
200
|
-
// is marked inactive without permanently ending the view (see comment
|
|
201
|
-
// there). All other call sites use the natural endClocks-based check.
|
|
202
|
-
isActive: !forceInactive && endClocks === undefined,
|
|
203
|
-
sessionIsActive,
|
|
204
|
-
eventCounts,
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
return {
|
|
208
|
-
get name() {
|
|
209
|
-
return name;
|
|
210
|
-
},
|
|
211
|
-
service,
|
|
212
|
-
version,
|
|
213
|
-
contextManager,
|
|
214
|
-
stopObservable,
|
|
215
|
-
end(options = {}) {
|
|
216
|
-
var _a, _b;
|
|
217
|
-
if (endClocks) {
|
|
218
|
-
// view already ended
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
endClocks = (_a = options.endClocks) !== null && _a !== void 0 ? _a : clocksNow();
|
|
222
|
-
sessionIsActive = (_b = options.sessionIsActive) !== null && _b !== void 0 ? _b : true;
|
|
223
|
-
lifeCycle.notify(5 /* LifeCycleEventType.VIEW_ENDED */, { endClocks });
|
|
224
|
-
lifeCycle.notify(6 /* LifeCycleEventType.AFTER_VIEW_ENDED */, { endClocks });
|
|
225
|
-
clearInterval(keepAliveIntervalId);
|
|
226
|
-
setViewEnd(endClocks.relative);
|
|
227
|
-
stopCommonViewMetricsTracking();
|
|
228
|
-
pageMayExitSubscription.unsubscribe();
|
|
229
|
-
triggerViewUpdate();
|
|
230
|
-
setTimeout(() => {
|
|
231
|
-
this.stop();
|
|
232
|
-
}, KEEP_TRACKING_AFTER_VIEW_DELAY);
|
|
233
|
-
},
|
|
234
|
-
stop() {
|
|
235
|
-
stopInitialViewMetricsTracking();
|
|
236
|
-
stopEventCountsTracking();
|
|
237
|
-
stopINPTracking();
|
|
238
|
-
stopObservable.notify();
|
|
239
|
-
},
|
|
240
|
-
addTiming(name, time) {
|
|
241
|
-
if (endClocks) {
|
|
242
|
-
return;
|
|
243
|
-
}
|
|
244
|
-
const relativeTime = looksLikeRelativeTime(time) ? time : elapsed(startClocks.timeStamp, time);
|
|
245
|
-
customTimings[sanitizeTiming(name)] = relativeTime;
|
|
246
|
-
scheduleViewUpdate();
|
|
247
|
-
},
|
|
248
|
-
setViewName(updatedName) {
|
|
249
|
-
name = updatedName;
|
|
250
|
-
triggerViewUpdate();
|
|
251
|
-
},
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Timing name is used as facet path that must contain only letters, digits, or the characters - _ . @ $
|
|
256
|
-
*/
|
|
257
|
-
function sanitizeTiming(name) {
|
|
258
|
-
const sanitized = name.replace(/[^a-zA-Z0-9-_.@$]/g, '_');
|
|
259
|
-
if (sanitized !== name) {
|
|
260
|
-
display.warn(`Invalid timing name: ${name}, sanitized to: ${sanitized}`);
|
|
261
|
-
}
|
|
262
|
-
return sanitized;
|
|
263
|
-
}
|
|
264
|
-
function areDifferentLocation(currentLocation, otherLocation) {
|
|
265
|
-
return (currentLocation.pathname !== otherLocation.pathname ||
|
|
266
|
-
(!isHashAnAnchor(otherLocation.hash) &&
|
|
267
|
-
getPathFromHash(otherLocation.hash) !== getPathFromHash(currentLocation.hash)));
|
|
268
|
-
}
|
|
269
|
-
function isHashAnAnchor(hash) {
|
|
270
|
-
const correspondingId = hash.substring(1);
|
|
271
|
-
// check if the correspondingId is empty because on Firefox an empty string passed to getElementById() prints a consol warning
|
|
272
|
-
return correspondingId !== '' && !!document.getElementById(correspondingId);
|
|
273
|
-
}
|
|
274
|
-
function getPathFromHash(hash) {
|
|
275
|
-
const index = hash.indexOf('?');
|
|
276
|
-
return index < 0 ? hash : hash.slice(0, index);
|
|
277
|
-
}
|
|
278
|
-
//# sourceMappingURL=trackViews.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trackViews.js","sourceRoot":"","sources":["../../../src/domain/view/trackViews.ts"],"names":[],"mappings":"AASA,OAAO,EACL,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,EACV,oBAAoB,GACrB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAOzD,OAAO,E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,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;AAChD,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Observable } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { RecorderApi } from '../../boot/rumPublicApi';
|
|
3
|
-
import type { LifeCycle } from '../lifeCycle';
|
|
4
|
-
import type { LocationChange } from '../../browser/locationChangeObservable';
|
|
5
|
-
import type { RumConfiguration } from '../configuration';
|
|
6
|
-
import type { ViewHistory } from '../contexts/viewHistory';
|
|
7
|
-
import type { Hooks } from '../hooks';
|
|
8
|
-
import type { RumMutationRecord } from '../../browser/domMutationObservable';
|
|
9
|
-
import type { ViewOptions } from './trackViews';
|
|
10
|
-
export declare function startViewCollection(lifeCycle: LifeCycle, hooks: Hooks, configuration: RumConfiguration, location: Location, domMutationObservable: Observable<RumMutationRecord[]>, pageOpenObservable: Observable<void>, locationChangeObservable: Observable<LocationChange>, recorderApi: RecorderApi, viewHistory: ViewHistory, initialViewOptions?: ViewOptions): {
|
|
11
|
-
addTiming: (name: string, time?: import("@kubesense/kubesense-browser-core").RelativeTime | import("@kubesense/kubesense-browser-core").TimeStamp) => void;
|
|
12
|
-
startView: (options?: ViewOptions, startClocks?: import("@kubesense/kubesense-browser-core").ClocksState) => void;
|
|
13
|
-
setViewContext: (context: import("@kubesense/kubesense-browser-core").Context) => void;
|
|
14
|
-
setViewContextProperty: (key: string, value: import("@kubesense/kubesense-browser-core").ContextValue) => void;
|
|
15
|
-
setViewName: (name: string) => void;
|
|
16
|
-
getViewContext: () => import("@kubesense/kubesense-browser-core").Context;
|
|
17
|
-
stop: () => void;
|
|
18
|
-
};
|
|
@@ -1,150 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,MAAM,mCAAmC,CAAA;AACjI,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAGpE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAQtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,MAAM,UAAU,mBAAmB,CACjC,SAAoB,EACpB,KAAY,EACZ,aAA+B,EAC/B,QAAkB,EAClB,qBAAsD,EACtD,kBAAoC,EACpC,wBAAoD,EACpD,WAAwB,EACxB,WAAwB,EACxB,kBAAgC;IAEhC,SAAS,CAAC,SAAS,0CAAkC,CAAC,IAAI,EAAE,EAAE,CAC5D,SAAS,CAAC,MAAM,sDAA6C,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAClH,CAAA;IAED,KAAK,CAAC,QAAQ,6BAAqB,CAAC,EAAE,SAAS,EAAE,SAAS,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AAE,qBAAqB,CAAC,YAAY;YACjD,YAAY,EAAE,qBAAqB,CAAC,WAAW;SAChD;QACD,GAAG,EAAE,oBAAoB,IAAI,EAAE,SAAS,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,EAAE;QAClF,GAAG,EAAE,UAAU,IAAI;YACjB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAAC;YAC5C,SAAS,EAAE,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC;YAC5C,eAAe,EAAE,UAAU,CAAC,cAAc;SAC3C;QACD,GAAG,EAAE,sBAAsB,IAAI;YAC7B,QAAQ,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,KAAK,CAAC;YACxD,SAAS,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,IAAI,CAAC;YACxD,eAAe,EAAE,sBAAsB,CAAC,cAAc;SACvD;QACD,GAAG,EAAE,sBAAsB,IAAI;YAC7B,SAAS,EAAE,gBAAgB,CAAC,sBAAsB,CAAC,KAAK,CAAC;YACzD,eAAe,EAAE,sBAAsB,CAAC,cAAc;YACtD,YAAY,EAAE,sBAAsB,CAAC,WAAW;SACjD;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
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;
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,18 +0,0 @@
|
|
|
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;
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|