@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookieObservable.js","
|
|
1
|
+
{"version":3,"file":"cookieObservable.js","names":["isCookieStoreSupported","Observable","addEventListener","globalObject","DOM_EVENT","ONE_SECOND","getCookie","setInterval"],"sources":["../../src/browser/cookieObservable.ts"],"sourcesContent":["import { globalObject } from '@kubesense/kubesense-js-core/util'\nimport { ONE_SECOND } from '@kubesense/kubesense-js-core/time'\nimport {\n setInterval,\n clearInterval,\n Observable,\n addEventListener,\n DOM_EVENT,\n getCookie,\n isCookieStoreSupported,\n} from '@kubesense/kubesense-browser-core'\n\nexport type CookieObservable = ReturnType<typeof createCookieObservable>\n\nexport function createCookieObservable(cookieName: string) {\n const detectCookieChangeStrategy = isCookieStoreSupported() ? listenToCookieStoreChange() : watchCookieFallback\n\n return new Observable<string | undefined>((observable) =>\n detectCookieChangeStrategy(cookieName, (event) => observable.notify(event))\n )\n}\n\nfunction listenToCookieStoreChange() {\n return (cookieName: string, callback: (event: string | undefined) => void) => {\n const listener = addEventListener(globalObject.cookieStore!, DOM_EVENT.CHANGE, (event) => {\n // Based on our experimentation, we're assuming that entries for the same cookie cannot be in both the 'changed' and 'deleted' arrays.\n // However, due to ambiguity in the specification, we asked for clarification: https://github.com/WICG/cookie-store/issues/226\n const changeEvent =\n event.changed.find((event) => event.name === cookieName) ||\n event.deleted.find((event) => event.name === cookieName)\n if (changeEvent) {\n callback(changeEvent.value)\n }\n })\n return listener.stop\n }\n}\n\nexport const WATCH_COOKIE_INTERVAL_DELAY = ONE_SECOND\n\nfunction watchCookieFallback(cookieName: string, callback: (event: string | undefined) => void) {\n let previousCookieValue = getCookie(cookieName)\n const watchCookieIntervalId = setInterval(() => {\n const cookieValue = getCookie(cookieName)\n if (cookieValue !== previousCookieValue) {\n previousCookieValue = cookieValue\n callback(cookieValue)\n }\n }, WATCH_COOKIE_INTERVAL_DELAY)\n\n return () => {\n clearInterval(watchCookieIntervalId)\n }\n}\n"],"mappings":";;;;AAcA,SAAgB,uBAAuB,YAAoB;CACzD,MAAM,8BAAA,GAA6BA,kCAAAA,uBAAAA,CAAuB,IAAI,0BAA0B,IAAI;CAE5F,OAAO,IAAIC,kCAAAA,YAAgC,eACzC,2BAA2B,aAAa,UAAU,WAAW,OAAO,KAAK,CAAC,CAC5E;AACF;AAEA,SAAS,4BAA4B;CACnC,QAAQ,YAAoB,aAAkD;EAW5E,QAAA,GAViBC,kCAAAA,iBAAAA,CAAiBC,kCAAAA,aAAa,aAAcC,kCAAAA,UAAU,SAAS,UAAU;GAGxF,MAAM,cACJ,MAAM,QAAQ,MAAM,UAAU,MAAM,SAAS,UAAU,KACvD,MAAM,QAAQ,MAAM,UAAU,MAAM,SAAS,UAAU;GACzD,IAAI,aACF,SAAS,YAAY,KAAK;EAE9B,CACc,CAAC,CAAC;CAClB;AACF;AAEA,MAAa,8BAA8BC,kCAAAA;AAE3C,SAAS,oBAAoB,YAAoB,UAA+C;CAC9F,IAAI,uBAAA,GAAsBC,kCAAAA,UAAAA,CAAU,UAAU;CAC9C,MAAM,yBAAA,GAAwBC,kCAAAA,YAAAA,OAAkB;EAC9C,MAAM,eAAA,GAAcD,kCAAAA,UAAAA,CAAU,UAAU;EACxC,IAAI,gBAAgB,qBAAqB;GACvC,sBAAsB;GACtB,SAAS,WAAW;EACtB;CACF,GAAG,2BAA2B;CAE9B,aAAa;EACX,CAAA,GAAA,kCAAA,cAAA,CAAc,qBAAqB;CACrC;AACF"}
|
|
@@ -8,7 +8,7 @@ export interface RumAttributesMutationRecord {
|
|
|
8
8
|
type: 'attributes';
|
|
9
9
|
target: Element;
|
|
10
10
|
oldValue: string | null;
|
|
11
|
-
attributeName: string
|
|
11
|
+
attributeName: string;
|
|
12
12
|
}
|
|
13
13
|
export interface RumChildListMutationRecord {
|
|
14
14
|
type: 'childList';
|
|
@@ -20,8 +20,8 @@ export type RumMutationRecord = RumCharacterDataMutationRecord | RumAttributesMu
|
|
|
20
20
|
export declare function createDOMMutationObservable(): Observable<RumMutationRecord[]>;
|
|
21
21
|
type MutationObserverConstructor = new (callback: (records: RumMutationRecord[]) => void) => MutationObserver;
|
|
22
22
|
export interface BrowserWindow extends Window {
|
|
23
|
-
MutationObserver
|
|
23
|
+
MutationObserver: MutationObserverConstructor;
|
|
24
24
|
Zone?: unknown;
|
|
25
25
|
}
|
|
26
|
-
export declare function getMutationObserverConstructor(): MutationObserverConstructor
|
|
26
|
+
export declare function getMutationObserverConstructor(): MutationObserverConstructor;
|
|
27
27
|
export {};
|
|
@@ -1,58 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.getMutationObserverConstructor = getMutationObserverConstructor;
|
|
5
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
1
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
2
|
+
let _kubesense_kubesense_js_core_monitor = require("@kubesense/kubesense-js-core/monitor");
|
|
3
|
+
//#region src/browser/domMutationObservable.ts
|
|
6
4
|
function createDOMMutationObservable() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
return () => observer.disconnect();
|
|
20
|
-
});
|
|
5
|
+
const MutationObserver = getMutationObserverConstructor();
|
|
6
|
+
return new _kubesense_kubesense_browser_core.Observable((observable) => {
|
|
7
|
+
const observer = new MutationObserver((0, _kubesense_kubesense_js_core_monitor.monitor)((records) => observable.notify(records)));
|
|
8
|
+
observer.observe(document, {
|
|
9
|
+
attributes: true,
|
|
10
|
+
characterData: true,
|
|
11
|
+
childList: true,
|
|
12
|
+
subtree: true
|
|
13
|
+
});
|
|
14
|
+
return () => observer.disconnect();
|
|
15
|
+
});
|
|
21
16
|
}
|
|
22
17
|
function getMutationObserverConstructor() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// [1] https://github.com/angular/angular/issues/26948
|
|
35
|
-
// [2] https://github.com/angular/angular/issues/31712
|
|
36
|
-
if (browserWindow.Zone) {
|
|
37
|
-
// Zone.js 0.8.6+ is storing original class constructors into the browser 'window' object[3].
|
|
38
|
-
//
|
|
39
|
-
// [3] https://github.com/angular/angular/blob/6375fa79875c0fe7b815efc45940a6e6f5c9c9eb/packages/zone.js/lib/common/utils.ts#L288
|
|
40
|
-
constructor = (0, kubesense_browser_core_1.getZoneJsOriginalValue)(browserWindow, 'MutationObserver');
|
|
41
|
-
if (browserWindow.MutationObserver && constructor === browserWindow.MutationObserver) {
|
|
42
|
-
// Anterior Zone.js versions (used in Angular 2) does not expose the original MutationObserver
|
|
43
|
-
// in the 'window' object. Luckily, the patched MutationObserver class is storing an original
|
|
44
|
-
// instance in its properties[4]. Let's get the original MutationObserver constructor from
|
|
45
|
-
// there.
|
|
46
|
-
//
|
|
47
|
-
// [4] https://github.com/angular/zone.js/blob/v0.8.5/lib/common/utils.ts#L412
|
|
48
|
-
const patchedInstance = new browserWindow.MutationObserver(kubesense_browser_core_1.noop);
|
|
49
|
-
const originalInstance = (0, kubesense_browser_core_1.getZoneJsOriginalValue)(patchedInstance, 'originalInstance');
|
|
50
|
-
constructor = originalInstance && originalInstance.constructor;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (!constructor) {
|
|
54
|
-
constructor = browserWindow.MutationObserver;
|
|
55
|
-
}
|
|
56
|
-
return constructor;
|
|
18
|
+
let constructor;
|
|
19
|
+
const browserWindow = window;
|
|
20
|
+
if (browserWindow.Zone) {
|
|
21
|
+
constructor = (0, _kubesense_kubesense_browser_core.getZoneJsOriginalValue)(browserWindow, "MutationObserver");
|
|
22
|
+
if (browserWindow.MutationObserver && constructor === browserWindow.MutationObserver) {
|
|
23
|
+
const patchedInstance = new browserWindow.MutationObserver(_kubesense_kubesense_browser_core.noop);
|
|
24
|
+
constructor = (0, _kubesense_kubesense_browser_core.getZoneJsOriginalValue)(patchedInstance, "originalInstance")?.constructor;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (!constructor) constructor = browserWindow.MutationObserver;
|
|
28
|
+
return constructor;
|
|
57
29
|
}
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.createDOMMutationObservable = createDOMMutationObservable;
|
|
32
|
+
exports.getMutationObserverConstructor = getMutationObserverConstructor;
|
|
33
|
+
|
|
58
34
|
//# sourceMappingURL=domMutationObservable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domMutationObservable.js","
|
|
1
|
+
{"version":3,"file":"domMutationObservable.js","names":["Observable","monitor","getZoneJsOriginalValue","noop"],"sources":["../../src/browser/domMutationObservable.ts"],"sourcesContent":["import { monitor } from '@kubesense/kubesense-js-core/monitor'\nimport { noop, Observable, getZoneJsOriginalValue } from '@kubesense/kubesense-browser-core'\n\n// https://dom.spec.whatwg.org/#interface-mutationrecord\nexport interface RumCharacterDataMutationRecord {\n type: 'characterData'\n target: Node\n oldValue: string | null\n}\n\nexport interface RumAttributesMutationRecord {\n type: 'attributes'\n target: Element\n oldValue: string | null\n attributeName: string\n}\n\nexport interface RumChildListMutationRecord {\n type: 'childList'\n target: Node\n addedNodes: NodeList\n removedNodes: NodeList\n}\n\nexport type RumMutationRecord =\n RumCharacterDataMutationRecord | RumAttributesMutationRecord | RumChildListMutationRecord\n\nexport function createDOMMutationObservable() {\n const MutationObserver = getMutationObserverConstructor()\n\n return new Observable<RumMutationRecord[]>((observable) => {\n const observer = new MutationObserver(monitor((records) => observable.notify(records)))\n observer.observe(document, {\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n })\n return () => observer.disconnect()\n })\n}\n\ntype MutationObserverConstructor = new (callback: (records: RumMutationRecord[]) => void) => MutationObserver\n\nexport interface BrowserWindow extends Window {\n MutationObserver: MutationObserverConstructor\n Zone?: unknown\n}\n\nexport function getMutationObserverConstructor(): MutationObserverConstructor {\n let constructor: MutationObserverConstructor | undefined\n const browserWindow = window as BrowserWindow\n\n // Angular uses Zone.js to provide a context persisting across async tasks. Zone.js replaces the\n // global MutationObserver constructor with a patched version to support the context propagation.\n // There is an ongoing issue[1][2] with this setup when using a MutationObserver within a Angular\n // component: on some occasions, the callback is being called in an infinite loop, causing the\n // page to freeze (even if the callback is completely empty).\n //\n // To work around this issue, we try to get the original MutationObserver constructor stored by\n // Zone.js.\n //\n // [1] https://github.com/angular/angular/issues/26948\n // [2] https://github.com/angular/angular/issues/31712\n if (browserWindow.Zone) {\n // Zone.js 0.8.6+ is storing original class constructors into the browser 'window' object[3].\n //\n // [3] https://github.com/angular/angular/blob/6375fa79875c0fe7b815efc45940a6e6f5c9c9eb/packages/zone.js/lib/common/utils.ts#L288\n constructor = getZoneJsOriginalValue(browserWindow, 'MutationObserver')\n\n if (browserWindow.MutationObserver && constructor === browserWindow.MutationObserver) {\n // Anterior Zone.js versions (used in Angular 2) does not expose the original MutationObserver\n // in the 'window' object. Luckily, the patched MutationObserver class is storing an original\n // instance in its properties[4]. Let's get the original MutationObserver constructor from\n // there.\n //\n // [4] https://github.com/angular/zone.js/blob/v0.8.5/lib/common/utils.ts#L412\n\n const patchedInstance = new browserWindow.MutationObserver(noop) as {\n originalInstance?: { constructor: MutationObserverConstructor }\n }\n\n const originalInstance = getZoneJsOriginalValue(patchedInstance, 'originalInstance')\n constructor = originalInstance?.constructor\n }\n }\n\n if (!constructor) {\n constructor = browserWindow.MutationObserver\n }\n\n return constructor\n}\n"],"mappings":";;;AA2BA,SAAgB,8BAA8B;CAC5C,MAAM,mBAAmB,+BAA+B;CAExD,OAAO,IAAIA,kCAAAA,YAAiC,eAAe;EACzD,MAAM,WAAW,IAAI,kBAAA,GAAiBC,qCAAAA,QAAAA,EAAS,YAAY,WAAW,OAAO,OAAO,CAAC,CAAC;EACtF,SAAS,QAAQ,UAAU;GACzB,YAAY;GACZ,eAAe;GACf,WAAW;GACX,SAAS;EACX,CAAC;EACD,aAAa,SAAS,WAAW;CACnC,CAAC;AACH;AASA,SAAgB,iCAA8D;CAC5E,IAAI;CACJ,MAAM,gBAAgB;CAatB,IAAI,cAAc,MAAM;EAItB,eAAA,GAAcC,kCAAAA,uBAAAA,CAAuB,eAAe,kBAAkB;EAEtE,IAAI,cAAc,oBAAoB,gBAAgB,cAAc,kBAAkB;GAQpF,MAAM,kBAAkB,IAAI,cAAc,iBAAiBC,kCAAAA,IAAI;GAK/D,eAAA,GADyBD,kCAAAA,uBAAAA,CAAuB,iBAAiB,kBACpC,CAAC,EAAE;EAClC;CACF;CAEA,IAAI,CAAC,aACH,cAAc,cAAc;CAG9B,OAAO;AACT"}
|
|
@@ -11,3 +11,8 @@ export declare function forEachChildNodes(node: Node, callback: (child: Node) =>
|
|
|
11
11
|
* Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`
|
|
12
12
|
*/
|
|
13
13
|
export declare function getParentNode(node: Node): Node | null;
|
|
14
|
+
/**
|
|
15
|
+
* Return the parent element, crossing shadow DOM boundaries.
|
|
16
|
+
* If the element is a direct child of a shadow root, returns the shadow host.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getParentElement(element: Element): Element | null;
|
|
@@ -1,46 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTextNode = isTextNode;
|
|
4
|
-
exports.isCommentNode = isCommentNode;
|
|
5
|
-
exports.isElementNode = isElementNode;
|
|
6
|
-
exports.isNodeShadowHost = isNodeShadowHost;
|
|
7
|
-
exports.isNodeShadowRoot = isNodeShadowRoot;
|
|
8
|
-
exports.hasChildNodes = hasChildNodes;
|
|
9
|
-
exports.forEachChildNodes = forEachChildNodes;
|
|
10
|
-
exports.getParentNode = getParentNode;
|
|
1
|
+
//#region src/browser/htmlDomUtils.ts
|
|
11
2
|
function isTextNode(node) {
|
|
12
|
-
|
|
3
|
+
return node.nodeType === Node.TEXT_NODE;
|
|
13
4
|
}
|
|
14
5
|
function isCommentNode(node) {
|
|
15
|
-
|
|
6
|
+
return node.nodeType === Node.COMMENT_NODE;
|
|
16
7
|
}
|
|
17
8
|
function isElementNode(node) {
|
|
18
|
-
|
|
9
|
+
return node.nodeType === Node.ELEMENT_NODE;
|
|
19
10
|
}
|
|
20
11
|
function isNodeShadowHost(node) {
|
|
21
|
-
|
|
12
|
+
return isElementNode(node) && Boolean(node.shadowRoot);
|
|
22
13
|
}
|
|
23
14
|
function isNodeShadowRoot(node) {
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
const shadowRoot = node;
|
|
16
|
+
return !!shadowRoot.host && shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE && isElementNode(shadowRoot.host);
|
|
26
17
|
}
|
|
27
18
|
function hasChildNodes(node) {
|
|
28
|
-
|
|
19
|
+
return node.childNodes.length > 0 || isNodeShadowHost(node);
|
|
29
20
|
}
|
|
30
21
|
function forEachChildNodes(node, callback) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
callback(node.shadowRoot);
|
|
38
|
-
}
|
|
22
|
+
let child = node.firstChild;
|
|
23
|
+
while (child) {
|
|
24
|
+
callback(child);
|
|
25
|
+
child = child.nextSibling;
|
|
26
|
+
}
|
|
27
|
+
if (isNodeShadowHost(node)) callback(node.shadowRoot);
|
|
39
28
|
}
|
|
40
29
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
* Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`
|
|
31
|
+
*/
|
|
43
32
|
function getParentNode(node) {
|
|
44
|
-
|
|
33
|
+
return isNodeShadowRoot(node) ? node.host : node.parentNode;
|
|
45
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Return the parent element, crossing shadow DOM boundaries.
|
|
37
|
+
* If the element is a direct child of a shadow root, returns the shadow host.
|
|
38
|
+
*/
|
|
39
|
+
function getParentElement(element) {
|
|
40
|
+
if (element.parentElement) return element.parentElement;
|
|
41
|
+
const parentNode = element.parentNode;
|
|
42
|
+
if (parentNode && isNodeShadowRoot(parentNode)) return parentNode.host;
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
exports.forEachChildNodes = forEachChildNodes;
|
|
47
|
+
exports.getParentElement = getParentElement;
|
|
48
|
+
exports.getParentNode = getParentNode;
|
|
49
|
+
exports.hasChildNodes = hasChildNodes;
|
|
50
|
+
exports.isCommentNode = isCommentNode;
|
|
51
|
+
exports.isElementNode = isElementNode;
|
|
52
|
+
exports.isNodeShadowHost = isNodeShadowHost;
|
|
53
|
+
exports.isNodeShadowRoot = isNodeShadowRoot;
|
|
54
|
+
exports.isTextNode = isTextNode;
|
|
55
|
+
|
|
46
56
|
//# sourceMappingURL=htmlDomUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlDomUtils.js","
|
|
1
|
+
{"version":3,"file":"htmlDomUtils.js","names":[],"sources":["../../src/browser/htmlDomUtils.ts"],"sourcesContent":["export function isTextNode(node: Node): node is Text {\n return node.nodeType === Node.TEXT_NODE\n}\n\nexport function isCommentNode(node: Node): node is Comment {\n return node.nodeType === Node.COMMENT_NODE\n}\n\nexport function isElementNode(node: Node): node is Element {\n return node.nodeType === Node.ELEMENT_NODE\n}\n\nexport function isNodeShadowHost(node: Node): node is Element & { shadowRoot: ShadowRoot } {\n return isElementNode(node) && Boolean(node.shadowRoot)\n}\n\nexport function isNodeShadowRoot(node: Node): node is ShadowRoot {\n const shadowRoot = node as ShadowRoot\n return !!shadowRoot.host && shadowRoot.nodeType === Node.DOCUMENT_FRAGMENT_NODE && isElementNode(shadowRoot.host)\n}\n\nexport function hasChildNodes(node: Node) {\n return node.childNodes.length > 0 || isNodeShadowHost(node)\n}\n\nexport function forEachChildNodes(node: Node, callback: (child: Node) => void) {\n let child = node.firstChild\n\n while (child) {\n callback(child)\n\n child = child.nextSibling\n }\n\n if (isNodeShadowHost(node)) {\n callback(node.shadowRoot)\n }\n}\n\n/**\n * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode`\n */\nexport function getParentNode(node: Node): Node | null {\n return isNodeShadowRoot(node) ? node.host : node.parentNode\n}\n\n/**\n * Return the parent element, crossing shadow DOM boundaries.\n * If the element is a direct child of a shadow root, returns the shadow host.\n */\nexport function getParentElement(element: Element): Element | null {\n if (element.parentElement) {\n return element.parentElement\n }\n const parentNode = element.parentNode\n if (parentNode && isNodeShadowRoot(parentNode)) {\n return parentNode.host\n }\n return null\n}\n"],"mappings":";AAAA,SAAgB,WAAW,MAA0B;CACnD,OAAO,KAAK,aAAa,KAAK;AAChC;AAEA,SAAgB,cAAc,MAA6B;CACzD,OAAO,KAAK,aAAa,KAAK;AAChC;AAEA,SAAgB,cAAc,MAA6B;CACzD,OAAO,KAAK,aAAa,KAAK;AAChC;AAEA,SAAgB,iBAAiB,MAA0D;CACzF,OAAO,cAAc,IAAI,KAAK,QAAQ,KAAK,UAAU;AACvD;AAEA,SAAgB,iBAAiB,MAAgC;CAC/D,MAAM,aAAa;CACnB,OAAO,CAAC,CAAC,WAAW,QAAQ,WAAW,aAAa,KAAK,0BAA0B,cAAc,WAAW,IAAI;AAClH;AAEA,SAAgB,cAAc,MAAY;CACxC,OAAO,KAAK,WAAW,SAAS,KAAK,iBAAiB,IAAI;AAC5D;AAEA,SAAgB,kBAAkB,MAAY,UAAiC;CAC7E,IAAI,QAAQ,KAAK;CAEjB,OAAO,OAAO;EACZ,SAAS,KAAK;EAEd,QAAQ,MAAM;CAChB;CAEA,IAAI,iBAAiB,IAAI,GACvB,SAAS,KAAK,UAAU;AAE5B;;;;AAKA,SAAgB,cAAc,MAAyB;CACrD,OAAO,iBAAiB,IAAI,IAAI,KAAK,OAAO,KAAK;AACnD;;;;;AAMA,SAAgB,iBAAiB,SAAkC;CACjE,IAAI,QAAQ,eACV,OAAO,QAAQ;CAEjB,MAAM,aAAa,QAAQ;CAC3B,IAAI,cAAc,iBAAiB,UAAU,GAC3C,OAAO,WAAW;CAEpB,OAAO;AACT"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Observable } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { RumConfiguration } from '../domain/configuration';
|
|
3
2
|
export interface LocationChange {
|
|
4
3
|
oldLocation: Readonly<Location>;
|
|
5
4
|
newLocation: Readonly<Location>;
|
|
6
5
|
}
|
|
7
|
-
export declare function createLocationChangeObservable(
|
|
6
|
+
export declare function createLocationChangeObservable(): Observable<LocationChange>;
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
let _kubesense_kubesense_js_core_util = require("@kubesense/kubesense-js-core/util");
|
|
2
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
3
|
+
//#region src/browser/locationChangeObservable.ts
|
|
4
|
+
function createLocationChangeObservable() {
|
|
5
|
+
let currentLocation = (0, _kubesense_kubesense_browser_core.shallowClone)(getLocation());
|
|
6
|
+
return new _kubesense_kubesense_browser_core.Observable((observable) => {
|
|
7
|
+
const { stop: stopHistoryTracking } = trackHistory(onLocationChange);
|
|
8
|
+
const { stop: stopHashTracking } = trackHash(onLocationChange);
|
|
9
|
+
function onLocationChange() {
|
|
10
|
+
if (currentLocation.href === getLocation().href) return;
|
|
11
|
+
const newLocation = (0, _kubesense_kubesense_browser_core.shallowClone)(getLocation());
|
|
12
|
+
observable.notify({
|
|
13
|
+
newLocation,
|
|
14
|
+
oldLocation: currentLocation
|
|
15
|
+
});
|
|
16
|
+
currentLocation = newLocation;
|
|
17
|
+
}
|
|
18
|
+
return () => {
|
|
19
|
+
stopHistoryTracking();
|
|
20
|
+
stopHashTracking();
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function getLocation() {
|
|
25
|
+
return (0, _kubesense_kubesense_browser_core.mockable)(_kubesense_kubesense_js_core_util.globalObject.location);
|
|
26
26
|
}
|
|
27
|
-
function trackHistory(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
};
|
|
27
|
+
function trackHistory(onHistoryChange) {
|
|
28
|
+
const { stop: stopInstrumentingPushState } = (0, _kubesense_kubesense_browser_core.instrumentMethod)(getHistoryInstrumentationTarget("pushState"), "pushState", ({ onPostCall }) => {
|
|
29
|
+
onPostCall(onHistoryChange);
|
|
30
|
+
});
|
|
31
|
+
const { stop: stopInstrumentingReplaceState } = (0, _kubesense_kubesense_browser_core.instrumentMethod)(getHistoryInstrumentationTarget("replaceState"), "replaceState", ({ onPostCall }) => {
|
|
32
|
+
onPostCall(onHistoryChange);
|
|
33
|
+
});
|
|
34
|
+
const { stop: removeListener } = (0, _kubesense_kubesense_browser_core.addEventListener)(window, _kubesense_kubesense_browser_core.DOM_EVENT.POP_STATE, onHistoryChange);
|
|
35
|
+
return { stop: () => {
|
|
36
|
+
stopInstrumentingPushState();
|
|
37
|
+
stopInstrumentingReplaceState();
|
|
38
|
+
removeListener();
|
|
39
|
+
} };
|
|
42
40
|
}
|
|
43
|
-
function trackHash(
|
|
44
|
-
|
|
41
|
+
function trackHash(onHashChange) {
|
|
42
|
+
return (0, _kubesense_kubesense_browser_core.addEventListener)(window, _kubesense_kubesense_browser_core.DOM_EVENT.HASH_CHANGE, onHashChange);
|
|
45
43
|
}
|
|
46
44
|
function getHistoryInstrumentationTarget(methodName) {
|
|
47
|
-
|
|
48
|
-
// are wrapping the instance method. In that case we should also wrap the instance method.
|
|
49
|
-
return Object.prototype.hasOwnProperty.call(history, methodName) ? history : History.prototype;
|
|
45
|
+
return Object.prototype.hasOwnProperty.call(history, methodName) ? history : History.prototype;
|
|
50
46
|
}
|
|
47
|
+
//#endregion
|
|
48
|
+
exports.createLocationChangeObservable = createLocationChangeObservable;
|
|
49
|
+
|
|
51
50
|
//# sourceMappingURL=locationChangeObservable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locationChangeObservable.js","
|
|
1
|
+
{"version":3,"file":"locationChangeObservable.js","names":["shallowClone","Observable","mockable","globalObject","instrumentMethod","addEventListener","DOM_EVENT"],"sources":["../../src/browser/locationChangeObservable.ts"],"sourcesContent":["import { globalObject } from '@kubesense/kubesense-js-core/util'\nimport {\n addEventListener,\n DOM_EVENT,\n instrumentMethod,\n mockable,\n Observable,\n shallowClone,\n} from '@kubesense/kubesense-browser-core'\n\nexport interface LocationChange {\n oldLocation: Readonly<Location>\n newLocation: Readonly<Location>\n}\n\nexport function createLocationChangeObservable() {\n let currentLocation = shallowClone(getLocation())\n\n return new Observable<LocationChange>((observable) => {\n const { stop: stopHistoryTracking } = trackHistory(onLocationChange)\n const { stop: stopHashTracking } = trackHash(onLocationChange)\n\n function onLocationChange() {\n if (currentLocation.href === getLocation().href) {\n return\n }\n const newLocation = shallowClone(getLocation())\n observable.notify({\n newLocation,\n oldLocation: currentLocation,\n })\n currentLocation = newLocation\n }\n\n return () => {\n stopHistoryTracking()\n stopHashTracking()\n }\n })\n}\n\nfunction getLocation() {\n return mockable(globalObject.location)\n}\n\nfunction trackHistory(onHistoryChange: () => void) {\n const { stop: stopInstrumentingPushState } = instrumentMethod(\n getHistoryInstrumentationTarget('pushState'),\n 'pushState',\n ({ onPostCall }) => {\n onPostCall(onHistoryChange)\n }\n )\n const { stop: stopInstrumentingReplaceState } = instrumentMethod(\n getHistoryInstrumentationTarget('replaceState'),\n 'replaceState',\n ({ onPostCall }) => {\n onPostCall(onHistoryChange)\n }\n )\n const { stop: removeListener } = addEventListener(window, DOM_EVENT.POP_STATE, onHistoryChange)\n\n return {\n stop: () => {\n stopInstrumentingPushState()\n stopInstrumentingReplaceState()\n removeListener()\n },\n }\n}\n\nfunction trackHash(onHashChange: () => void) {\n return addEventListener(window, DOM_EVENT.HASH_CHANGE, onHashChange)\n}\n\nfunction getHistoryInstrumentationTarget(methodName: 'pushState' | 'replaceState') {\n // Ideally we should always instument the method on the prototype, however some frameworks (e.g [Next.js](https://github.com/vercel/next.js/blob/d3f5532065f3e3bb84fb54bd2dfd1a16d0f03a21/packages/next/src/client/components/app-router.tsx#L429))\n // are wrapping the instance method. In that case we should also wrap the instance method.\n return Object.prototype.hasOwnProperty.call(history, methodName) ? history : History.prototype\n}\n"],"mappings":";;;AAeA,SAAgB,iCAAiC;CAC/C,IAAI,mBAAA,GAAkBA,kCAAAA,aAAAA,CAAa,YAAY,CAAC;CAEhD,OAAO,IAAIC,kCAAAA,YAA4B,eAAe;EACpD,MAAM,EAAE,MAAM,wBAAwB,aAAa,gBAAgB;EACnE,MAAM,EAAE,MAAM,qBAAqB,UAAU,gBAAgB;EAE7D,SAAS,mBAAmB;GAC1B,IAAI,gBAAgB,SAAS,YAAY,CAAC,CAAC,MACzC;GAEF,MAAM,eAAA,GAAcD,kCAAAA,aAAAA,CAAa,YAAY,CAAC;GAC9C,WAAW,OAAO;IAChB;IACA,aAAa;GACf,CAAC;GACD,kBAAkB;EACpB;EAEA,aAAa;GACX,oBAAoB;GACpB,iBAAiB;EACnB;CACF,CAAC;AACH;AAEA,SAAS,cAAc;CACrB,QAAA,GAAOE,kCAAAA,SAAAA,CAASC,kCAAAA,aAAa,QAAQ;AACvC;AAEA,SAAS,aAAa,iBAA6B;CACjD,MAAM,EAAE,MAAM,gCAAA,GAA+BC,kCAAAA,iBAAAA,CAC3C,gCAAgC,WAAW,GAC3C,cACC,EAAE,iBAAiB;EAClB,WAAW,eAAe;CAC5B,CACF;CACA,MAAM,EAAE,MAAM,mCAAA,GAAkCA,kCAAAA,iBAAAA,CAC9C,gCAAgC,cAAc,GAC9C,iBACC,EAAE,iBAAiB;EAClB,WAAW,eAAe;CAC5B,CACF;CACA,MAAM,EAAE,MAAM,oBAAA,GAAmBC,kCAAAA,iBAAAA,CAAiB,QAAQC,kCAAAA,UAAU,WAAW,eAAe;CAE9F,OAAO,EACL,YAAY;EACV,2BAA2B;EAC3B,8BAA8B;EAC9B,eAAe;CACjB,EACF;AACF;AAEA,SAAS,UAAU,cAA0B;CAC3C,QAAA,GAAOD,kCAAAA,iBAAAA,CAAiB,QAAQC,kCAAAA,UAAU,aAAa,YAAY;AACrE;AAEA,SAAS,gCAAgC,YAA0C;CAGjF,OAAO,OAAO,UAAU,eAAe,KAAK,SAAS,UAAU,IAAI,UAAU,QAAQ;AACvF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RelativeTime, Duration } from '@kubesense/kubesense-js-core/time';
|
|
2
2
|
import { Observable } from '@kubesense/kubesense-browser-core';
|
|
3
|
-
import type { RumConfiguration } from '../domain/configuration';
|
|
4
3
|
type RumPerformanceObserverConstructor = new (callback: PerformanceObserverCallback) => RumPerformanceObserver;
|
|
5
4
|
export interface BrowserWindow extends Window {
|
|
6
5
|
PerformanceObserver: RumPerformanceObserverConstructor;
|
|
@@ -56,8 +55,8 @@ export interface RumPerformanceResourceTiming {
|
|
|
56
55
|
transferSize?: number;
|
|
57
56
|
nextHopProtocol?: string;
|
|
58
57
|
renderBlockingStatus?: string;
|
|
59
|
-
traceId?: string;
|
|
60
58
|
deliveryType?: 'cache' | 'navigational-prefetch' | '';
|
|
59
|
+
contentType?: string;
|
|
61
60
|
toJSON(): Omit<PerformanceEntry, 'toJSON'>;
|
|
62
61
|
}
|
|
63
62
|
export interface RumPerformancePaintTiming {
|
|
@@ -165,10 +164,11 @@ export interface EntryTypeToReturnType {
|
|
|
165
164
|
[RumPerformanceEntryType.RESOURCE]: RumPerformanceResourceTiming;
|
|
166
165
|
[RumPerformanceEntryType.VISIBILITY_STATE]: RumFirstHiddenTiming;
|
|
167
166
|
}
|
|
168
|
-
export declare function createPerformanceObservable<T extends RumPerformanceEntryType>(
|
|
167
|
+
export declare function createPerformanceObservable<T extends RumPerformanceEntryType>(options: {
|
|
169
168
|
type: T;
|
|
170
169
|
buffered?: boolean;
|
|
171
170
|
durationThreshold?: number;
|
|
172
171
|
}): Observable<EntryTypeToReturnType[T][]>;
|
|
172
|
+
export declare function resetManageResourceTimingBufferFull(): void;
|
|
173
173
|
export declare function supportPerformanceTimingEvent(entryType: RumPerformanceEntryType): boolean;
|
|
174
174
|
export {};
|
|
@@ -1,126 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const observer = new PerformanceObserver((0, kubesense_browser_core_1.monitor)((entries) => {
|
|
39
|
-
// In Safari the performance observer callback is synchronous.
|
|
40
|
-
// Because the buffered performance entry list can be quite large we delay the computation to prevent the SDK from blocking the main thread on init
|
|
41
|
-
if (isObserverInitializing) {
|
|
42
|
-
timeoutId = (0, kubesense_browser_core_1.setTimeout)(() => handlePerformanceEntries(entries.getEntries()));
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
handlePerformanceEntries(entries.getEntries());
|
|
46
|
-
}
|
|
47
|
-
}));
|
|
48
|
-
try {
|
|
49
|
-
observer.observe(options);
|
|
50
|
-
}
|
|
51
|
-
catch (_a) {
|
|
52
|
-
// Some old browser versions (<= chrome 74 ) don't support the PerformanceObserver type and buffered options
|
|
53
|
-
// In these cases, fallback to getEntriesByType and PerformanceObserver with entryTypes
|
|
54
|
-
// TODO: remove this fallback in the next major version
|
|
55
|
-
const fallbackSupportedEntryTypes = [
|
|
56
|
-
RumPerformanceEntryType.RESOURCE,
|
|
57
|
-
RumPerformanceEntryType.NAVIGATION,
|
|
58
|
-
RumPerformanceEntryType.LONG_TASK,
|
|
59
|
-
RumPerformanceEntryType.PAINT,
|
|
60
|
-
];
|
|
61
|
-
if (fallbackSupportedEntryTypes.includes(options.type)) {
|
|
62
|
-
if (options.buffered) {
|
|
63
|
-
timeoutId = (0, kubesense_browser_core_1.setTimeout)(() => handlePerformanceEntries(performance.getEntriesByType(options.type)));
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
observer.observe({ entryTypes: [options.type] });
|
|
67
|
-
}
|
|
68
|
-
catch (_b) {
|
|
69
|
-
// Old versions of Safari are throwing "entryTypes contained only unsupported types"
|
|
70
|
-
// errors when observing only unsupported entry types.
|
|
71
|
-
//
|
|
72
|
-
// We could use `supportPerformanceTimingEvent` to make sure we don't invoke
|
|
73
|
-
// `observer.observe` with an unsupported entry type, but Safari 11 and 12 don't support
|
|
74
|
-
// `Performance.supportedEntryTypes`, so doing so would lose support for these versions
|
|
75
|
-
// even if they do support the entry type.
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
isObserverInitializing = false;
|
|
81
|
-
manageResourceTimingBufferFull(configuration);
|
|
82
|
-
let stopFirstInputTiming;
|
|
83
|
-
if (!supportPerformanceTimingEvent(RumPerformanceEntryType.FIRST_INPUT) &&
|
|
84
|
-
options.type === RumPerformanceEntryType.FIRST_INPUT) {
|
|
85
|
-
;
|
|
86
|
-
({ stop: stopFirstInputTiming } = (0, firstInputPolyfill_1.retrieveFirstInputTiming)(configuration, (timing) => {
|
|
87
|
-
handlePerformanceEntries([timing]);
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
return () => {
|
|
91
|
-
observer.disconnect();
|
|
92
|
-
if (stopFirstInputTiming) {
|
|
93
|
-
stopFirstInputTiming();
|
|
94
|
-
}
|
|
95
|
-
(0, kubesense_browser_core_1.clearTimeout)(timeoutId);
|
|
96
|
-
};
|
|
97
|
-
});
|
|
1
|
+
const require_resourceUtils = require("../domain/resource/resourceUtils.js");
|
|
2
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
3
|
+
let _kubesense_kubesense_js_core_monitor = require("@kubesense/kubesense-js-core/monitor");
|
|
4
|
+
//#region src/browser/performanceObservable.ts
|
|
5
|
+
let RumPerformanceEntryType = /* @__PURE__ */ function(RumPerformanceEntryType) {
|
|
6
|
+
RumPerformanceEntryType["EVENT"] = "event";
|
|
7
|
+
RumPerformanceEntryType["FIRST_INPUT"] = "first-input";
|
|
8
|
+
RumPerformanceEntryType["LARGEST_CONTENTFUL_PAINT"] = "largest-contentful-paint";
|
|
9
|
+
RumPerformanceEntryType["LAYOUT_SHIFT"] = "layout-shift";
|
|
10
|
+
RumPerformanceEntryType["LONG_TASK"] = "longtask";
|
|
11
|
+
RumPerformanceEntryType["LONG_ANIMATION_FRAME"] = "long-animation-frame";
|
|
12
|
+
RumPerformanceEntryType["NAVIGATION"] = "navigation";
|
|
13
|
+
RumPerformanceEntryType["PAINT"] = "paint";
|
|
14
|
+
RumPerformanceEntryType["RESOURCE"] = "resource";
|
|
15
|
+
RumPerformanceEntryType["VISIBILITY_STATE"] = "visibility-state";
|
|
16
|
+
return RumPerformanceEntryType;
|
|
17
|
+
}({});
|
|
18
|
+
function createPerformanceObservable(options) {
|
|
19
|
+
return new _kubesense_kubesense_browser_core.Observable((observable) => {
|
|
20
|
+
const handlePerformanceEntries = (entries) => {
|
|
21
|
+
const rumPerformanceEntries = filterRumPerformanceEntries(entries);
|
|
22
|
+
if (rumPerformanceEntries.length > 0) observable.notify(rumPerformanceEntries);
|
|
23
|
+
};
|
|
24
|
+
let timeoutId;
|
|
25
|
+
let isObserverInitializing = true;
|
|
26
|
+
const observer = new PerformanceObserver((0, _kubesense_kubesense_js_core_monitor.monitor)((entries) => {
|
|
27
|
+
if (isObserverInitializing) timeoutId = (0, _kubesense_kubesense_browser_core.setTimeout)(() => handlePerformanceEntries(entries.getEntries()));
|
|
28
|
+
else handlePerformanceEntries(entries.getEntries());
|
|
29
|
+
}));
|
|
30
|
+
observer.observe(options);
|
|
31
|
+
isObserverInitializing = false;
|
|
32
|
+
manageResourceTimingBufferFull();
|
|
33
|
+
return () => {
|
|
34
|
+
observer.disconnect();
|
|
35
|
+
(0, _kubesense_kubesense_browser_core.clearTimeout)(timeoutId);
|
|
36
|
+
};
|
|
37
|
+
});
|
|
98
38
|
}
|
|
99
39
|
let resourceTimingBufferFullListener;
|
|
100
|
-
function manageResourceTimingBufferFull(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
performance.clearResourceTimings();
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return () => {
|
|
108
|
-
resourceTimingBufferFullListener === null || resourceTimingBufferFullListener === void 0 ? void 0 : resourceTimingBufferFullListener.stop();
|
|
109
|
-
};
|
|
40
|
+
function manageResourceTimingBufferFull() {
|
|
41
|
+
if (!resourceTimingBufferFullListener && supportPerformanceObject() && "addEventListener" in performance) resourceTimingBufferFullListener = (0, _kubesense_kubesense_browser_core.addEventListener)(performance, "resourcetimingbufferfull", () => {
|
|
42
|
+
performance.clearResourceTimings();
|
|
43
|
+
});
|
|
110
44
|
}
|
|
111
45
|
function supportPerformanceObject() {
|
|
112
|
-
|
|
46
|
+
return window.performance !== void 0 && "getEntries" in performance;
|
|
113
47
|
}
|
|
114
48
|
function supportPerformanceTimingEvent(entryType) {
|
|
115
|
-
|
|
116
|
-
PerformanceObserver.supportedEntryTypes !== undefined &&
|
|
117
|
-
PerformanceObserver.supportedEntryTypes.includes(entryType));
|
|
49
|
+
return PerformanceObserver.supportedEntryTypes.includes(entryType);
|
|
118
50
|
}
|
|
119
51
|
function filterRumPerformanceEntries(entries) {
|
|
120
|
-
|
|
52
|
+
return entries.filter((entry) => !isForbiddenResource(entry));
|
|
121
53
|
}
|
|
122
54
|
function isForbiddenResource(entry) {
|
|
123
|
-
|
|
124
|
-
(!(0, resourceUtils_1.isAllowedRequestUrl)(entry.name) || !(0, resourceUtils_1.hasValidResourceEntryDuration)(entry)));
|
|
55
|
+
return entry.entryType === "resource" && (!require_resourceUtils.isAllowedRequestUrl(entry.name) || !require_resourceUtils.hasValidResourceEntryDuration(entry));
|
|
125
56
|
}
|
|
57
|
+
//#endregion
|
|
58
|
+
exports.RumPerformanceEntryType = RumPerformanceEntryType;
|
|
59
|
+
exports.createPerformanceObservable = createPerformanceObservable;
|
|
60
|
+
exports.supportPerformanceTimingEvent = supportPerformanceTimingEvent;
|
|
61
|
+
|
|
126
62
|
//# sourceMappingURL=performanceObservable.js.map
|