Socket
Socket
Sign inDemoInstall

@datadog/browser-rum-core

Package Overview
Dependencies
Maintainers
1
Versions
177
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 3.1.1 to 3.1.2

2

cjs/boot/buildEnv.js

@@ -6,4 +6,4 @@ "use strict";

buildMode: 'release',
sdkVersion: '3.1.1',
sdkVersion: '3.1.2',
};
//# sourceMappingURL=buildEnv.js.map

@@ -36,23 +36,17 @@ "use strict";

var experimentalEntries = ['largest-contentful-paint', 'first-input', 'layout-shift'];
if (!configuration.isEnabled('buffered-perf')) {
var observer = new PerformanceObserver(handlePerformanceEntryList_1);
observer.observe({ entryTypes: mainEntries.concat(experimentalEntries) });
try {
// Experimental entries are not retrieved by performance.getEntries()
// use a single PerformanceObserver with buffered flag by type
// to get values that could happen before SDK init
experimentalEntries.forEach(function (type) {
var observer = new PerformanceObserver(handlePerformanceEntryList_1);
observer.observe({ type: type, buffered: true });
});
}
else {
try {
// Experimental entries are not retrieved by performance.getEntries()
// use a single PerformanceObserver with buffered flag by type
// to get values that could happen before SDK init
experimentalEntries.forEach(function (type) {
var observer = new PerformanceObserver(handlePerformanceEntryList_1);
observer.observe({ type: type, buffered: true });
});
}
catch (e) {
// Some old browser versions don't support PerformanceObserver without entryTypes option
mainEntries.push.apply(mainEntries, experimentalEntries);
}
var mainObserver = new PerformanceObserver(handlePerformanceEntryList_1);
mainObserver.observe({ entryTypes: mainEntries });
catch (e) {
// Some old browser versions don't support PerformanceObserver without entryTypes option
mainEntries.push.apply(mainEntries, experimentalEntries);
}
var mainObserver = new PerformanceObserver(handlePerformanceEntryList_1);
mainObserver.observe({ entryTypes: mainEntries });
if (supportPerformanceObject() && 'addEventListener' in performance) {

@@ -59,0 +53,0 @@ // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377

@@ -7,2 +7,5 @@ "use strict";

exports.MAX_NUMBER_OF_FOCUSED_TIME = 500;
// ignore duplicate focus & blur events if coming in the right after the previous one
// chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1237904
var MAX_TIME_TO_IGNORE_DUPLICATE = 10;
var foregroundPeriods = [];

@@ -39,11 +42,18 @@ function startForegroundContexts(configuration) {

var currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1];
var now = browser_core_1.relativeNow();
if (currentForegroundPeriod !== undefined && currentForegroundPeriod.end === undefined) {
browser_core_1.addMonitoringMessage('Previous foreground periods not closed. Continuing current one', {
inForegroundPeriodsCount: foregroundPeriods.length,
currentForegroundPeriodStart: currentForegroundPeriod.start,
});
if (now - currentForegroundPeriod.start > MAX_TIME_TO_IGNORE_DUPLICATE) {
browser_core_1.addMonitoringMessage('Previous foreground periods not closed. Continuing current one', {
foregroundPeriods: {
count: foregroundPeriods.length,
currentStart: currentForegroundPeriod.start,
now: now,
diff: now - currentForegroundPeriod.start,
},
});
}
return;
}
foregroundPeriods.push({
start: browser_core_1.relativeNow(),
start: now,
});

@@ -57,11 +67,19 @@ }

var currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1];
var now = browser_core_1.relativeNow();
if (currentForegroundPeriod.end !== undefined) {
browser_core_1.addMonitoringMessage('Current foreground period already closed', {
inForegroundPeriodsCount: foregroundPeriods.length,
currentForegroundPeriodStart: currentForegroundPeriod.start,
currentForegroundPeriodEnd: currentForegroundPeriod.end,
});
if (now - currentForegroundPeriod.end > MAX_TIME_TO_IGNORE_DUPLICATE) {
browser_core_1.addMonitoringMessage('Current foreground period already closed', {
foregroundPeriods: {
count: foregroundPeriods.length,
currentStart: currentForegroundPeriod.start,
currentEnd: currentForegroundPeriod.end,
now: now,
diff: now - currentForegroundPeriod.end,
},
now: browser_core_1.relativeNow(),
});
}
return;
}
currentForegroundPeriod.end = browser_core_1.relativeNow();
currentForegroundPeriod.end = now;
}

@@ -68,0 +86,0 @@ function trackFocus(onFocusChange) {

export var buildEnv = {
buildMode: 'release',
sdkVersion: '3.1.1',
sdkVersion: '3.1.2',
};
//# sourceMappingURL=buildEnv.js.map

@@ -31,23 +31,17 @@ import { __assign } from "tslib";

var experimentalEntries = ['largest-contentful-paint', 'first-input', 'layout-shift'];
if (!configuration.isEnabled('buffered-perf')) {
var observer = new PerformanceObserver(handlePerformanceEntryList_1);
observer.observe({ entryTypes: mainEntries.concat(experimentalEntries) });
try {
// Experimental entries are not retrieved by performance.getEntries()
// use a single PerformanceObserver with buffered flag by type
// to get values that could happen before SDK init
experimentalEntries.forEach(function (type) {
var observer = new PerformanceObserver(handlePerformanceEntryList_1);
observer.observe({ type: type, buffered: true });
});
}
else {
try {
// Experimental entries are not retrieved by performance.getEntries()
// use a single PerformanceObserver with buffered flag by type
// to get values that could happen before SDK init
experimentalEntries.forEach(function (type) {
var observer = new PerformanceObserver(handlePerformanceEntryList_1);
observer.observe({ type: type, buffered: true });
});
}
catch (e) {
// Some old browser versions don't support PerformanceObserver without entryTypes option
mainEntries.push.apply(mainEntries, experimentalEntries);
}
var mainObserver = new PerformanceObserver(handlePerformanceEntryList_1);
mainObserver.observe({ entryTypes: mainEntries });
catch (e) {
// Some old browser versions don't support PerformanceObserver without entryTypes option
mainEntries.push.apply(mainEntries, experimentalEntries);
}
var mainObserver = new PerformanceObserver(handlePerformanceEntryList_1);
mainObserver.observe({ entryTypes: mainEntries });
if (supportPerformanceObject() && 'addEventListener' in performance) {

@@ -54,0 +48,0 @@ // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377

import { noop, addEventListener, elapsed, relativeNow, addMonitoringMessage, toServerDuration, } from '@datadog/browser-core';
// Arbitrary value to cap number of element (mostly for backend)
export var MAX_NUMBER_OF_FOCUSED_TIME = 500;
// ignore duplicate focus & blur events if coming in the right after the previous one
// chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1237904
var MAX_TIME_TO_IGNORE_DUPLICATE = 10;
var foregroundPeriods = [];

@@ -34,11 +37,18 @@ export function startForegroundContexts(configuration) {

var currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1];
var now = relativeNow();
if (currentForegroundPeriod !== undefined && currentForegroundPeriod.end === undefined) {
addMonitoringMessage('Previous foreground periods not closed. Continuing current one', {
inForegroundPeriodsCount: foregroundPeriods.length,
currentForegroundPeriodStart: currentForegroundPeriod.start,
});
if (now - currentForegroundPeriod.start > MAX_TIME_TO_IGNORE_DUPLICATE) {
addMonitoringMessage('Previous foreground periods not closed. Continuing current one', {
foregroundPeriods: {
count: foregroundPeriods.length,
currentStart: currentForegroundPeriod.start,
now: now,
diff: now - currentForegroundPeriod.start,
},
});
}
return;
}
foregroundPeriods.push({
start: relativeNow(),
start: now,
});

@@ -52,11 +62,19 @@ }

var currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1];
var now = relativeNow();
if (currentForegroundPeriod.end !== undefined) {
addMonitoringMessage('Current foreground period already closed', {
inForegroundPeriodsCount: foregroundPeriods.length,
currentForegroundPeriodStart: currentForegroundPeriod.start,
currentForegroundPeriodEnd: currentForegroundPeriod.end,
});
if (now - currentForegroundPeriod.end > MAX_TIME_TO_IGNORE_DUPLICATE) {
addMonitoringMessage('Current foreground period already closed', {
foregroundPeriods: {
count: foregroundPeriods.length,
currentStart: currentForegroundPeriod.start,
currentEnd: currentForegroundPeriod.end,
now: now,
diff: now - currentForegroundPeriod.end,
},
now: relativeNow(),
});
}
return;
}
currentForegroundPeriod.end = relativeNow();
currentForegroundPeriod.end = now;
}

@@ -63,0 +81,0 @@ function trackFocus(onFocusChange) {

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

@@ -15,3 +15,3 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "3.1.1",
"@datadog/browser-core": "3.1.2",
"tslib": "^1.10.0"

@@ -27,3 +27,3 @@ },

},
"gitHead": "a506da7e404ecbc7c03c7b926ac824ce815231d9"
"gitHead": "1640101944e2a7dd19e3cc7afb68e8886f4d6cdd"
}

