@datadog/browser-rum-core
Advanced tools
Comparing version 5.30.0 to 5.30.1
@@ -65,3 +65,3 @@ "use strict"; | ||
}, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.30.0" : undefined, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.30.1" : undefined, | ||
}, | ||
@@ -68,0 +68,0 @@ application: { |
@@ -5,4 +5,4 @@ import type { RumConfiguration } from '../configuration'; | ||
import { retrieveInitialDocumentResourceTiming } from './retrieveInitialDocumentResourceTiming'; | ||
export declare function startResourceCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, pageStateHistory: PageStateHistory, retrieveInitialDocumentResourceTimingImpl?: typeof retrieveInitialDocumentResourceTiming): { | ||
export declare function startResourceCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, pageStateHistory: PageStateHistory, taskQueue?: import("@datadog/browser-core").TaskQueue, retrieveInitialDocumentResourceTimingImpl?: typeof retrieveInitialDocumentResourceTiming): { | ||
stop: () => void; | ||
}; |
@@ -10,9 +10,7 @@ "use strict"; | ||
var retrieveInitialDocumentResourceTiming_1 = require("./retrieveInitialDocumentResourceTiming"); | ||
function startResourceCollection(lifeCycle, configuration, pageStateHistory, retrieveInitialDocumentResourceTimingImpl) { | ||
function startResourceCollection(lifeCycle, configuration, pageStateHistory, taskQueue, retrieveInitialDocumentResourceTimingImpl) { | ||
if (taskQueue === void 0) { taskQueue = (0, browser_core_1.createTaskQueue)(); } | ||
if (retrieveInitialDocumentResourceTimingImpl === void 0) { retrieveInitialDocumentResourceTimingImpl = retrieveInitialDocumentResourceTiming_1.retrieveInitialDocumentResourceTiming; } | ||
lifeCycle.subscribe(7 /* LifeCycleEventType.REQUEST_COMPLETED */, function (request) { | ||
var rawEvent = processRequest(request, configuration, pageStateHistory); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
handleResource(function () { return processRequest(request, configuration, pageStateHistory); }); | ||
}); | ||
@@ -23,18 +21,23 @@ var performanceResourceSubscription = (0, performanceObservable_1.createPerformanceObservable)(configuration, { | ||
}).subscribe(function (entries) { | ||
var _loop_1 = function (entry) { | ||
if (!(0, resourceUtils_1.isResourceEntryRequestType)(entry)) { | ||
handleResource(function () { return processResourceEntry(entry, configuration); }); | ||
} | ||
}; | ||
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | ||
var entry = entries_1[_i]; | ||
if (!(0, resourceUtils_1.isResourceEntryRequestType)(entry)) { | ||
var rawEvent = processResourceEntry(entry, configuration); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
} | ||
_loop_1(entry); | ||
} | ||
}); | ||
retrieveInitialDocumentResourceTimingImpl(configuration, function (timing) { | ||
var rawEvent = processResourceEntry(timing, configuration); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
handleResource(function () { return processResourceEntry(timing, configuration); }); | ||
}); | ||
function handleResource(computeRawEvent) { | ||
taskQueue.push(function () { | ||
var rawEvent = computeRawEvent(); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
}); | ||
} | ||
return { | ||
@@ -41,0 +44,0 @@ stop: function () { |
@@ -62,3 +62,3 @@ import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, assign, round, isExperimentalFeatureEnabled, ExperimentalFeature, getConnectivity, } from '@datadog/browser-core'; | ||
}, | ||
browser_sdk_version: canUseEventBridge() ? "5.30.0" : undefined, | ||
browser_sdk_version: canUseEventBridge() ? "5.30.1" : undefined, | ||
}, | ||
@@ -65,0 +65,0 @@ application: { |
@@ -5,4 +5,4 @@ import type { RumConfiguration } from '../configuration'; | ||
import { retrieveInitialDocumentResourceTiming } from './retrieveInitialDocumentResourceTiming'; | ||
export declare function startResourceCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, pageStateHistory: PageStateHistory, retrieveInitialDocumentResourceTimingImpl?: typeof retrieveInitialDocumentResourceTiming): { | ||
export declare function startResourceCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, pageStateHistory: PageStateHistory, taskQueue?: import("@datadog/browser-core").TaskQueue, retrieveInitialDocumentResourceTimingImpl?: typeof retrieveInitialDocumentResourceTiming): { | ||
stop: () => void; | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { combine, generateUUID, toServerDuration, relativeToClocks, assign, isNumber, } from '@datadog/browser-core'; | ||
import { combine, generateUUID, toServerDuration, relativeToClocks, assign, isNumber, createTaskQueue, } from '@datadog/browser-core'; | ||
import { RumPerformanceEntryType, createPerformanceObservable, } from '../../browser/performanceObservable'; | ||
@@ -7,9 +7,7 @@ import { createTraceIdentifier } from '../tracing/tracer'; | ||
import { retrieveInitialDocumentResourceTiming } from './retrieveInitialDocumentResourceTiming'; | ||
export function startResourceCollection(lifeCycle, configuration, pageStateHistory, retrieveInitialDocumentResourceTimingImpl) { | ||
export function startResourceCollection(lifeCycle, configuration, pageStateHistory, taskQueue, retrieveInitialDocumentResourceTimingImpl) { | ||
if (taskQueue === void 0) { taskQueue = createTaskQueue(); } | ||
if (retrieveInitialDocumentResourceTimingImpl === void 0) { retrieveInitialDocumentResourceTimingImpl = retrieveInitialDocumentResourceTiming; } | ||
lifeCycle.subscribe(7 /* LifeCycleEventType.REQUEST_COMPLETED */, function (request) { | ||
var rawEvent = processRequest(request, configuration, pageStateHistory); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
handleResource(function () { return processRequest(request, configuration, pageStateHistory); }); | ||
}); | ||
@@ -20,18 +18,23 @@ var performanceResourceSubscription = createPerformanceObservable(configuration, { | ||
}).subscribe(function (entries) { | ||
var _loop_1 = function (entry) { | ||
if (!isResourceEntryRequestType(entry)) { | ||
handleResource(function () { return processResourceEntry(entry, configuration); }); | ||
} | ||
}; | ||
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | ||
var entry = entries_1[_i]; | ||
if (!isResourceEntryRequestType(entry)) { | ||
var rawEvent = processResourceEntry(entry, configuration); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
} | ||
_loop_1(entry); | ||
} | ||
}); | ||
retrieveInitialDocumentResourceTimingImpl(configuration, function (timing) { | ||
var rawEvent = processResourceEntry(timing, configuration); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
handleResource(function () { return processResourceEntry(timing, configuration); }); | ||
}); | ||
function handleResource(computeRawEvent) { | ||
taskQueue.push(function () { | ||
var rawEvent = computeRawEvent(); | ||
if (rawEvent) { | ||
lifeCycle.notify(11 /* LifeCycleEventType.RAW_RUM_EVENT_COLLECTED */, rawEvent); | ||
} | ||
}); | ||
} | ||
return { | ||
@@ -38,0 +41,0 @@ stop: function () { |
{ | ||
"name": "@datadog/browser-rum-core", | ||
"version": "5.30.0", | ||
"version": "5.30.1", | ||
"license": "Apache-2.0", | ||
@@ -15,3 +15,3 @@ "main": "cjs/index.js", | ||
"dependencies": { | ||
"@datadog/browser-core": "5.30.0" | ||
"@datadog/browser-core": "5.30.1" | ||
}, | ||
@@ -32,3 +32,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "f9195c3d7cd5484895ae37f5b8c8765f79d0a85f" | ||
"gitHead": "639b5a7c3830242460e43b97497f2aa41cc9246f" | ||
} |
@@ -11,2 +11,3 @@ import type { ClocksState, Duration } from '@datadog/browser-core' | ||
isNumber, | ||
createTaskQueue, | ||
} from '@datadog/browser-core' | ||
@@ -45,9 +46,7 @@ import type { RumConfiguration } from '../configuration' | ||
pageStateHistory: PageStateHistory, | ||
taskQueue = createTaskQueue(), | ||
retrieveInitialDocumentResourceTimingImpl = retrieveInitialDocumentResourceTiming | ||
) { | ||
lifeCycle.subscribe(LifeCycleEventType.REQUEST_COMPLETED, (request: RequestCompleteEvent) => { | ||
const rawEvent = processRequest(request, configuration, pageStateHistory) | ||
if (rawEvent) { | ||
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, rawEvent) | ||
} | ||
handleResource(() => processRequest(request, configuration, pageStateHistory)) | ||
}) | ||
@@ -61,6 +60,3 @@ | ||
if (!isResourceEntryRequestType(entry)) { | ||
const rawEvent = processResourceEntry(entry, configuration) | ||
if (rawEvent) { | ||
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, rawEvent) | ||
} | ||
handleResource(() => processResourceEntry(entry, configuration)) | ||
} | ||
@@ -71,8 +67,14 @@ } | ||
retrieveInitialDocumentResourceTimingImpl(configuration, (timing) => { | ||
const rawEvent = processResourceEntry(timing, configuration) | ||
if (rawEvent) { | ||
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, rawEvent) | ||
} | ||
handleResource(() => processResourceEntry(timing, configuration)) | ||
}) | ||
function handleResource(computeRawEvent: () => RawRumEventCollectedData<RawRumResourceEvent> | undefined) { | ||
taskQueue.push(() => { | ||
const rawEvent = computeRawEvent() | ||
if (rawEvent) { | ||
lifeCycle.notify(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, rawEvent) | ||
} | ||
}) | ||
} | ||
return { | ||
@@ -79,0 +81,0 @@ stop: () => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1541701
28218
+ Added@datadog/browser-core@5.30.1(transitive)
- Removed@datadog/browser-core@5.30.0(transitive)
Updated@datadog/browser-core@5.30.1