@datadog/browser-rum-core
Advanced tools
Comparing version 4.50.0 to 4.50.1
@@ -8,3 +8,4 @@ export declare function isTextNode(node: Node): node is Text; | ||
export declare function isNodeShadowRoot(node: Node): node is ShadowRoot; | ||
export declare function getChildNodes(node: Node): NodeListOf<ChildNode>; | ||
export declare function hasChildNodes(node: Node): boolean; | ||
export declare function forEachChildNodes(node: Node, callback: (child: Node) => void): void; | ||
/** | ||
@@ -11,0 +12,0 @@ * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode` |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getParentNode = exports.getChildNodes = exports.isNodeShadowRoot = exports.isNodeShadowHost = exports.isElementNode = exports.isCommentNode = exports.isTextNode = void 0; | ||
exports.getParentNode = exports.forEachChildNodes = exports.hasChildNodes = exports.isNodeShadowRoot = exports.isNodeShadowHost = exports.isElementNode = exports.isCommentNode = exports.isTextNode = void 0; | ||
function isTextNode(node) { | ||
@@ -25,6 +25,13 @@ return node.nodeType === Node.TEXT_NODE; | ||
exports.isNodeShadowRoot = isNodeShadowRoot; | ||
function getChildNodes(node) { | ||
return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes; | ||
function hasChildNodes(node) { | ||
return node.childNodes.length > 0 || isNodeShadowHost(node); | ||
} | ||
exports.getChildNodes = getChildNodes; | ||
exports.hasChildNodes = hasChildNodes; | ||
function forEachChildNodes(node, callback) { | ||
node.childNodes.forEach(callback); | ||
if (isNodeShadowHost(node)) { | ||
callback(node.shadowRoot); | ||
} | ||
} | ||
exports.forEachChildNodes = forEachChildNodes; | ||
/** | ||
@@ -31,0 +38,0 @@ * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode` |
@@ -77,5 +77,7 @@ import type { Duration, RelativeTime } from '@datadog/browser-core'; | ||
processingStart: RelativeTime; | ||
processingEnd: RelativeTime; | ||
duration: Duration; | ||
target?: Node; | ||
interactionId?: number; | ||
name: string; | ||
} | ||
@@ -85,5 +87,8 @@ export interface RumPerformanceEventTiming { | ||
startTime: RelativeTime; | ||
processingStart: RelativeTime; | ||
processingEnd: RelativeTime; | ||
duration: Duration; | ||
interactionId?: number; | ||
target?: Node; | ||
name: string; | ||
} | ||
@@ -90,0 +95,0 @@ export interface RumLayoutShiftTiming { |
@@ -153,4 +153,6 @@ "use strict"; | ||
processingStart: (0, browser_core_1.relativeNow)(), | ||
processingEnd: (0, browser_core_1.relativeNow)(), | ||
startTime: evt.timeStamp, | ||
duration: 0, // arbitrary value to avoid nullable duration and simplify INP logic | ||
duration: 0, | ||
name: '', | ||
}; | ||
@@ -157,0 +159,0 @@ if (evt.type === "pointerdown" /* DOM_EVENT.POINTER_DOWN */) { |
@@ -60,3 +60,3 @@ "use strict"; | ||
}, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "4.50.0" : undefined, | ||
browser_sdk_version: (0, browser_core_1.canUseEventBridge)() ? "4.50.1" : undefined, | ||
}, | ||
@@ -63,0 +63,0 @@ application: { |
@@ -21,3 +21,3 @@ "use strict"; | ||
}).stop; | ||
var _b = (0, trackInteractionToNextPaint_1.trackInteractionToNextPaint)(configuration, loadingType, lifeCycle), stopINPTracking = _b.stop, getInteractionToNextPaint = _b.getInteractionToNextPaint; | ||
var _b = (0, trackInteractionToNextPaint_1.trackInteractionToNextPaint)(configuration, viewStart, loadingType, lifeCycle), stopINPTracking = _b.stop, getInteractionToNextPaint = _b.getInteractionToNextPaint; | ||
return { | ||
@@ -24,0 +24,0 @@ stop: function () { |
@@ -1,2 +0,2 @@ | ||
import type { Duration } from '@datadog/browser-core'; | ||
import type { ClocksState, Duration } from '@datadog/browser-core'; | ||
import type { LifeCycle } from '../../lifeCycle'; | ||
@@ -15,3 +15,3 @@ import { ViewLoadingType } from '../../../rawRumEvent.types'; | ||
*/ | ||
export declare function trackInteractionToNextPaint(configuration: RumConfiguration, viewLoadingType: ViewLoadingType, lifeCycle: LifeCycle): { | ||
export declare function trackInteractionToNextPaint(configuration: RumConfiguration, viewStart: ClocksState, viewLoadingType: ViewLoadingType, lifeCycle: LifeCycle): { | ||
getInteractionToNextPaint: () => InteractionToNextPaint | undefined; | ||
@@ -18,0 +18,0 @@ stop: () => void; |
@@ -17,3 +17,3 @@ "use strict"; | ||
*/ | ||
function trackInteractionToNextPaint(configuration, viewLoadingType, lifeCycle) { | ||
function trackInteractionToNextPaint(configuration, viewStart, viewLoadingType, lifeCycle) { | ||
if (!isInteractionToNextPaintSupported() || | ||
@@ -30,3 +30,5 @@ !(0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.INTERACTION_TO_NEXT_PAINT)) { | ||
var interactionToNextPaintTargetSelector; | ||
var telemetryCollected = false; | ||
var stop = lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) { | ||
var _a; | ||
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | ||
@@ -43,2 +45,18 @@ var entry = entries_1[_i]; | ||
interactionToNextPaint = newInteraction.duration; | ||
if (interactionToNextPaint > 10 * browser_core_1.ONE_MINUTE && !telemetryCollected) { | ||
telemetryCollected = true; | ||
(0, browser_core_1.addTelemetryDebug)('INP outlier', { | ||
inp: interactionToNextPaint, | ||
interaction: { | ||
timeFromViewStart: (0, browser_core_1.elapsed)(viewStart.relative, newInteraction.startTime), | ||
duration: newInteraction.duration, | ||
startTime: newInteraction.startTime, | ||
processingStart: newInteraction.processingStart, | ||
processingEnd: newInteraction.processingEnd, | ||
interactionId: newInteraction.interactionId, | ||
name: newInteraction.name, | ||
targetNodeName: (_a = newInteraction.target) === null || _a === void 0 ? void 0 : _a.nodeName, | ||
}, | ||
}); | ||
} | ||
if ((0, browser_core_1.isExperimentalFeatureEnabled)(browser_core_1.ExperimentalFeature.WEB_VITALS_ATTRIBUTION) && | ||
@@ -45,0 +63,0 @@ newInteraction.target && |
@@ -8,3 +8,4 @@ export declare function isTextNode(node: Node): node is Text; | ||
export declare function isNodeShadowRoot(node: Node): node is ShadowRoot; | ||
export declare function getChildNodes(node: Node): NodeListOf<ChildNode>; | ||
export declare function hasChildNodes(node: Node): boolean; | ||
export declare function forEachChildNodes(node: Node, callback: (child: Node) => void): void; | ||
/** | ||
@@ -11,0 +12,0 @@ * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode` |
@@ -17,5 +17,11 @@ export function isTextNode(node) { | ||
} | ||
export function getChildNodes(node) { | ||
return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes; | ||
export function hasChildNodes(node) { | ||
return node.childNodes.length > 0 || isNodeShadowHost(node); | ||
} | ||
export function forEachChildNodes(node, callback) { | ||
node.childNodes.forEach(callback); | ||
if (isNodeShadowHost(node)) { | ||
callback(node.shadowRoot); | ||
} | ||
} | ||
/** | ||
@@ -22,0 +28,0 @@ * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode` |
@@ -77,5 +77,7 @@ import type { Duration, RelativeTime } from '@datadog/browser-core'; | ||
processingStart: RelativeTime; | ||
processingEnd: RelativeTime; | ||
duration: Duration; | ||
target?: Node; | ||
interactionId?: number; | ||
name: string; | ||
} | ||
@@ -85,5 +87,8 @@ export interface RumPerformanceEventTiming { | ||
startTime: RelativeTime; | ||
processingStart: RelativeTime; | ||
processingEnd: RelativeTime; | ||
duration: Duration; | ||
interactionId?: number; | ||
target?: Node; | ||
name: string; | ||
} | ||
@@ -90,0 +95,0 @@ export interface RumLayoutShiftTiming { |
@@ -147,4 +147,6 @@ import { dateNow, assign, addEventListeners, getRelativeTime, isNumber, monitor, setTimeout, relativeNow, runOnReadyState, addEventListener, objectHasValue, } from '@datadog/browser-core'; | ||
processingStart: relativeNow(), | ||
processingEnd: relativeNow(), | ||
startTime: evt.timeStamp, | ||
duration: 0, // arbitrary value to avoid nullable duration and simplify INP logic | ||
duration: 0, | ||
name: '', | ||
}; | ||
@@ -151,0 +153,0 @@ if (evt.type === "pointerdown" /* DOM_EVENT.POINTER_DOWN */) { |
@@ -57,3 +57,3 @@ import { combine, isEmptyObject, timeStampNow, currentDrift, display, createEventRateLimiter, canUseEventBridge, assign, round, } from '@datadog/browser-core'; | ||
}, | ||
browser_sdk_version: canUseEventBridge() ? "4.50.0" : undefined, | ||
browser_sdk_version: canUseEventBridge() ? "4.50.1" : undefined, | ||
}, | ||
@@ -60,0 +60,0 @@ application: { |
@@ -18,3 +18,3 @@ import { trackCumulativeLayoutShift } from './trackCumulativeLayoutShift'; | ||
}).stop; | ||
var _b = trackInteractionToNextPaint(configuration, loadingType, lifeCycle), stopINPTracking = _b.stop, getInteractionToNextPaint = _b.getInteractionToNextPaint; | ||
var _b = trackInteractionToNextPaint(configuration, viewStart, loadingType, lifeCycle), stopINPTracking = _b.stop, getInteractionToNextPaint = _b.getInteractionToNextPaint; | ||
return { | ||
@@ -21,0 +21,0 @@ stop: function () { |
@@ -1,2 +0,2 @@ | ||
import type { Duration } from '@datadog/browser-core'; | ||
import type { ClocksState, Duration } from '@datadog/browser-core'; | ||
import type { LifeCycle } from '../../lifeCycle'; | ||
@@ -15,3 +15,3 @@ import { ViewLoadingType } from '../../../rawRumEvent.types'; | ||
*/ | ||
export declare function trackInteractionToNextPaint(configuration: RumConfiguration, viewLoadingType: ViewLoadingType, lifeCycle: LifeCycle): { | ||
export declare function trackInteractionToNextPaint(configuration: RumConfiguration, viewStart: ClocksState, viewLoadingType: ViewLoadingType, lifeCycle: LifeCycle): { | ||
getInteractionToNextPaint: () => InteractionToNextPaint | undefined; | ||
@@ -18,0 +18,0 @@ stop: () => void; |
@@ -1,2 +0,2 @@ | ||
import { noop, isExperimentalFeatureEnabled, ExperimentalFeature } from '@datadog/browser-core'; | ||
import { noop, isExperimentalFeatureEnabled, ExperimentalFeature, ONE_MINUTE, addTelemetryDebug, elapsed, } from '@datadog/browser-core'; | ||
import { RumPerformanceEntryType, supportPerformanceTimingEvent } from '../../../browser/performanceCollection'; | ||
@@ -14,3 +14,3 @@ import { getSelectorFromElement } from '../../getSelectorFromElement'; | ||
*/ | ||
export function trackInteractionToNextPaint(configuration, viewLoadingType, lifeCycle) { | ||
export function trackInteractionToNextPaint(configuration, viewStart, viewLoadingType, lifeCycle) { | ||
if (!isInteractionToNextPaintSupported() || | ||
@@ -27,3 +27,5 @@ !isExperimentalFeatureEnabled(ExperimentalFeature.INTERACTION_TO_NEXT_PAINT)) { | ||
var interactionToNextPaintTargetSelector; | ||
var telemetryCollected = false; | ||
var stop = lifeCycle.subscribe(0 /* LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED */, function (entries) { | ||
var _a; | ||
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | ||
@@ -40,2 +42,18 @@ var entry = entries_1[_i]; | ||
interactionToNextPaint = newInteraction.duration; | ||
if (interactionToNextPaint > 10 * ONE_MINUTE && !telemetryCollected) { | ||
telemetryCollected = true; | ||
addTelemetryDebug('INP outlier', { | ||
inp: interactionToNextPaint, | ||
interaction: { | ||
timeFromViewStart: elapsed(viewStart.relative, newInteraction.startTime), | ||
duration: newInteraction.duration, | ||
startTime: newInteraction.startTime, | ||
processingStart: newInteraction.processingStart, | ||
processingEnd: newInteraction.processingEnd, | ||
interactionId: newInteraction.interactionId, | ||
name: newInteraction.name, | ||
targetNodeName: (_a = newInteraction.target) === null || _a === void 0 ? void 0 : _a.nodeName, | ||
}, | ||
}); | ||
} | ||
if (isExperimentalFeatureEnabled(ExperimentalFeature.WEB_VITALS_ATTRIBUTION) && | ||
@@ -42,0 +60,0 @@ newInteraction.target && |
{ | ||
"name": "@datadog/browser-rum-core", | ||
"version": "4.50.0", | ||
"version": "4.50.1", | ||
"license": "Apache-2.0", | ||
@@ -15,3 +15,3 @@ "main": "cjs/index.js", | ||
"dependencies": { | ||
"@datadog/browser-core": "4.50.0" | ||
"@datadog/browser-core": "4.50.1" | ||
}, | ||
@@ -32,3 +32,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "6bb23089915b99c9dab8edbf0131b5edc09eb4b5" | ||
"gitHead": "2f7a2b0b88ec8e9b5ffef9bdb7f8ace9b97ccafc" | ||
} |
@@ -22,6 +22,13 @@ export function isTextNode(node: Node): node is Text { | ||
export function getChildNodes(node: Node) { | ||
return isNodeShadowHost(node) ? node.shadowRoot.childNodes : node.childNodes | ||
export function hasChildNodes(node: Node) { | ||
return node.childNodes.length > 0 || isNodeShadowHost(node) | ||
} | ||
export function forEachChildNodes(node: Node, callback: (child: Node) => void) { | ||
node.childNodes.forEach(callback) | ||
if (isNodeShadowHost(node)) { | ||
callback(node.shadowRoot) | ||
} | ||
} | ||
/** | ||
@@ -28,0 +35,0 @@ * Return `host` in case if the current node is a shadow root otherwise will return the `parentNode` |
@@ -105,5 +105,7 @@ import type { Duration, RelativeTime, TimeStamp } from '@datadog/browser-core' | ||
processingStart: RelativeTime | ||
processingEnd: RelativeTime | ||
duration: Duration | ||
target?: Node | ||
interactionId?: number | ||
name: string | ||
} | ||
@@ -114,5 +116,8 @@ | ||
startTime: RelativeTime | ||
processingStart: RelativeTime | ||
processingEnd: RelativeTime | ||
duration: Duration | ||
interactionId?: number | ||
target?: Node | ||
name: string | ||
} | ||
@@ -301,4 +306,6 @@ | ||
processingStart: relativeNow(), | ||
processingEnd: relativeNow(), | ||
startTime: evt.timeStamp as RelativeTime, | ||
duration: 0 as Duration, // arbitrary value to avoid nullable duration and simplify INP logic | ||
name: '', | ||
} | ||
@@ -305,0 +312,0 @@ |
@@ -53,2 +53,3 @@ import type { ClocksState, Duration, Observable } from '@datadog/browser-core' | ||
configuration, | ||
viewStart, | ||
loadingType, | ||
@@ -55,0 +56,0 @@ lifeCycle |
@@ -1,3 +0,10 @@ | ||
import { noop, isExperimentalFeatureEnabled, ExperimentalFeature } from '@datadog/browser-core' | ||
import type { Duration } from '@datadog/browser-core' | ||
import { | ||
noop, | ||
isExperimentalFeatureEnabled, | ||
ExperimentalFeature, | ||
ONE_MINUTE, | ||
addTelemetryDebug, | ||
elapsed, | ||
} from '@datadog/browser-core' | ||
import type { ClocksState, Duration } from '@datadog/browser-core' | ||
import { RumPerformanceEntryType, supportPerformanceTimingEvent } from '../../../browser/performanceCollection' | ||
@@ -28,2 +35,3 @@ import type { RumFirstInputTiming, RumPerformanceEventTiming } from '../../../browser/performanceCollection' | ||
configuration: RumConfiguration, | ||
viewStart: ClocksState, | ||
viewLoadingType: ViewLoadingType, | ||
@@ -46,2 +54,3 @@ lifeCycle: LifeCycle | ||
let interactionToNextPaintTargetSelector: string | undefined | ||
let telemetryCollected = false | ||
@@ -62,2 +71,19 @@ const { unsubscribe: stop } = lifeCycle.subscribe(LifeCycleEventType.PERFORMANCE_ENTRIES_COLLECTED, (entries) => { | ||
interactionToNextPaint = newInteraction.duration | ||
if (interactionToNextPaint > 10 * ONE_MINUTE && !telemetryCollected) { | ||
telemetryCollected = true | ||
addTelemetryDebug('INP outlier', { | ||
inp: interactionToNextPaint, | ||
interaction: { | ||
timeFromViewStart: elapsed(viewStart.relative, newInteraction.startTime), | ||
duration: newInteraction.duration, | ||
startTime: newInteraction.startTime, | ||
processingStart: newInteraction.processingStart, | ||
processingEnd: newInteraction.processingEnd, | ||
interactionId: newInteraction.interactionId, | ||
name: newInteraction.name, | ||
targetNodeName: newInteraction.target?.nodeName, | ||
}, | ||
}) | ||
} | ||
if ( | ||
@@ -64,0 +90,0 @@ isExperimentalFeatureEnabled(ExperimentalFeature.WEB_VITALS_ATTRIBUTION) && |
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
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
1210236
22086
+ Added@datadog/browser-core@4.50.1(transitive)
- Removed@datadog/browser-core@4.50.0(transitive)
Updated@datadog/browser-core@4.50.1