@@ -122,23 +122,18 @@ import {

if (!configuration.isEnabled('buffered-perf')) {
const observer = new PerformanceObserver(handlePerformanceEntryList)
observer.observe({ entryTypes: mainEntries.concat(experimentalEntries) })
} else {
try {
// Experimental entries are not retrieved by performance.getEntries()
// use a single PerformanceObserver with buffered flag by type
// to get values that could happen before SDK init
experimentalEntries.forEach((type) => {
const observer = new PerformanceObserver(handlePerformanceEntryList)
observer.observe({ type, buffered: true })
})
} catch (e) {
// Some old browser versions don't support PerformanceObserver without entryTypes option
mainEntries.push(...experimentalEntries)
}
const mainObserver = new PerformanceObserver(handlePerformanceEntryList)
mainObserver.observe({ entryTypes: mainEntries })
try {
// Experimental entries are not retrieved by performance.getEntries()
// use a single PerformanceObserver with buffered flag by type
// to get values that could happen before SDK init
experimentalEntries.forEach((type) => {
const observer = new PerformanceObserver(handlePerformanceEntryList)
observer.observe({ type, buffered: true })
})
} catch (e) {
// Some old browser versions don't support PerformanceObserver without entryTypes option
mainEntries.push(...experimentalEntries)
}
const mainObserver = new PerformanceObserver(handlePerformanceEntryList)
mainObserver.observe({ entryTypes: mainEntries })
if (supportPerformanceObject() && 'addEventListener' in performance) {

@@ -145,0 +140,0 @@ // https://bugzilla.mozilla.org/show_bug.cgi?id=1559377

@@ -17,2 +17,5 @@ import {

export const MAX_NUMBER_OF_FOCUSED_TIME = 500
// ignore duplicate focus & blur events if coming in the right after the previous one
// chrome bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1237904
const MAX_TIME_TO_IGNORE_DUPLICATE = 10 as RelativeTime

@@ -40,2 +43,3 @@ export interface ForegroundContexts {

}
if (document.hasFocus()) {

@@ -64,11 +68,18 @@ addNewForegroundPeriod()

const currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1]
const now = relativeNow()
if (currentForegroundPeriod !== undefined && currentForegroundPeriod.end === undefined) {
addMonitoringMessage('Previous foreground periods not closed. Continuing current one', {
inForegroundPeriodsCount: foregroundPeriods.length,
currentForegroundPeriodStart: currentForegroundPeriod.start,
})
if (now - currentForegroundPeriod.start > MAX_TIME_TO_IGNORE_DUPLICATE) {
addMonitoringMessage('Previous foreground periods not closed. Continuing current one', {
foregroundPeriods: {
count: foregroundPeriods.length,
currentStart: currentForegroundPeriod.start,
now,
diff: now - currentForegroundPeriod.start,
},
})
}
return
}
foregroundPeriods.push({
start: relativeNow(),
start: now,
})

@@ -83,11 +94,19 @@ }

const currentForegroundPeriod = foregroundPeriods[foregroundPeriods.length - 1]
const now = relativeNow()
if (currentForegroundPeriod.end !== undefined) {
addMonitoringMessage('Current foreground period already closed', {
inForegroundPeriodsCount: foregroundPeriods.length,
currentForegroundPeriodStart: currentForegroundPeriod.start,
currentForegroundPeriodEnd: currentForegroundPeriod.end,
})
if (now - currentForegroundPeriod.end > MAX_TIME_TO_IGNORE_DUPLICATE) {
addMonitoringMessage('Current foreground period already closed', {
foregroundPeriods: {
count: foregroundPeriods.length,
currentStart: currentForegroundPeriod.start,
currentEnd: currentForegroundPeriod.end,
now,
diff: now - currentForegroundPeriod.end,
},
now: relativeNow(),
})
}
return
}
currentForegroundPeriod.end = relativeNow()
currentForegroundPeriod.end = now
}

@@ -94,0 +113,0 @@

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