Socket
Socket
Sign inDemoInstall

@datadog/browser-rum-core

Package Overview
Dependencies
Maintainers
1
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-rum-core - npm Package Compare versions

Comparing version 5.6.0 to 5.7.0

12

cjs/boot/rumPublicApi.js

@@ -11,4 +11,5 @@ "use strict";

var isAlreadyInitialized = false;
var globalContextManager = (0, browser_core_1.createContextManager)(2 /* CustomerDataType.GlobalContext */);
var userContextManager = (0, browser_core_1.createContextManager)(1 /* CustomerDataType.User */);
var customerDataTrackerManager = (0, browser_core_1.createCustomerDataTrackerManager)(0 /* CustomerDataCompressionStatus.Unknown */);
var globalContextManager = (0, browser_core_1.createContextManager)(customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */));
var userContextManager = (0, browser_core_1.createContextManager)(customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */));
var getInternalContextStrategy = function () { return undefined; };

@@ -104,9 +105,10 @@ var getInitConfigurationStrategy = function () { return undefined; };

var beforeInitGlobalContext = globalContextManager.getContext();
globalContextManager = (0, browser_core_1.createStoredContextManager)(configuration, RUM_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */);
globalContextManager = (0, browser_core_1.createStoredContextManager)(configuration, RUM_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */, customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */));
globalContextManager.setContext((0, browser_core_1.combine)(globalContextManager.getContext(), beforeInitGlobalContext));
var beforeInitUserContext = userContextManager.getContext();
userContextManager = (0, browser_core_1.createStoredContextManager)(configuration, RUM_STORAGE_KEY, 1 /* CustomerDataType.User */);
userContextManager = (0, browser_core_1.createStoredContextManager)(configuration, RUM_STORAGE_KEY, 1 /* CustomerDataType.User */, customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */));
userContextManager.setContext((0, browser_core_1.combine)(userContextManager.getContext(), beforeInitUserContext));
}
var startRumResults = startRumImpl(initConfiguration, configuration, recorderApi, globalContextManager, userContextManager, initialViewOptions, deflateWorker && createDeflateEncoder
customerDataTrackerManager.setCompressionStatus(deflateWorker ? 1 /* CustomerDataCompressionStatus.Enabled */ : 2 /* CustomerDataCompressionStatus.Disabled */);
var startRumResults = startRumImpl(initConfiguration, configuration, recorderApi, customerDataTrackerManager, globalContextManager, userContextManager, initialViewOptions, deflateWorker && createDeflateEncoder
? function (streamId) { return createDeflateEncoder(configuration, deflateWorker, streamId); }

@@ -113,0 +115,0 @@ : browser_core_1.createIdentityEncoder);

@@ -1,2 +0,2 @@

import type { Observable, RawError, ContextManager, DeflateEncoderStreamId, Encoder } from '@datadog/browser-core';
import type { Observable, RawError, ContextManager, DeflateEncoderStreamId, Encoder, CustomerDataTrackerManager } from '@datadog/browser-core';
import { LifeCycle } from '../domain/lifeCycle';

@@ -9,3 +9,3 @@ import type { RumSessionManager } from '../domain/rumSessionManager';

import type { RecorderApi } from './rumPublicApi';
export declare function startRum(initConfiguration: RumInitConfiguration, configuration: RumConfiguration, recorderApi: RecorderApi, globalContextManager: ContextManager, userContextManager: ContextManager, initialViewOptions: ViewOptions | undefined, createEncoder: (streamId: DeflateEncoderStreamId) => Encoder): {
export declare function startRum(initConfiguration: RumInitConfiguration, configuration: RumConfiguration, recorderApi: RecorderApi, customerDataTrackerManager: CustomerDataTrackerManager, globalContextManager: ContextManager, userContextManager: ContextManager, initialViewOptions: ViewOptions | undefined, createEncoder: (streamId: DeflateEncoderStreamId) => Encoder): {
addAction: (action: import("../domain/action/actionCollection").CustomAction, savedCommonContext?: CommonContext | undefined) => void;

@@ -12,0 +12,0 @@ addError: ({ error, handlingStack, startClocks, context: customerContext }: import("../domain/error/errorCollection").ProvidedError, savedCommonContext?: CommonContext | undefined) => void;

@@ -28,3 +28,3 @@ "use strict";

var displayContext_1 = require("../domain/contexts/displayContext");
function startRum(initConfiguration, configuration, recorderApi, globalContextManager, userContextManager, initialViewOptions, createEncoder) {
function startRum(initConfiguration, configuration, recorderApi, customerDataTrackerManager, globalContextManager, userContextManager, initialViewOptions, createEncoder) {
var cleanupTasks = [];

@@ -55,3 +55,3 @@ var lifeCycle = new lifeCycle_1.LifeCycle();

};
var featureFlagContexts = (0, featureFlagContext_1.startFeatureFlagContexts)(lifeCycle);
var featureFlagContexts = (0, featureFlagContext_1.startFeatureFlagContexts)(lifeCycle, customerDataTrackerManager.getOrCreateTracker(0 /* CustomerDataType.FeatureFlag */));
var pageExitObservable = (0, browser_core_1.createPageExitObservable)(configuration);

@@ -66,3 +66,3 @@ var pageExitSubscription = pageExitObservable.subscribe(function (event) {

cleanupTasks.push(function () { return batch_1.stop(); });
(0, startCustomerDataTelemetry_1.startCustomerDataTelemetry)(configuration, telemetry, lifeCycle, globalContextManager, userContextManager, featureFlagContexts, batch_1.flushObservable);
(0, startCustomerDataTelemetry_1.startCustomerDataTelemetry)(configuration, telemetry, lifeCycle, customerDataTrackerManager, batch_1.flushObservable);
}

@@ -69,0 +69,0 @@ else {

@@ -7,3 +7,3 @@ "use strict";

var MutationObserver = getMutationObserverConstructor();
var observable = new browser_core_1.Observable(function () {
return new browser_core_1.Observable(function (observable) {
if (!MutationObserver) {

@@ -21,3 +21,2 @@ return;

});
return observable;
}

@@ -24,0 +23,0 @@ exports.createDOMMutationObservable = createDOMMutationObservable;

@@ -7,5 +7,16 @@ "use strict";

var currentLocation = (0, browser_core_1.shallowClone)(location);
var observable = new browser_core_1.Observable(function () {
return new browser_core_1.Observable(function (observable) {
var stopHistoryTracking = trackHistory(configuration, onLocationChange).stop;
var stopHashTracking = trackHash(configuration, onLocationChange).stop;
function onLocationChange() {
if (currentLocation.href === location.href) {
return;
}
var newLocation = (0, browser_core_1.shallowClone)(location);
observable.notify({
newLocation: newLocation,
oldLocation: currentLocation,
});
currentLocation = newLocation;
}
return function () {

@@ -16,22 +27,12 @@ stopHistoryTracking();

});
function onLocationChange() {
if (currentLocation.href === location.href) {
return;
}
var newLocation = (0, browser_core_1.shallowClone)(location);
observable.notify({
newLocation: newLocation,
oldLocation: currentLocation,
});
currentLocation = newLocation;
}
return observable;
}
exports.createLocationChangeObservable = createLocationChangeObservable;
function trackHistory(configuration, onHistoryChange) {
var stopInstrumentingPushState = (0, browser_core_1.instrumentMethodAndCallOriginal)(history, 'pushState', {
after: onHistoryChange,
var stopInstrumentingPushState = (0, browser_core_1.instrumentMethod)(history, 'pushState', function (_a) {
var onPostCall = _a.onPostCall;
onPostCall(onHistoryChange);
}).stop;
var stopInstrumentingReplaceState = (0, browser_core_1.instrumentMethodAndCallOriginal)(history, 'replaceState', {
after: onHistoryChange,
var stopInstrumentingReplaceState = (0, browser_core_1.instrumentMethod)(history, 'replaceState', function (_a) {
var onPostCall = _a.onPostCall;
onPostCall(onHistoryChange);
}).stop;

@@ -38,0 +39,0 @@ var removeListener = (0, browser_core_1.addEventListener)(configuration, window, browser_core_1.DOM_EVENT.POP_STATE, onHistoryChange).stop;

@@ -14,3 +14,3 @@ "use strict";

function createViewportObservable(configuration) {
var observable = new browser_core_1.Observable(function () {
return new browser_core_1.Observable(function (observable) {
var updateDimension = (0, browser_core_1.throttle)(function () {

@@ -22,3 +22,2 @@ observable.notify(getViewportDimension());

});
return observable;
}

@@ -25,0 +24,0 @@ exports.createViewportObservable = createViewportObservable;

@@ -29,2 +29,4 @@ "use strict";

'resource.url': 'string',
}, (0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.WRITABLE_RESOURCE_GRAPHQL) && {
'resource.graphql': 'object',
}, USER_CUSTOMIZABLE_FIELD_PATHS, VIEW_MODIFIABLE_FIELD_PATHS),

@@ -58,3 +60,3 @@ _a["action" /* RumEventType.ACTION */] = (0, browser_core_1.assign)({

},
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.6.0" : undefined,
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.7.0" : undefined,
},

@@ -61,0 +63,0 @@ application: {

@@ -1,3 +0,2 @@

import type { RelativeTime, ContextValue, Context } from '@datadog/browser-core';
import { computeBytesCount } from '@datadog/browser-core';
import type { RelativeTime, ContextValue, Context, CustomerDataTracker } from '@datadog/browser-core';
import type { LifeCycle } from '../lifeCycle';

@@ -9,3 +8,2 @@ export declare const FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY: number;

findFeatureFlagEvaluations: (startTime?: RelativeTime) => FeatureFlagContext | undefined;
getFeatureFlagBytesCount: () => number;
addFeatureFlagEvaluation: (key: string, value: ContextValue) => void;

@@ -22,2 +20,2 @@ stop: () => void;

*/
export declare function startFeatureFlagContexts(lifeCycle: LifeCycle, computeBytesCountImpl?: typeof computeBytesCount): FeatureFlagContexts;
export declare function startFeatureFlagContexts(lifeCycle: LifeCycle, customerDataTracker: CustomerDataTracker): FeatureFlagContexts;

@@ -15,8 +15,6 @@ "use strict";

*/
function startFeatureFlagContexts(lifeCycle, computeBytesCountImpl) {
if (computeBytesCountImpl === void 0) { computeBytesCountImpl = browser_core_1.computeBytesCount; }
function startFeatureFlagContexts(lifeCycle, customerDataTracker) {
if (!(0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.FEATURE_FLAGS)) {
return {
findFeatureFlagEvaluations: function () { return undefined; },
getFeatureFlagBytesCount: function () { return 0; },
addFeatureFlagEvaluation: browser_core_1.noop,

@@ -27,4 +25,2 @@ stop: browser_core_1.noop,

var featureFlagContexts = new browser_core_1.ValueHistory(exports.FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY);
var bytesCountCache = 0;
var alreadyWarned = false;
lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_ENDED */, function (_a) {

@@ -37,21 +33,6 @@ var endClocks = _a.endClocks;

featureFlagContexts.add({}, startClocks.relative);
bytesCountCache = 0;
customerDataTracker.resetCustomerData();
});
// Throttle the bytes computation to minimize the impact on performance.
// Especially useful if the user call addFeatureFlagEvaluation API synchronously multiple times in a row
var _a = (0, browser_core_1.throttle)(function (context) {
bytesCountCache = computeBytesCountImpl((0, browser_core_1.jsonStringify)(context));
if (!alreadyWarned) {
alreadyWarned = (0, browser_core_1.warnIfCustomerDataLimitReached)(bytesCountCache, 0 /* CustomerDataType.FeatureFlag */);
}
}, exports.BYTES_COMPUTATION_THROTTLING_DELAY), computeBytesCountThrottled = _a.throttled, cancelPendingComputation = _a.cancel;
return {
findFeatureFlagEvaluations: function (startTime) { return featureFlagContexts.find(startTime); },
getFeatureFlagBytesCount: function () {
var currentContext = featureFlagContexts.find();
if (!currentContext) {
return 0;
}
return bytesCountCache;
},
addFeatureFlagEvaluation: function (key, value) {

@@ -61,6 +42,6 @@ var currentContext = featureFlagContexts.find();

currentContext[key] = value;
computeBytesCountThrottled(currentContext);
customerDataTracker.updateCustomerData(currentContext);
}
},
stop: cancelPendingComputation,
stop: function () { return customerDataTracker.stop(); },
};

@@ -67,0 +48,0 @@ }

@@ -1,6 +0,5 @@

import type { ContextManager, FlushEvent, Observable, Telemetry } from '@datadog/browser-core';
import type { CustomerDataTrackerManager, FlushEvent, Observable, Telemetry } from '@datadog/browser-core';
import type { RumConfiguration } from './configuration';
import type { FeatureFlagContexts } from './contexts/featureFlagContext';
import type { LifeCycle } from './lifeCycle';
export declare const MEASURES_PERIOD_DURATION: number;
export declare function startCustomerDataTelemetry(configuration: RumConfiguration, telemetry: Telemetry, lifeCycle: LifeCycle, globalContextManager: ContextManager, userContextManager: ContextManager, featureFlagContexts: FeatureFlagContexts, batchFlushObservable: Observable<FlushEvent>): void;
export declare function startCustomerDataTelemetry(configuration: RumConfiguration, telemetry: Telemetry, lifeCycle: LifeCycle, customerDataTrackerManager: CustomerDataTrackerManager, batchFlushObservable: Observable<FlushEvent>): void;

@@ -9,3 +9,3 @@ "use strict";

var batchHasRumEvent;
function startCustomerDataTelemetry(configuration, telemetry, lifeCycle, globalContextManager, userContextManager, featureFlagContexts, batchFlushObservable) {
function startCustomerDataTelemetry(configuration, telemetry, lifeCycle, customerDataTrackerManager, batchFlushObservable) {
var customerDataTelemetryEnabled = telemetry.enabled && (0, browser_core_1.performDraw)(configuration.customerDataTelemetrySampleRate);

@@ -21,9 +21,7 @@ if (!customerDataTelemetryEnabled) {

batchHasRumEvent = true;
updateMeasure(currentBatchMeasures.globalContextBytes, !(0, browser_core_1.isEmptyObject)(globalContextManager.getContext()) ? globalContextManager.getBytesCount() : 0);
updateMeasure(currentBatchMeasures.userContextBytes, !(0, browser_core_1.isEmptyObject)(userContextManager.getContext()) ? userContextManager.getBytesCount() : 0);
var featureFlagContext = featureFlagContexts.findFeatureFlagEvaluations();
var hasFeatureFlagContext = (0, browser_core_1.includes)(["view" /* RumEventType.VIEW */, "error" /* RumEventType.ERROR */], event.type) &&
featureFlagContext &&
!(0, browser_core_1.isEmptyObject)(featureFlagContext);
updateMeasure(currentBatchMeasures.featureFlagBytes, hasFeatureFlagContext ? featureFlagContexts.getFeatureFlagBytesCount() : 0);
updateMeasure(currentBatchMeasures.globalContextBytes, customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */).getBytesCount());
updateMeasure(currentBatchMeasures.userContextBytes, customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */).getBytesCount());
updateMeasure(currentBatchMeasures.featureFlagBytes, (0, browser_core_1.includes)(["view" /* RumEventType.VIEW */, "error" /* RumEventType.ERROR */], event.type)
? customerDataTrackerManager.getOrCreateTracker(0 /* CustomerDataType.FeatureFlag */).getBytesCount()
: 0);
});

@@ -30,0 +28,0 @@ batchFlushObservable.subscribe(function (_a) {

@@ -55,3 +55,3 @@ "use strict";

if (throttleDuration === void 0) { throttleDuration = exports.THROTTLE_SCROLL_DURATION; }
var observable = new browser_core_1.Observable(function () {
return new browser_core_1.Observable(function (observable) {
function notify() {

@@ -78,5 +78,4 @@ observable.notify(computeScrollValues());

});
return observable;
}
exports.createScrollValuesObservable = createScrollValuesObservable;
//# sourceMappingURL=trackScrollMetrics.js.map

@@ -79,3 +79,3 @@ "use strict";

function createPageActivityObservable(lifeCycle, domMutationObservable, configuration) {
var observable = new browser_core_1.Observable(function () {
return new browser_core_1.Observable(function (observable) {
var subscriptions = [];

@@ -116,3 +116,2 @@ var firstRequestIndex;

});
return observable;
}

@@ -124,4 +123,4 @@ exports.createPageActivityObservable = createPageActivityObservable;

function trackWindowOpen(callback) {
return (0, browser_core_1.instrumentMethodAndCallOriginal)(window, 'open', { before: callback });
return (0, browser_core_1.instrumentMethod)(window, 'open', callback);
}
//# sourceMappingURL=waitPageActivityEnd.js.map

@@ -1,2 +0,2 @@

import { noop, willSyntheticsInjectRum, assign, BoundedBuffer, createContextManager, deepClone, makePublicApi, monitor, clocksNow, timeStampNow, display, callMonitored, createHandlingStack, canUseEventBridge, checkUser, sanitizeUser, sanitize, createStoredContextManager, combine, createIdentityEncoder, } from '@datadog/browser-core';
import { noop, willSyntheticsInjectRum, assign, BoundedBuffer, createContextManager, deepClone, makePublicApi, monitor, clocksNow, timeStampNow, display, callMonitored, createHandlingStack, canUseEventBridge, checkUser, sanitizeUser, sanitize, createStoredContextManager, combine, createIdentityEncoder, createCustomerDataTrackerManager, } from '@datadog/browser-core';
import { validateAndBuildRumConfiguration } from '../domain/configuration';

@@ -8,4 +8,5 @@ import { buildCommonContext } from '../domain/contexts/commonContext';

var isAlreadyInitialized = false;
var globalContextManager = createContextManager(2 /* CustomerDataType.GlobalContext */);
var userContextManager = createContextManager(1 /* CustomerDataType.User */);
var customerDataTrackerManager = createCustomerDataTrackerManager(0 /* CustomerDataCompressionStatus.Unknown */);
var globalContextManager = createContextManager(customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */));
var userContextManager = createContextManager(customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */));
var getInternalContextStrategy = function () { return undefined; };

@@ -101,9 +102,10 @@ var getInitConfigurationStrategy = function () { return undefined; };

var beforeInitGlobalContext = globalContextManager.getContext();
globalContextManager = createStoredContextManager(configuration, RUM_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */);
globalContextManager = createStoredContextManager(configuration, RUM_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */, customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */));
globalContextManager.setContext(combine(globalContextManager.getContext(), beforeInitGlobalContext));
var beforeInitUserContext = userContextManager.getContext();
userContextManager = createStoredContextManager(configuration, RUM_STORAGE_KEY, 1 /* CustomerDataType.User */);
userContextManager = createStoredContextManager(configuration, RUM_STORAGE_KEY, 1 /* CustomerDataType.User */, customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */));
userContextManager.setContext(combine(userContextManager.getContext(), beforeInitUserContext));
}
var startRumResults = startRumImpl(initConfiguration, configuration, recorderApi, globalContextManager, userContextManager, initialViewOptions, deflateWorker && createDeflateEncoder
customerDataTrackerManager.setCompressionStatus(deflateWorker ? 1 /* CustomerDataCompressionStatus.Enabled */ : 2 /* CustomerDataCompressionStatus.Disabled */);
var startRumResults = startRumImpl(initConfiguration, configuration, recorderApi, customerDataTrackerManager, globalContextManager, userContextManager, initialViewOptions, deflateWorker && createDeflateEncoder
? function (streamId) { return createDeflateEncoder(configuration, deflateWorker, streamId); }

@@ -110,0 +112,0 @@ : createIdentityEncoder);

@@ -1,2 +0,2 @@

import type { Observable, RawError, ContextManager, DeflateEncoderStreamId, Encoder } from '@datadog/browser-core';
import type { Observable, RawError, ContextManager, DeflateEncoderStreamId, Encoder, CustomerDataTrackerManager } from '@datadog/browser-core';
import { LifeCycle } from '../domain/lifeCycle';

@@ -9,3 +9,3 @@ import type { RumSessionManager } from '../domain/rumSessionManager';

import type { RecorderApi } from './rumPublicApi';
export declare function startRum(initConfiguration: RumInitConfiguration, configuration: RumConfiguration, recorderApi: RecorderApi, globalContextManager: ContextManager, userContextManager: ContextManager, initialViewOptions: ViewOptions | undefined, createEncoder: (streamId: DeflateEncoderStreamId) => Encoder): {
export declare function startRum(initConfiguration: RumInitConfiguration, configuration: RumConfiguration, recorderApi: RecorderApi, customerDataTrackerManager: CustomerDataTrackerManager, globalContextManager: ContextManager, userContextManager: ContextManager, initialViewOptions: ViewOptions | undefined, createEncoder: (streamId: DeflateEncoderStreamId) => Encoder): {
addAction: (action: import("../domain/action/actionCollection").CustomAction, savedCommonContext?: CommonContext | undefined) => void;

@@ -12,0 +12,0 @@ addError: ({ error, handlingStack, startClocks, context: customerContext }: import("../domain/error/errorCollection").ProvidedError, savedCommonContext?: CommonContext | undefined) => void;

@@ -25,3 +25,3 @@ import { sendToExtension, createPageExitObservable, addTelemetryConfiguration, startTelemetry, canUseEventBridge, getEventBridge, addTelemetryDebug, } from '@datadog/browser-core';

import { startDisplayContext } from '../domain/contexts/displayContext';
export function startRum(initConfiguration, configuration, recorderApi, globalContextManager, userContextManager, initialViewOptions, createEncoder) {
export function startRum(initConfiguration, configuration, recorderApi, customerDataTrackerManager, globalContextManager, userContextManager, initialViewOptions, createEncoder) {
var cleanupTasks = [];

@@ -52,3 +52,3 @@ var lifeCycle = new LifeCycle();

};
var featureFlagContexts = startFeatureFlagContexts(lifeCycle);
var featureFlagContexts = startFeatureFlagContexts(lifeCycle, customerDataTrackerManager.getOrCreateTracker(0 /* CustomerDataType.FeatureFlag */));
var pageExitObservable = createPageExitObservable(configuration);

@@ -63,3 +63,3 @@ var pageExitSubscription = pageExitObservable.subscribe(function (event) {

cleanupTasks.push(function () { return batch_1.stop(); });
startCustomerDataTelemetry(configuration, telemetry, lifeCycle, globalContextManager, userContextManager, featureFlagContexts, batch_1.flushObservable);
startCustomerDataTelemetry(configuration, telemetry, lifeCycle, customerDataTrackerManager, batch_1.flushObservable);
}

@@ -66,0 +66,0 @@ else {

import { monitor, noop, Observable, getZoneJsOriginalValue } from '@datadog/browser-core';
export function createDOMMutationObservable() {
var MutationObserver = getMutationObserverConstructor();
var observable = new Observable(function () {
return new Observable(function (observable) {
if (!MutationObserver) {

@@ -17,3 +17,2 @@ return;

});
return observable;
}

@@ -20,0 +19,0 @@ export function getMutationObserverConstructor() {

@@ -1,7 +0,18 @@

import { addEventListener, DOM_EVENT, instrumentMethodAndCallOriginal, Observable, shallowClone, } from '@datadog/browser-core';
import { addEventListener, DOM_EVENT, instrumentMethod, Observable, shallowClone } from '@datadog/browser-core';
export function createLocationChangeObservable(configuration, location) {
var currentLocation = shallowClone(location);
var observable = new Observable(function () {
return new Observable(function (observable) {
var stopHistoryTracking = trackHistory(configuration, onLocationChange).stop;
var stopHashTracking = trackHash(configuration, onLocationChange).stop;
function onLocationChange() {
if (currentLocation.href === location.href) {
return;
}
var newLocation = shallowClone(location);
observable.notify({
newLocation: newLocation,
oldLocation: currentLocation,
});
currentLocation = newLocation;
}
return function () {

@@ -12,21 +23,11 @@ stopHistoryTracking();

});
function onLocationChange() {
if (currentLocation.href === location.href) {
return;
}
var newLocation = shallowClone(location);
observable.notify({
newLocation: newLocation,
oldLocation: currentLocation,
});
currentLocation = newLocation;
}
return observable;
}
function trackHistory(configuration, onHistoryChange) {
var stopInstrumentingPushState = instrumentMethodAndCallOriginal(history, 'pushState', {
after: onHistoryChange,
var stopInstrumentingPushState = instrumentMethod(history, 'pushState', function (_a) {
var onPostCall = _a.onPostCall;
onPostCall(onHistoryChange);
}).stop;
var stopInstrumentingReplaceState = instrumentMethodAndCallOriginal(history, 'replaceState', {
after: onHistoryChange,
var stopInstrumentingReplaceState = instrumentMethod(history, 'replaceState', function (_a) {
var onPostCall = _a.onPostCall;
onPostCall(onHistoryChange);
}).stop;

@@ -33,0 +34,0 @@ var removeListener = addEventListener(configuration, window, DOM_EVENT.POP_STATE, onHistoryChange).stop;

@@ -10,3 +10,3 @@ import { Observable, throttle, addEventListener, DOM_EVENT } from '@datadog/browser-core';

export function createViewportObservable(configuration) {
var observable = new Observable(function () {
return new Observable(function (observable) {
var updateDimension = throttle(function () {

@@ -18,3 +18,2 @@ observable.notify(getViewportDimension());

});
return observable;
}

@@ -21,0 +20,0 @@ // excludes the width and height of any rendered classic scrollbar that is fixed to the visual viewport

@@ -1,2 +0,2 @@

import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, assign, round, } from '@datadog/browser-core';
import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, assign, round, isExperimentalFeatureEnabled, ExperimentalFeature, } from '@datadog/browser-core';
import { getSyntheticsContext } from './contexts/syntheticsContext';

@@ -26,2 +26,4 @@ import { getCiTestContext } from './contexts/ciTestContext';

'resource.url': 'string',
}, isExperimentalFeatureEnabled(ExperimentalFeature.WRITABLE_RESOURCE_GRAPHQL) && {
'resource.graphql': 'object',
}, USER_CUSTOMIZABLE_FIELD_PATHS, VIEW_MODIFIABLE_FIELD_PATHS),

@@ -55,3 +57,3 @@ _a["action" /* RumEventType.ACTION */] = assign({

},
browser_sdk_version: canUseEventBridge() ? "5.6.0" : undefined,
browser_sdk_version: canUseEventBridge() ? "5.7.0" : undefined,
},

@@ -58,0 +60,0 @@ application: {

@@ -1,3 +0,2 @@

import type { RelativeTime, ContextValue, Context } from '@datadog/browser-core';
import { computeBytesCount } from '@datadog/browser-core';
import type { RelativeTime, ContextValue, Context, CustomerDataTracker } from '@datadog/browser-core';
import type { LifeCycle } from '../lifeCycle';

@@ -9,3 +8,2 @@ export declare const FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY: number;

findFeatureFlagEvaluations: (startTime?: RelativeTime) => FeatureFlagContext | undefined;
getFeatureFlagBytesCount: () => number;
addFeatureFlagEvaluation: (key: string, value: ContextValue) => void;

@@ -22,2 +20,2 @@ stop: () => void;

*/
export declare function startFeatureFlagContexts(lifeCycle: LifeCycle, computeBytesCountImpl?: typeof computeBytesCount): FeatureFlagContexts;
export declare function startFeatureFlagContexts(lifeCycle: LifeCycle, customerDataTracker: CustomerDataTracker): FeatureFlagContexts;

@@ -1,2 +0,2 @@

import { warnIfCustomerDataLimitReached, throttle, jsonStringify, computeBytesCount, noop, isExperimentalFeatureEnabled, SESSION_TIME_OUT_DELAY, ValueHistory, ExperimentalFeature, } from '@datadog/browser-core';
import { noop, isExperimentalFeatureEnabled, SESSION_TIME_OUT_DELAY, ValueHistory, ExperimentalFeature, } from '@datadog/browser-core';
export var FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY;

@@ -12,8 +12,6 @@ export var BYTES_COMPUTATION_THROTTLING_DELAY = 200;

*/
export function startFeatureFlagContexts(lifeCycle, computeBytesCountImpl) {
if (computeBytesCountImpl === void 0) { computeBytesCountImpl = computeBytesCount; }
export function startFeatureFlagContexts(lifeCycle, customerDataTracker) {
if (!isExperimentalFeatureEnabled(ExperimentalFeature.FEATURE_FLAGS)) {
return {
findFeatureFlagEvaluations: function () { return undefined; },
getFeatureFlagBytesCount: function () { return 0; },
addFeatureFlagEvaluation: noop,

@@ -24,4 +22,2 @@ stop: noop,

var featureFlagContexts = new ValueHistory(FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY);
var bytesCountCache = 0;
var alreadyWarned = false;
lifeCycle.subscribe(4 /* LifeCycleEventType.VIEW_ENDED */, function (_a) {

@@ -34,21 +30,6 @@ var endClocks = _a.endClocks;

featureFlagContexts.add({}, startClocks.relative);
bytesCountCache = 0;
customerDataTracker.resetCustomerData();
});
// Throttle the bytes computation to minimize the impact on performance.
// Especially useful if the user call addFeatureFlagEvaluation API synchronously multiple times in a row
var _a = throttle(function (context) {
bytesCountCache = computeBytesCountImpl(jsonStringify(context));
if (!alreadyWarned) {
alreadyWarned = warnIfCustomerDataLimitReached(bytesCountCache, 0 /* CustomerDataType.FeatureFlag */);
}
}, BYTES_COMPUTATION_THROTTLING_DELAY), computeBytesCountThrottled = _a.throttled, cancelPendingComputation = _a.cancel;
return {
findFeatureFlagEvaluations: function (startTime) { return featureFlagContexts.find(startTime); },
getFeatureFlagBytesCount: function () {
var currentContext = featureFlagContexts.find();
if (!currentContext) {
return 0;
}
return bytesCountCache;
},
addFeatureFlagEvaluation: function (key, value) {

@@ -58,8 +39,8 @@ var currentContext = featureFlagContexts.find();

currentContext[key] = value;
computeBytesCountThrottled(currentContext);
customerDataTracker.updateCustomerData(currentContext);
}
},
stop: cancelPendingComputation,
stop: function () { return customerDataTracker.stop(); },
};
}
//# sourceMappingURL=featureFlagContext.js.map

@@ -1,6 +0,5 @@

import type { ContextManager, FlushEvent, Observable, Telemetry } from '@datadog/browser-core';
import type { CustomerDataTrackerManager, FlushEvent, Observable, Telemetry } from '@datadog/browser-core';
import type { RumConfiguration } from './configuration';
import type { FeatureFlagContexts } from './contexts/featureFlagContext';
import type { LifeCycle } from './lifeCycle';
export declare const MEASURES_PERIOD_DURATION: number;
export declare function startCustomerDataTelemetry(configuration: RumConfiguration, telemetry: Telemetry, lifeCycle: LifeCycle, globalContextManager: ContextManager, userContextManager: ContextManager, featureFlagContexts: FeatureFlagContexts, batchFlushObservable: Observable<FlushEvent>): void;
export declare function startCustomerDataTelemetry(configuration: RumConfiguration, telemetry: Telemetry, lifeCycle: LifeCycle, customerDataTrackerManager: CustomerDataTrackerManager, batchFlushObservable: Observable<FlushEvent>): void;

@@ -1,2 +0,2 @@

import { isEmptyObject, includes, performDraw, ONE_SECOND, addTelemetryDebug, setInterval } from '@datadog/browser-core';
import { includes, performDraw, ONE_SECOND, addTelemetryDebug, setInterval, } from '@datadog/browser-core';
export var MEASURES_PERIOD_DURATION = 10 * ONE_SECOND;

@@ -6,3 +6,3 @@ var currentPeriodMeasures;

var batchHasRumEvent;
export function startCustomerDataTelemetry(configuration, telemetry, lifeCycle, globalContextManager, userContextManager, featureFlagContexts, batchFlushObservable) {
export function startCustomerDataTelemetry(configuration, telemetry, lifeCycle, customerDataTrackerManager, batchFlushObservable) {
var customerDataTelemetryEnabled = telemetry.enabled && performDraw(configuration.customerDataTelemetrySampleRate);

@@ -18,9 +18,7 @@ if (!customerDataTelemetryEnabled) {

batchHasRumEvent = true;
updateMeasure(currentBatchMeasures.globalContextBytes, !isEmptyObject(globalContextManager.getContext()) ? globalContextManager.getBytesCount() : 0);
updateMeasure(currentBatchMeasures.userContextBytes, !isEmptyObject(userContextManager.getContext()) ? userContextManager.getBytesCount() : 0);
var featureFlagContext = featureFlagContexts.findFeatureFlagEvaluations();
var hasFeatureFlagContext = includes(["view" /* RumEventType.VIEW */, "error" /* RumEventType.ERROR */], event.type) &&
featureFlagContext &&
!isEmptyObject(featureFlagContext);
updateMeasure(currentBatchMeasures.featureFlagBytes, hasFeatureFlagContext ? featureFlagContexts.getFeatureFlagBytesCount() : 0);
updateMeasure(currentBatchMeasures.globalContextBytes, customerDataTrackerManager.getOrCreateTracker(2 /* CustomerDataType.GlobalContext */).getBytesCount());
updateMeasure(currentBatchMeasures.userContextBytes, customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */).getBytesCount());
updateMeasure(currentBatchMeasures.featureFlagBytes, includes(["view" /* RumEventType.VIEW */, "error" /* RumEventType.ERROR */], event.type)
? customerDataTrackerManager.getOrCreateTracker(0 /* CustomerDataType.FeatureFlag */).getBytesCount()
: 0);
});

@@ -27,0 +25,0 @@ batchFlushObservable.subscribe(function (_a) {

@@ -50,3 +50,3 @@ import { Observable, ONE_SECOND, elapsed, relativeNow, throttle, addEventListener, DOM_EVENT, monitor, } from '@datadog/browser-core';

if (throttleDuration === void 0) { throttleDuration = THROTTLE_SCROLL_DURATION; }
var observable = new Observable(function () {
return new Observable(function (observable) {
function notify() {

@@ -73,4 +73,3 @@ observable.notify(computeScrollValues());

});
return observable;
}
//# sourceMappingURL=trackScrollMetrics.js.map

@@ -1,2 +0,2 @@

import { instrumentMethodAndCallOriginal, matchList, monitor, Observable, timeStampNow, setTimeout, clearTimeout, } from '@datadog/browser-core';
import { instrumentMethod, matchList, monitor, Observable, timeStampNow, setTimeout, clearTimeout, } from '@datadog/browser-core';
import { RumPerformanceEntryType } from '../browser/performanceCollection';

@@ -74,3 +74,3 @@ // Delay to wait for a page activity to validate the tracking process

export function createPageActivityObservable(lifeCycle, domMutationObservable, configuration) {
var observable = new Observable(function () {
return new Observable(function (observable) {
var subscriptions = [];

@@ -111,3 +111,2 @@ var firstRequestIndex;

});
return observable;
}

@@ -118,4 +117,4 @@ function isExcludedUrl(configuration, requestUrl) {

function trackWindowOpen(callback) {
return instrumentMethodAndCallOriginal(window, 'open', { before: callback });
return instrumentMethod(window, 'open', callback);
}
//# sourceMappingURL=waitPageActivityEnd.js.map
{
"name": "@datadog/browser-rum-core",
"version": "5.6.0",
"version": "5.7.0",
"license": "Apache-2.0",

@@ -15,3 +15,3 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "5.6.0"
"@datadog/browser-core": "5.7.0"
},

@@ -32,3 +32,3 @@ "devDependencies": {

},
"gitHead": "05639c3fb1cf1aefa19b9a49cec182a628135acb"
"gitHead": "c631b23ad26be38c64db98c134cb3c57fa5cf7f7"
}

@@ -33,2 +33,4 @@ import type {

createIdentityEncoder,
CustomerDataCompressionStatus,
createCustomerDataTrackerManager,
} from '@datadog/browser-core'

@@ -93,4 +95,7 @@ import type { LifeCycle } from '../domain/lifeCycle'

let globalContextManager = createContextManager(CustomerDataType.GlobalContext)
let userContextManager = createContextManager(CustomerDataType.User)
const customerDataTrackerManager = createCustomerDataTrackerManager(CustomerDataCompressionStatus.Unknown)
let globalContextManager = createContextManager(
customerDataTrackerManager.getOrCreateTracker(CustomerDataType.GlobalContext)
)
let userContextManager = createContextManager(customerDataTrackerManager.getOrCreateTracker(CustomerDataType.User))

@@ -211,10 +216,24 @@ let getInternalContextStrategy: StartRumResult['getInternalContext'] = () => undefined

const beforeInitGlobalContext = globalContextManager.getContext()
globalContextManager = createStoredContextManager(configuration, RUM_STORAGE_KEY, CustomerDataType.GlobalContext)
globalContextManager = createStoredContextManager(
configuration,
RUM_STORAGE_KEY,
CustomerDataType.GlobalContext,
customerDataTrackerManager.getOrCreateTracker(CustomerDataType.GlobalContext)
)
globalContextManager.setContext(combine(globalContextManager.getContext(), beforeInitGlobalContext))
const beforeInitUserContext = userContextManager.getContext()
userContextManager = createStoredContextManager(configuration, RUM_STORAGE_KEY, CustomerDataType.User)
userContextManager = createStoredContextManager(
configuration,
RUM_STORAGE_KEY,
CustomerDataType.User,
customerDataTrackerManager.getOrCreateTracker(CustomerDataType.User)
)
userContextManager.setContext(combine(userContextManager.getContext(), beforeInitUserContext))
}
customerDataTrackerManager.setCompressionStatus(
deflateWorker ? CustomerDataCompressionStatus.Enabled : CustomerDataCompressionStatus.Disabled
)
const startRumResults = startRumImpl(

@@ -224,2 +243,3 @@ initConfiguration,

recorderApi,
customerDataTrackerManager,
globalContextManager,

@@ -226,0 +246,0 @@ userContextManager,

@@ -8,2 +8,3 @@ import type {

Encoder,
CustomerDataTrackerManager,
} from '@datadog/browser-core'

@@ -19,2 +20,3 @@ import {

addTelemetryDebug,
CustomerDataType,
} from '@datadog/browser-core'

@@ -55,2 +57,3 @@ import { createDOMMutationObservable } from '../browser/domMutationObservable'

recorderApi: RecorderApi,
customerDataTrackerManager: CustomerDataTrackerManager,
globalContextManager: ContextManager,

@@ -86,3 +89,6 @@ userContextManager: ContextManager,

}
const featureFlagContexts = startFeatureFlagContexts(lifeCycle)
const featureFlagContexts = startFeatureFlagContexts(
lifeCycle,
customerDataTrackerManager.getOrCreateTracker(CustomerDataType.FeatureFlag)
)

@@ -107,11 +113,3 @@ const pageExitObservable = createPageExitObservable(configuration)

cleanupTasks.push(() => batch.stop())
startCustomerDataTelemetry(
configuration,
telemetry,
lifeCycle,
globalContextManager,
userContextManager,
featureFlagContexts,
batch.flushObservable
)
startCustomerDataTelemetry(configuration, telemetry, lifeCycle, customerDataTrackerManager, batch.flushObservable)
} else {

@@ -118,0 +116,0 @@ startRumEventBridge(lifeCycle)

@@ -6,3 +6,3 @@ import { monitor, noop, Observable, getZoneJsOriginalValue } from '@datadog/browser-core'

const observable: Observable<void> = new Observable<void>(() => {
return new Observable<void>((observable) => {
if (!MutationObserver) {

@@ -20,4 +20,2 @@ return

})
return observable
}

@@ -24,0 +22,0 @@

@@ -1,8 +0,2 @@

import {
addEventListener,
DOM_EVENT,
instrumentMethodAndCallOriginal,
Observable,
shallowClone,
} from '@datadog/browser-core'
import { addEventListener, DOM_EVENT, instrumentMethod, Observable, shallowClone } from '@datadog/browser-core'
import type { RumConfiguration } from '../domain/configuration'

@@ -17,5 +11,19 @@

let currentLocation = shallowClone(location)
const observable = new Observable<LocationChange>(() => {
return new Observable<LocationChange>((observable) => {
const { stop: stopHistoryTracking } = trackHistory(configuration, onLocationChange)
const { stop: stopHashTracking } = trackHash(configuration, onLocationChange)
function onLocationChange() {
if (currentLocation.href === location.href) {
return
}
const newLocation = shallowClone(location)
observable.notify({
newLocation,
oldLocation: currentLocation,
})
currentLocation = newLocation
}
return () => {

@@ -26,24 +34,10 @@ stopHistoryTracking()

})
function onLocationChange() {
if (currentLocation.href === location.href) {
return
}
const newLocation = shallowClone(location)
observable.notify({
newLocation,
oldLocation: currentLocation,
})
currentLocation = newLocation
}
return observable
}
function trackHistory(configuration: RumConfiguration, onHistoryChange: () => void) {
const { stop: stopInstrumentingPushState } = instrumentMethodAndCallOriginal(history, 'pushState', {
after: onHistoryChange,
const { stop: stopInstrumentingPushState } = instrumentMethod(history, 'pushState', ({ onPostCall }) => {
onPostCall(onHistoryChange)
})
const { stop: stopInstrumentingReplaceState } = instrumentMethodAndCallOriginal(history, 'replaceState', {
after: onHistoryChange,
const { stop: stopInstrumentingReplaceState } = instrumentMethod(history, 'replaceState', ({ onPostCall }) => {
onPostCall(onHistoryChange)
})

@@ -50,0 +44,0 @@ const { stop: removeListener } = addEventListener(configuration, window, DOM_EVENT.POP_STATE, onHistoryChange)

@@ -19,3 +19,3 @@ import { Observable, throttle, addEventListener, DOM_EVENT } from '@datadog/browser-core'

export function createViewportObservable(configuration: RumConfiguration) {
const observable = new Observable<ViewportDimension>(() => {
return new Observable<ViewportDimension>((observable) => {
const { throttled: updateDimension } = throttle(() => {

@@ -28,4 +28,2 @@ observable.notify(getViewportDimension())

})
return observable
}

@@ -32,0 +30,0 @@

@@ -12,2 +12,4 @@ import type { Context, RawError, EventRateLimiter, User } from '@datadog/browser-core'

round,
isExperimentalFeatureEnabled,
ExperimentalFeature,
} from '@datadog/browser-core'

@@ -88,2 +90,5 @@ import type { RumEventDomainContext } from '../domainContext.types'

},
isExperimentalFeatureEnabled(ExperimentalFeature.WRITABLE_RESOURCE_GRAPHQL) && {
'resource.graphql': 'object',
},
USER_CUSTOMIZABLE_FIELD_PATHS,

@@ -90,0 +95,0 @@ VIEW_MODIFIABLE_FIELD_PATHS

@@ -1,8 +0,3 @@

import type { RelativeTime, ContextValue, Context } from '@datadog/browser-core'
import type { RelativeTime, ContextValue, Context, CustomerDataTracker } from '@datadog/browser-core'
import {
CustomerDataType,
warnIfCustomerDataLimitReached,
throttle,
jsonStringify,
computeBytesCount,
noop,

@@ -24,3 +19,2 @@ isExperimentalFeatureEnabled,

findFeatureFlagEvaluations: (startTime?: RelativeTime) => FeatureFlagContext | undefined
getFeatureFlagBytesCount: () => number
addFeatureFlagEvaluation: (key: string, value: ContextValue) => void

@@ -40,3 +34,3 @@ stop: () => void

lifeCycle: LifeCycle,
computeBytesCountImpl = computeBytesCount
customerDataTracker: CustomerDataTracker
): FeatureFlagContexts {

@@ -46,3 +40,2 @@ if (!isExperimentalFeatureEnabled(ExperimentalFeature.FEATURE_FLAGS)) {

findFeatureFlagEvaluations: () => undefined,
getFeatureFlagBytesCount: () => 0,
addFeatureFlagEvaluation: noop,

@@ -54,4 +47,2 @@ stop: noop,

const featureFlagContexts = new ValueHistory<FeatureFlagContext>(FEATURE_FLAG_CONTEXT_TIME_OUT_DELAY)
let bytesCountCache = 0
let alreadyWarned = false

@@ -64,24 +55,7 @@ lifeCycle.subscribe(LifeCycleEventType.VIEW_ENDED, ({ endClocks }) => {

featureFlagContexts.add({}, startClocks.relative)
bytesCountCache = 0
customerDataTracker.resetCustomerData()
})
// Throttle the bytes computation to minimize the impact on performance.
// Especially useful if the user call addFeatureFlagEvaluation API synchronously multiple times in a row
const { throttled: computeBytesCountThrottled, cancel: cancelPendingComputation } = throttle((context: Context) => {
bytesCountCache = computeBytesCountImpl(jsonStringify(context)!)
if (!alreadyWarned) {
alreadyWarned = warnIfCustomerDataLimitReached(bytesCountCache, CustomerDataType.FeatureFlag)
}
}, BYTES_COMPUTATION_THROTTLING_DELAY)
return {
findFeatureFlagEvaluations: (startTime?: RelativeTime) => featureFlagContexts.find(startTime),
getFeatureFlagBytesCount: () => {
const currentContext = featureFlagContexts.find()
if (!currentContext) {
return 0
}
return bytesCountCache
},
addFeatureFlagEvaluation: (key: string, value: ContextValue) => {

@@ -91,7 +65,7 @@ const currentContext = featureFlagContexts.find()

currentContext[key] = value
computeBytesCountThrottled(currentContext)
customerDataTracker.updateCustomerData(currentContext)
}
},
stop: cancelPendingComputation,
stop: () => customerDataTracker.stop(),
}
}

@@ -1,7 +0,13 @@

import type { Context, ContextManager, FlushEvent, Observable, Telemetry } from '@datadog/browser-core'
import { isEmptyObject, includes, performDraw, ONE_SECOND, addTelemetryDebug, setInterval } from '@datadog/browser-core'
import type { Context, CustomerDataTrackerManager, FlushEvent, Observable, Telemetry } from '@datadog/browser-core'
import {
includes,
performDraw,
ONE_SECOND,
addTelemetryDebug,
setInterval,
CustomerDataType,
} from '@datadog/browser-core'
import { RumEventType } from '../rawRumEvent.types'
import type { RumEvent } from '../rumEvent.types'
import type { RumConfiguration } from './configuration'
import type { FeatureFlagContexts } from './contexts/featureFlagContext'
import type { LifeCycle } from './lifeCycle'

@@ -41,5 +47,3 @@ import { LifeCycleEventType } from './lifeCycle'

lifeCycle: LifeCycle,
globalContextManager: ContextManager,
userContextManager: ContextManager,
featureFlagContexts: FeatureFlagContexts,
customerDataTrackerManager: CustomerDataTrackerManager,
batchFlushObservable: Observable<FlushEvent>

@@ -61,3 +65,3 @@ ) {

currentBatchMeasures.globalContextBytes,
!isEmptyObject(globalContextManager.getContext()) ? globalContextManager.getBytesCount() : 0
customerDataTrackerManager.getOrCreateTracker(CustomerDataType.GlobalContext).getBytesCount()
)

@@ -67,13 +71,10 @@

currentBatchMeasures.userContextBytes,
!isEmptyObject(userContextManager.getContext()) ? userContextManager.getBytesCount() : 0
customerDataTrackerManager.getOrCreateTracker(CustomerDataType.User).getBytesCount()
)
const featureFlagContext = featureFlagContexts.findFeatureFlagEvaluations()
const hasFeatureFlagContext =
includes([RumEventType.VIEW, RumEventType.ERROR], event.type) &&
featureFlagContext &&
!isEmptyObject(featureFlagContext)
updateMeasure(
currentBatchMeasures.featureFlagBytes,
hasFeatureFlagContext ? featureFlagContexts.getFeatureFlagBytesCount() : 0
includes([RumEventType.VIEW, RumEventType.ERROR], event.type)
? customerDataTrackerManager.getOrCreateTracker(CustomerDataType.FeatureFlag).getBytesCount()
: 0
)

@@ -80,0 +81,0 @@ })

@@ -92,3 +92,3 @@ import type { ClocksState, Duration } from '@datadog/browser-core'

): Observable<ScrollValues> {
const observable = new Observable<ScrollValues>(() => {
return new Observable<ScrollValues>((observable) => {
function notify() {

@@ -118,4 +118,2 @@ observable.notify(computeScrollValues())

})
return observable
}
import type { Subscription, TimeoutId, TimeStamp } from '@datadog/browser-core'
import {
instrumentMethodAndCallOriginal,
instrumentMethod,
matchList,

@@ -123,3 +123,3 @@ monitor,

): Observable<PageActivityEvent> {
const observable = new Observable<PageActivityEvent>(() => {
return new Observable<PageActivityEvent>((observable) => {
const subscriptions: Subscription[] = []

@@ -175,4 +175,2 @@ let firstRequestIndex: undefined | number

})
return observable
}

@@ -185,3 +183,3 @@

function trackWindowOpen(callback: () => void) {
return instrumentMethodAndCallOriginal(window, 'open', { before: callback })
return instrumentMethod(window, 'open', callback)
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc