@datadog/browser-rum-core
Advanced tools
Comparing version 4.40.0 to 4.41.0
@@ -107,6 +107,4 @@ "use strict"; | ||
addActionStrategy({ | ||
name: (0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.SANITIZE_INPUTS) ? (0, browser_core_1.sanitize)(name) : name, | ||
context: ((0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.SANITIZE_INPUTS) | ||
? (0, browser_core_1.sanitize)(context) | ||
: (0, browser_core_1.deepClone)(context)), | ||
name: (0, browser_core_1.sanitize)(name), | ||
context: (0, browser_core_1.sanitize)(context), | ||
startClocks: (0, browser_core_1.clocksNow)(), | ||
@@ -122,5 +120,3 @@ type: "custom" /* ActionType.CUSTOM */, | ||
handlingStack: handlingStack, | ||
context: ((0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.SANITIZE_INPUTS) | ||
? (0, browser_core_1.sanitize)(context) | ||
: (0, browser_core_1.deepClone)(context)), | ||
context: (0, browser_core_1.sanitize)(context), | ||
startClocks: (0, browser_core_1.clocksNow)(), | ||
@@ -131,3 +127,3 @@ }); | ||
addTiming: (0, browser_core_1.monitor)(function (name, time) { | ||
addTimingStrategy((0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.SANITIZE_INPUTS) ? (0, browser_core_1.sanitize)(name) : name, time); | ||
addTimingStrategy((0, browser_core_1.sanitize)(name), time); | ||
}), | ||
@@ -159,3 +155,3 @@ setUser: (0, browser_core_1.monitor)(function (newUser) { | ||
addFeatureFlagEvaluation: (0, browser_core_1.monitor)(function (key, value) { | ||
addFeatureFlagEvaluationStrategy((0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.SANITIZE_INPUTS) ? (0, browser_core_1.sanitize)(key) : key, (0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.SANITIZE_INPUTS) ? (0, browser_core_1.sanitize)(value) : value); | ||
addFeatureFlagEvaluationStrategy((0, browser_core_1.sanitize)(key), (0, browser_core_1.sanitize)(value)); | ||
}), | ||
@@ -162,0 +158,0 @@ getSessionReplayLink: (0, browser_core_1.monitor)(function () { return getSessionReplayLinkStrategy(); }), |
@@ -46,3 +46,3 @@ "use strict"; | ||
}, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "4.40.0" : undefined, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "4.41.0" : undefined, | ||
}, | ||
@@ -49,0 +49,0 @@ application: { |
@@ -11,2 +11,3 @@ import type { RelativeTime, ContextValue, Context } from '@datadog/browser-core'; | ||
addFeatureFlagEvaluation: (key: string, value: ContextValue) => void; | ||
stop: () => void; | ||
} | ||
@@ -13,0 +14,0 @@ /** |
@@ -22,2 +22,3 @@ "use strict"; | ||
addFeatureFlagEvaluation: browser_core_1.noop, | ||
stop: browser_core_1.noop, | ||
}; | ||
@@ -39,3 +40,3 @@ } | ||
// Especially useful if the user call addFeatureFlagEvaluation API synchronously multiple times in a row | ||
var computeBytesCountThrottled = (0, browser_core_1.throttle)(function (context) { | ||
var _a = (0, browser_core_1.throttle)(function (context) { | ||
bytesCountCache = computeBytesCountImpl((0, browser_core_1.jsonStringify)(context)); | ||
@@ -45,3 +46,3 @@ if (!alreadyWarned) { | ||
} | ||
}, exports.BYTES_COMPUTATION_THROTTLING_DELAY).throttled; | ||
}, exports.BYTES_COMPUTATION_THROTTLING_DELAY), computeBytesCountThrottled = _a.throttled, cancelPendingComputation = _a.cancel; | ||
return { | ||
@@ -63,2 +64,3 @@ findFeatureFlagEvaluations: function (startTime) { return featureFlagContexts.find(startTime); }, | ||
}, | ||
stop: cancelPendingComputation, | ||
}; | ||
@@ -65,0 +67,0 @@ } |
@@ -18,3 +18,3 @@ "use strict"; | ||
if (newType === originalType) { | ||
set(object, path, (0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.SANITIZE_INPUTS) ? (0, browser_core_1.sanitize)(newValue) : newValue); | ||
set(object, path, (0, browser_core_1.sanitize)(newValue)); | ||
} | ||
@@ -21,0 +21,0 @@ else if (originalType === 'object' && (newType === 'undefined' || newType === 'null')) { |
@@ -1,2 +0,2 @@ | ||
import { ExperimentalFeature, noop, isExperimentalFeatureEnabled, willSyntheticsInjectRum, assign, BoundedBuffer, buildCookieOptions, createContextManager, deepClone, makePublicApi, monitor, clocksNow, timeStampNow, display, callMonitored, createHandlingStack, canUseEventBridge, areCookiesAuthorized, checkUser, sanitizeUser, sanitize, } from '@datadog/browser-core'; | ||
import { noop, willSyntheticsInjectRum, assign, BoundedBuffer, buildCookieOptions, createContextManager, deepClone, makePublicApi, monitor, clocksNow, timeStampNow, display, callMonitored, createHandlingStack, canUseEventBridge, areCookiesAuthorized, checkUser, sanitizeUser, sanitize, } from '@datadog/browser-core'; | ||
import { validateAndBuildRumConfiguration } from '../domain/configuration'; | ||
@@ -104,6 +104,4 @@ import { buildCommonContext } from '../domain/contexts/commonContext'; | ||
addActionStrategy({ | ||
name: isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(name) : name, | ||
context: (isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) | ||
? sanitize(context) | ||
: deepClone(context)), | ||
name: sanitize(name), | ||
context: sanitize(context), | ||
startClocks: clocksNow(), | ||
@@ -119,5 +117,3 @@ type: "custom" /* ActionType.CUSTOM */, | ||
handlingStack: handlingStack, | ||
context: (isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) | ||
? sanitize(context) | ||
: deepClone(context)), | ||
context: sanitize(context), | ||
startClocks: clocksNow(), | ||
@@ -128,3 +124,3 @@ }); | ||
addTiming: monitor(function (name, time) { | ||
addTimingStrategy(isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(name) : name, time); | ||
addTimingStrategy(sanitize(name), time); | ||
}), | ||
@@ -156,3 +152,3 @@ setUser: monitor(function (newUser) { | ||
addFeatureFlagEvaluation: monitor(function (key, value) { | ||
addFeatureFlagEvaluationStrategy(isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(key) : key, isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(value) : value); | ||
addFeatureFlagEvaluationStrategy(sanitize(key), sanitize(value)); | ||
}), | ||
@@ -159,0 +155,0 @@ getSessionReplayLink: monitor(function () { return getSessionReplayLinkStrategy(); }), |
@@ -43,3 +43,3 @@ import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, } from '@datadog/browser-core'; | ||
}, | ||
browser_sdk_version: canUseEventBridge() ? "4.40.0" : undefined, | ||
browser_sdk_version: canUseEventBridge() ? "4.41.0" : undefined, | ||
}, | ||
@@ -46,0 +46,0 @@ application: { |
@@ -11,2 +11,3 @@ import type { RelativeTime, ContextValue, Context } from '@datadog/browser-core'; | ||
addFeatureFlagEvaluation: (key: string, value: ContextValue) => void; | ||
stop: () => void; | ||
} | ||
@@ -13,0 +14,0 @@ /** |
@@ -19,2 +19,3 @@ import { warnIfCustomerDataLimitReached, throttle, jsonStringify, computeBytesCount, noop, isExperimentalFeatureEnabled, SESSION_TIME_OUT_DELAY, ValueHistory, ExperimentalFeature, } from '@datadog/browser-core'; | ||
addFeatureFlagEvaluation: noop, | ||
stop: noop, | ||
}; | ||
@@ -36,3 +37,3 @@ } | ||
// Especially useful if the user call addFeatureFlagEvaluation API synchronously multiple times in a row | ||
var computeBytesCountThrottled = throttle(function (context) { | ||
var _a = throttle(function (context) { | ||
bytesCountCache = computeBytesCountImpl(jsonStringify(context)); | ||
@@ -42,3 +43,3 @@ if (!alreadyWarned) { | ||
} | ||
}, BYTES_COMPUTATION_THROTTLING_DELAY).throttled; | ||
}, BYTES_COMPUTATION_THROTTLING_DELAY), computeBytesCountThrottled = _a.throttled, cancelPendingComputation = _a.cancel; | ||
return { | ||
@@ -60,4 +61,5 @@ findFeatureFlagEvaluations: function (startTime) { return featureFlagContexts.find(startTime); }, | ||
}, | ||
stop: cancelPendingComputation, | ||
}; | ||
} | ||
//# sourceMappingURL=featureFlagContext.js.map |
@@ -1,2 +0,2 @@ | ||
import { ExperimentalFeature, isExperimentalFeatureEnabled, sanitize, deepClone, getType } from '@datadog/browser-core'; | ||
import { sanitize, deepClone, getType } from '@datadog/browser-core'; | ||
/** | ||
@@ -15,3 +15,3 @@ * Current limitation: | ||
if (newType === originalType) { | ||
set(object, path, isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(newValue) : newValue); | ||
set(object, path, sanitize(newValue)); | ||
} | ||
@@ -18,0 +18,0 @@ else if (originalType === 'object' && (newType === 'undefined' || newType === 'null')) { |
{ | ||
"name": "@datadog/browser-rum-core", | ||
"version": "4.40.0", | ||
"version": "4.41.0", | ||
"license": "Apache-2.0", | ||
@@ -15,3 +15,3 @@ "main": "cjs/index.js", | ||
"dependencies": { | ||
"@datadog/browser-core": "4.40.0" | ||
"@datadog/browser-core": "4.41.0" | ||
}, | ||
@@ -29,3 +29,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "4a291821c3e07385b7ab76566bb6aa5d4cc5a80f" | ||
"gitHead": "1fcc1cabdf989599914551d0ef82e6cb8d569892" | ||
} |
import type { Context, InitConfiguration, TimeStamp, RelativeTime, User } from '@datadog/browser-core' | ||
import { | ||
ExperimentalFeature, | ||
noop, | ||
isExperimentalFeatureEnabled, | ||
CustomerDataType, | ||
@@ -216,6 +214,4 @@ willSyntheticsInjectRum, | ||
addActionStrategy({ | ||
name: isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(name)! : name, | ||
context: (isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) | ||
? sanitize(context) | ||
: deepClone(context)) as Context, | ||
name: sanitize(name)!, | ||
context: sanitize(context) as Context, | ||
startClocks: clocksNow(), | ||
@@ -232,5 +228,3 @@ type: ActionType.CUSTOM, | ||
handlingStack, | ||
context: (isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) | ||
? sanitize(context) | ||
: deepClone(context)) as Context, | ||
context: sanitize(context) as Context, | ||
startClocks: clocksNow(), | ||
@@ -242,6 +236,3 @@ }) | ||
addTiming: monitor((name: string, time?: number) => { | ||
addTimingStrategy( | ||
isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(name)! : name, | ||
time as RelativeTime | TimeStamp | undefined | ||
) | ||
addTimingStrategy(sanitize(name)!, time as RelativeTime | TimeStamp | undefined) | ||
}), | ||
@@ -281,6 +272,3 @@ | ||
addFeatureFlagEvaluation: monitor((key: string, value: any) => { | ||
addFeatureFlagEvaluationStrategy( | ||
isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(key)! : key, | ||
isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(value) : value | ||
) | ||
addFeatureFlagEvaluationStrategy(sanitize(key)!, sanitize(value)) | ||
}), | ||
@@ -287,0 +275,0 @@ getSessionReplayLink: monitor(() => getSessionReplayLinkStrategy()), |
@@ -36,2 +36,3 @@ import type { RelativeTime } from '@datadog/browser-core' | ||
afterEach(() => { | ||
featureFlagContexts.stop() | ||
resetExperimentalFeatures() | ||
@@ -38,0 +39,0 @@ setupBuilder.cleanup() |
@@ -26,2 +26,3 @@ import type { RelativeTime, ContextValue, Context } from '@datadog/browser-core' | ||
addFeatureFlagEvaluation: (key: string, value: ContextValue) => void | ||
stop: () => void | ||
} | ||
@@ -46,2 +47,3 @@ | ||
addFeatureFlagEvaluation: noop, | ||
stop: noop, | ||
} | ||
@@ -65,3 +67,3 @@ } | ||
// Especially useful if the user call addFeatureFlagEvaluation API synchronously multiple times in a row | ||
const { throttled: computeBytesCountThrottled } = throttle((context: Context) => { | ||
const { throttled: computeBytesCountThrottled, cancel: cancelPendingComputation } = throttle((context: Context) => { | ||
bytesCountCache = computeBytesCountImpl(jsonStringify(context)!) | ||
@@ -90,3 +92,4 @@ if (!alreadyWarned) { | ||
}, | ||
stop: cancelPendingComputation, | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
import { ExperimentalFeature, resetExperimentalFeatures, addExperimentalFeatures } from '@datadog/browser-core' | ||
import type { Context } from '@datadog/browser-core' | ||
@@ -161,3 +160,2 @@ import { limitModification } from './limitModification' | ||
it('should call sanitize on newly provided values', () => { | ||
addExperimentalFeatures([ExperimentalFeature.SANITIZE_INPUTS]) | ||
const object: Context = { bar: { baz: 42 } } | ||
@@ -171,4 +169,3 @@ | ||
expect(() => JSON.stringify(object)).not.toThrowError() | ||
resetExperimentalFeatures() | ||
}) | ||
}) |
@@ -1,2 +0,2 @@ | ||
import { ExperimentalFeature, isExperimentalFeatureEnabled, sanitize, deepClone, getType } from '@datadog/browser-core' | ||
import { sanitize, deepClone, getType } from '@datadog/browser-core' | ||
import type { Context } from '@datadog/browser-core' | ||
@@ -21,7 +21,3 @@ | ||
if (newType === originalType) { | ||
set( | ||
object, | ||
path, | ||
isExperimentalFeatureEnabled(ExperimentalFeature.SANITIZE_INPUTS) ? sanitize(newValue) : newValue | ||
) | ||
set(object, path, sanitize(newValue)) | ||
} else if (originalType === 'object' && (newType === 'undefined' || newType === 'null')) { | ||
@@ -28,0 +24,0 @@ set(object, path, {}) |
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
1460014
29437
+ Added@datadog/browser-core@4.41.0(transitive)
- Removed@datadog/browser-core@4.40.0(transitive)
Updated@datadog/browser-core@4.41.0