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 4.35.0 to 4.36.0

4

cjs/boot/rumPublicApi.d.ts

@@ -54,2 +54,6 @@ import type { Context, InitConfiguration, User } from '@datadog/browser-core';

stopSessionReplayRecording: () => void;
/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/
addFeatureFlagEvaluation: (key: string, value: any) => void;
} & {

@@ -56,0 +60,0 @@ onReady(callback: () => void): void;

12

cjs/boot/rumPublicApi.js

@@ -57,8 +57,2 @@ "use strict";

}
if ((0, browser_core_1.isExperimentalFeatureEnabled)('feature_flags')) {
;
rumPublicApi.addFeatureFlagEvaluation = (0, browser_core_1.monitor)(function (key, value) {
addFeatureFlagEvaluationStrategy(key, value);
});
}
if (!configuration.trackViewsManually) {

@@ -147,2 +141,8 @@ doStartRum(initConfiguration, configuration);

stopSessionReplayRecording: (0, browser_core_1.monitor)(recorderApi.stop),
/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/
addFeatureFlagEvaluation: (0, browser_core_1.monitor)(function (key, value) {
addFeatureFlagEvaluationStrategy(key, value);
}),
});

@@ -149,0 +149,0 @@ return rumPublicApi;

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

},
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "4.35.0" : undefined,
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "4.36.0" : undefined,
},

@@ -51,0 +51,0 @@ application: {

@@ -39,3 +39,3 @@ import type { Duration, XhrCompleteContext, XhrStartContext, ClocksState, FetchStartContext, FetchResolveContext } from '@datadog/browser-core';

response?: Response;
input?: RequestInfo;
input?: unknown;
init?: RequestInit;

@@ -42,0 +42,0 @@ error?: Error;

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

startClocks: startClocks,
nonErrorPrefix: 'Provided',
nonErrorPrefix: browser_core_1.PROVIDED_ERROR_MESSAGE_PREFIX,
source: browser_core_1.ErrorSource.CUSTOM,

@@ -36,0 +36,0 @@ handling: "handled" /* HANDLED */,

@@ -54,2 +54,6 @@ import type { Context, InitConfiguration, User } from '@datadog/browser-core';

stopSessionReplayRecording: () => void;
/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/
addFeatureFlagEvaluation: (key: string, value: any) => void;
} & {

@@ -56,0 +60,0 @@ onReady(callback: () => void): void;

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

import { isExperimentalFeatureEnabled, willSyntheticsInjectRum, assign, BoundedBuffer, buildCookieOptions, createContextManager, deepClone, makePublicApi, monitor, clocksNow, timeStampNow, display, callMonitored, createHandlingStack, canUseEventBridge, areCookiesAuthorized, checkUser, sanitizeUser, } from '@datadog/browser-core';
import { willSyntheticsInjectRum, assign, BoundedBuffer, buildCookieOptions, createContextManager, deepClone, makePublicApi, monitor, clocksNow, timeStampNow, display, callMonitored, createHandlingStack, canUseEventBridge, areCookiesAuthorized, checkUser, sanitizeUser, } from '@datadog/browser-core';
import { validateAndBuildRumConfiguration } from '../domain/configuration';

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

}
if (isExperimentalFeatureEnabled('feature_flags')) {
;
rumPublicApi.addFeatureFlagEvaluation = monitor(function (key, value) {
addFeatureFlagEvaluationStrategy(key, value);
});
}
if (!configuration.trackViewsManually) {

@@ -144,2 +138,8 @@ doStartRum(initConfiguration, configuration);

stopSessionReplayRecording: monitor(recorderApi.stop),
/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/
addFeatureFlagEvaluation: monitor(function (key, value) {
addFeatureFlagEvaluationStrategy(key, value);
}),
});

@@ -146,0 +146,0 @@ return rumPublicApi;

@@ -45,3 +45,3 @@ import { combine, isEmptyObject, limitModification, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, } from '@datadog/browser-core';

},
browser_sdk_version: canUseEventBridge() ? "4.35.0" : undefined,
browser_sdk_version: canUseEventBridge() ? "4.36.0" : undefined,
},

@@ -48,0 +48,0 @@ application: {

@@ -39,3 +39,3 @@ import type { Duration, XhrCompleteContext, XhrStartContext, ClocksState, FetchStartContext, FetchResolveContext } from '@datadog/browser-core';

response?: Response;
input?: RequestInfo;
input?: unknown;
init?: RequestInit;

@@ -42,0 +42,0 @@ error?: Error;

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

import { isEmptyObject, assign, ErrorSource, generateUUID, computeRawError, computeStackTrace, Observable, trackRuntimeError, } from '@datadog/browser-core';
import { PROVIDED_ERROR_MESSAGE_PREFIX, isEmptyObject, assign, ErrorSource, generateUUID, computeRawError, computeStackTrace, Observable, trackRuntimeError, } from '@datadog/browser-core';
import { trackConsoleError } from './trackConsoleError';

@@ -29,3 +29,3 @@ import { trackReportError } from './trackReportError';

startClocks: startClocks,
nonErrorPrefix: 'Provided',
nonErrorPrefix: PROVIDED_ERROR_MESSAGE_PREFIX,
source: ErrorSource.CUSTOM,

@@ -32,0 +32,0 @@ handling: "handled" /* HANDLED */,

{
"name": "@datadog/browser-rum-core",
"version": "4.35.0",
"version": "4.36.0",
"license": "Apache-2.0",

@@ -12,6 +12,6 @@ "main": "cjs/index.js",

"build:esm": "rm -rf esm && tsc -p tsconfig.esm.json && yarn replace-build-env esm",
"replace-build-env": "node ../../scripts/replace-build-env.js"
"replace-build-env": "node ../../scripts/build/replace-build-env.js"
},
"dependencies": {
"@datadog/browser-core": "4.35.0"
"@datadog/browser-core": "4.36.0"
},

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

},
"gitHead": "c71f60a74755ba55b3d64cf789aa472f2867afef"
"gitHead": "bcd2446e1d5f38c915f5fb581421bfd3fdd8dab6"
}
import type { RelativeTime, TimeStamp, Context } from '@datadog/browser-core'
import {
updateExperimentalFeatures,
resetExperimentalFeatures,
ONE_SECOND,
getTimeStamp,
display,
DefaultPrivacyLevel,
} from '@datadog/browser-core'
import { ONE_SECOND, getTimeStamp, display, DefaultPrivacyLevel } from '@datadog/browser-core'
import { cleanupSyntheticsWorkerValues, mockSyntheticsWorkerValues } from '../../../core/test/syntheticsWorkerValues'

