@datadog/browser-rum-core
Advanced tools
Comparing version 5.5.0 to 5.5.1
@@ -72,2 +72,3 @@ import type { Duration, RelativeTime } from '@datadog/browser-core'; | ||
element?: Element; | ||
toJSON(): Omit<PerformanceEntry, 'toJSON'>; | ||
} | ||
@@ -74,0 +75,0 @@ export interface RumFirstInputTiming { |
@@ -57,3 +57,3 @@ "use strict"; | ||
}, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.5.0" : undefined, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "5.5.1" : undefined, | ||
}, | ||
@@ -60,0 +60,0 @@ application: { |
@@ -10,2 +10,4 @@ "use strict"; | ||
exports.LCP_MAXIMUM_DELAY = 10 * browser_core_1.ONE_MINUTE; | ||
var zeroLcpReported = false; | ||
var previousNonZeroLcp; | ||
/** | ||
@@ -37,2 +39,5 @@ * Track the largest contentful paint (LCP) occurring during the initial View. This can yield | ||
} | ||
if ((0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.ZERO_LCP_TELEMETRY)) { | ||
monitorZeroLcpEntry(lcpEntry); | ||
} | ||
callback({ | ||
@@ -52,2 +57,21 @@ value: lcpEntry.startTime, | ||
exports.trackLargestContentfulPaint = trackLargestContentfulPaint; | ||
function monitorZeroLcpEntry(lcpEntry) { | ||
if (!zeroLcpReported && lcpEntry.startTime !== 0) { | ||
previousNonZeroLcp = lcpEntry.toJSON(); | ||
} | ||
if (!zeroLcpReported && lcpEntry.startTime === 0) { | ||
zeroLcpReported = true; | ||
(0, browser_core_1.addTelemetryDebug)('LCP with startTime = 0', { | ||
debug: { | ||
entry: lcpEntry.toJSON(), | ||
previousNonZeroLcp: previousNonZeroLcp, | ||
navigationStart: performance.timing.navigationStart, | ||
timeOrigin: performance.timeOrigin, | ||
now: (0, browser_core_1.relativeNow)(), | ||
visibilityState: document.visibilityState, | ||
prerendering: document.prerendering, | ||
}, | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=trackLargestContentfulPaint.js.map |
@@ -72,2 +72,3 @@ import type { Duration, RelativeTime } from '@datadog/browser-core'; | ||
element?: Element; | ||
toJSON(): Omit<PerformanceEntry, 'toJSON'>; | ||
} | ||
@@ -74,0 +75,0 @@ export interface RumFirstInputTiming { |
@@ -54,3 +54,3 @@ import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, assign, round, } from '@datadog/browser-core'; | ||
}, | ||
browser_sdk_version: canUseEventBridge() ? "5.5.0" : undefined, | ||
browser_sdk_version: canUseEventBridge() ? "5.5.1" : undefined, | ||
}, | ||
@@ -57,0 +57,0 @@ application: { |
@@ -1,2 +0,2 @@ | ||
import { DOM_EVENT, ONE_MINUTE, addEventListeners, findLast } from '@datadog/browser-core'; | ||
import { DOM_EVENT, ExperimentalFeature, ONE_MINUTE, addEventListeners, addTelemetryDebug, findLast, isExperimentalFeatureEnabled, relativeNow, } from '@datadog/browser-core'; | ||
import { RumPerformanceEntryType } from '../../../browser/performanceCollection'; | ||
@@ -7,2 +7,4 @@ import { getSelectorFromElement } from '../../getSelectorFromElement'; | ||
export var LCP_MAXIMUM_DELAY = 10 * ONE_MINUTE; | ||
var zeroLcpReported = false; | ||
var previousNonZeroLcp; | ||
/** | ||
@@ -34,2 +36,5 @@ * Track the largest contentful paint (LCP) occurring during the initial View. This can yield | ||
} | ||
if (isExperimentalFeatureEnabled(ExperimentalFeature.ZERO_LCP_TELEMETRY)) { | ||
monitorZeroLcpEntry(lcpEntry); | ||
} | ||
callback({ | ||
@@ -48,2 +53,21 @@ value: lcpEntry.startTime, | ||
} | ||
function monitorZeroLcpEntry(lcpEntry) { | ||
if (!zeroLcpReported && lcpEntry.startTime !== 0) { | ||
previousNonZeroLcp = lcpEntry.toJSON(); | ||
} | ||
if (!zeroLcpReported && lcpEntry.startTime === 0) { | ||
zeroLcpReported = true; | ||
addTelemetryDebug('LCP with startTime = 0', { | ||
debug: { | ||
entry: lcpEntry.toJSON(), | ||
previousNonZeroLcp: previousNonZeroLcp, | ||
navigationStart: performance.timing.navigationStart, | ||
timeOrigin: performance.timeOrigin, | ||
now: relativeNow(), | ||
visibilityState: document.visibilityState, | ||
prerendering: document.prerendering, | ||
}, | ||
}); | ||
} | ||
} | ||
//# sourceMappingURL=trackLargestContentfulPaint.js.map |
{ | ||
"name": "@datadog/browser-rum-core", | ||
"version": "5.5.0", | ||
"version": "5.5.1", | ||
"license": "Apache-2.0", | ||
@@ -15,3 +15,3 @@ "main": "cjs/index.js", | ||
"dependencies": { | ||
"@datadog/browser-core": "5.5.0" | ||
"@datadog/browser-core": "5.5.1" | ||
}, | ||
@@ -32,3 +32,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "7b824d7ff3e7b535e4f6b4d77f16bf1ceb0c9242" | ||
"gitHead": "1c876be1b0f5ffd4b3a49b2f74c912598065755d" | ||
} |
@@ -99,2 +99,3 @@ import type { Duration, RelativeTime, TimeStamp } from '@datadog/browser-core' | ||
element?: Element | ||
toJSON(): Omit<PerformanceEntry, 'toJSON'> | ||
} | ||
@@ -101,0 +102,0 @@ |
import type { RelativeTime } from '@datadog/browser-core' | ||
import { DOM_EVENT, ONE_MINUTE, addEventListeners, findLast } from '@datadog/browser-core' | ||
import { | ||
DOM_EVENT, | ||
ExperimentalFeature, | ||
ONE_MINUTE, | ||
addEventListeners, | ||
addTelemetryDebug, | ||
findLast, | ||
isExperimentalFeatureEnabled, | ||
relativeNow, | ||
} from '@datadog/browser-core' | ||
import { LifeCycleEventType } from '../../lifeCycle' | ||
@@ -19,2 +28,6 @@ import type { LifeCycle } from '../../lifeCycle' | ||
} | ||
let zeroLcpReported = false | ||
let previousNonZeroLcp: Omit<PerformanceEntry, 'toJSON'> | undefined | ||
/** | ||
@@ -65,2 +78,6 @@ * Track the largest contentful paint (LCP) occurring during the initial View. This can yield | ||
if (isExperimentalFeatureEnabled(ExperimentalFeature.ZERO_LCP_TELEMETRY)) { | ||
monitorZeroLcpEntry(lcpEntry) | ||
} | ||
callback({ | ||
@@ -81,1 +98,23 @@ value: lcpEntry.startTime, | ||
} | ||
function monitorZeroLcpEntry(lcpEntry: RumLargestContentfulPaintTiming) { | ||
if (!zeroLcpReported && lcpEntry.startTime !== 0) { | ||
previousNonZeroLcp = lcpEntry.toJSON() | ||
} | ||
if (!zeroLcpReported && lcpEntry.startTime === 0) { | ||
zeroLcpReported = true | ||
addTelemetryDebug('LCP with startTime = 0', { | ||
debug: { | ||
entry: lcpEntry.toJSON(), | ||
previousNonZeroLcp, | ||
navigationStart: performance.timing.navigationStart, | ||
timeOrigin: performance.timeOrigin, | ||
now: relativeNow(), | ||
visibilityState: document.visibilityState, | ||
prerendering: (document as any).prerendering, | ||
}, | ||
}) | ||
} | ||
} |
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
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
1194960
21761
+ Added@datadog/browser-core@5.5.1(transitive)
- Removed@datadog/browser-core@5.5.0(transitive)
Updated@datadog/browser-core@5.5.1