@@ -652,13 +645,6 @@ import { initEventBridgeStub, deleteEventBridgeStub } from '../../../core/test/specHelper'

afterEach(() => {
resetExperimentalFeatures()
})
it('should add feature flag evaluation when ff feature_flags enable', () => {
updateExperimentalFeatures(['feature_flags'])
it('should add feature flag evaluation when ff feature_flags enabled', () => {
rumPublicApi.init(DEFAULT_INIT_CONFIGURATION)
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
;(rumPublicApi as any).addFeatureFlagEvaluation('feature', 'foo')
rumPublicApi.addFeatureFlagEvaluation('feature', 'foo')

@@ -668,17 +654,2 @@ expect(addFeatureFlagEvaluationSpy.calls.argsFor(0)).toEqual(['feature', 'foo'])

})
it('API should not be available when ff feature_flags disabled', () => {
rumPublicApi.init(DEFAULT_INIT_CONFIGURATION)
expect(Object.keys(rumPublicApi)).not.toContain('addFeatureFlagEvaluation')
expect(displaySpy).not.toHaveBeenCalled()
})
it('API should not be available before init when ff feature_flags enabled', () => {
updateExperimentalFeatures(['feature_flags'])
expect(Object.keys(rumPublicApi)).not.toContain('addFeatureFlagEvaluation')
expect(displaySpy).not.toHaveBeenCalled()
})
})

@@ -685,0 +656,0 @@

import type { Context, InitConfiguration, TimeStamp, RelativeTime, User } from '@datadog/browser-core'
import {
isExperimentalFeatureEnabled,
willSyntheticsInjectRum,

@@ -119,8 +118,2 @@ assign,

if (isExperimentalFeatureEnabled('feature_flags')) {
;(rumPublicApi as any).addFeatureFlagEvaluation = monitor((key: string, value: any) => {
addFeatureFlagEvaluationStrategy(key, value)
})
}
if (!configuration.trackViewsManually) {

@@ -256,2 +249,9 @@ doStartRum(initConfiguration, configuration)

stopSessionReplayRecording: monitor(recorderApi.stop),
/**
* This feature is currently in beta. For more information see the full [feature flag tracking guide](https://docs.datadoghq.com/real_user_monitoring/feature_flag_tracking/).
*/
addFeatureFlagEvaluation: monitor((key: string, value: any) => {
addFeatureFlagEvaluationStrategy(key, value)
}),
})

@@ -258,0 +258,0 @@

@@ -55,3 +55,3 @@ import type {

response?: Response
input?: RequestInfo
input?: unknown
init?: RequestInit

@@ -58,0 +58,0 @@ error?: Error

import type { Context, RawError, ClocksState } from '@datadog/browser-core'
import {
PROVIDED_ERROR_MESSAGE_PREFIX,
isEmptyObject,

@@ -75,3 +76,3 @@ assign,

startClocks,
nonErrorPrefix: 'Provided',
nonErrorPrefix: PROVIDED_ERROR_MESSAGE_PREFIX,
source: ErrorSource.CUSTOM,

@@ -78,0 +79,0 @@ handling: ErrorHandling.HANDLED,

@@ -10,2 +10,3 @@ import type { Duration, RelativeTime, ServerDuration, TimeStamp } from '@datadog/browser-core'

} from '@datadog/browser-core'
import type { RumFetchResourceEventDomainContext } from '../../../domainContext.types'
import { createResourceEntry } from '../../../../test/fixtures'

@@ -233,3 +234,23 @@ import type { TestSetupBuilder } from '../../../../test/specHelper'

})
;[null, undefined, 42, {}].forEach((input: any) => {
it(`should support ${
typeof input === 'object' ? JSON.stringify(input) : String(input)
} as fetch input parameter`, () => {
if (isIE()) {
pending('No IE support')
}
const { lifeCycle, rawRumEvents } = setupBuilder.build()
lifeCycle.notify(
LifeCycleEventType.REQUEST_COMPLETED,
createCompletedRequest({
type: RequestType.FETCH,
input,
})
)
expect(rawRumEvents.length).toBe(1)
expect((rawRumEvents[0].domainContext as RumFetchResourceEventDomainContext).requestInput).toBe(input)
})
})
it('should include the error in failed fetch requests', () => {

@@ -236,0 +257,0 @@ const { lifeCycle, rawRumEvents } = setupBuilder.build()

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