@newrelic/browser-agent 1.310.0-rc.0 → 1.310.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/vitals/largest-contentful-paint.js +14 -17
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/vitals/largest-contentful-paint.js +14 -17
- package/package.json +1 -1
- package/src/common/vitals/largest-contentful-paint.js +13 -14
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.310.0-rc.
|
|
20
|
+
const VERSION = exports.VERSION = "1.310.0-rc.2";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.310.0-rc.
|
|
20
|
+
const VERSION = exports.VERSION = "1.310.0-rc.2";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -10,7 +10,7 @@ var _constants = require("./constants");
|
|
|
10
10
|
var _runtime = require("../constants/runtime");
|
|
11
11
|
var _cleanUrl = require("../url/clean-url");
|
|
12
12
|
/**
|
|
13
|
-
* Copyright 2020-
|
|
13
|
+
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
14
14
|
* SPDX-License-Identifier: Apache-2.0
|
|
15
15
|
*/
|
|
16
16
|
|
|
@@ -22,26 +22,23 @@ if (_runtime.isBrowserScope) {
|
|
|
22
22
|
}) => {
|
|
23
23
|
/* Largest Contentful Paint - As of WV v3, it still imperfectly tries to detect document vis state asap and isn't supposed to report if page starts hidden. */
|
|
24
24
|
if (_runtime.initiallyHidden || largestContentfulPaint.isValid) return;
|
|
25
|
-
let attrs
|
|
25
|
+
let attrs = {
|
|
26
|
+
timeToFirstByte: attribution.timeToFirstByte,
|
|
27
|
+
resourceLoadDelay: attribution.resourceLoadDelay,
|
|
28
|
+
resourceLoadDuration: attribution.resourceLoadDuration,
|
|
29
|
+
resourceLoadTime: attribution.resourceLoadDuration,
|
|
30
|
+
// kept for NR backwards compatibility, deprecated in v3->v4
|
|
31
|
+
elementRenderDelay: attribution.elementRenderDelay
|
|
32
|
+
};
|
|
26
33
|
const lcpEntry = attribution.lcpEntry;
|
|
27
34
|
if (lcpEntry) {
|
|
28
|
-
attrs =
|
|
29
|
-
|
|
30
|
-
eid: lcpEntry.id,
|
|
31
|
-
element: attribution.element,
|
|
32
|
-
timeToFirstByte: attribution.timeToFirstByte,
|
|
33
|
-
resourceLoadDelay: attribution.resourceLoadDelay,
|
|
34
|
-
resourceLoadDuration: attribution.resourceLoadDuration,
|
|
35
|
-
resourceLoadTime: attribution.resourceLoadDuration,
|
|
36
|
-
// kept for NR backwards compatibility, deprecated in v3->v4
|
|
37
|
-
elementRenderDelay: attribution.elementRenderDelay,
|
|
38
|
-
...(attribution.navigationEntry && {
|
|
39
|
-
pageUrl: (0, _cleanUrl.cleanURL)(attribution.navigationEntry.name)
|
|
40
|
-
}) // used to ensure the LCP gets the correct URL at harvest time if a soft nav has occurred before page load
|
|
41
|
-
};
|
|
42
|
-
if (attribution.url) attrs.elUrl = (0, _cleanUrl.cleanURL)(attribution.url);
|
|
35
|
+
attrs.size = lcpEntry.size;
|
|
36
|
+
attrs.eid = lcpEntry.id;
|
|
43
37
|
if (lcpEntry.element?.tagName) attrs.elTag = lcpEntry.element.tagName;
|
|
44
38
|
}
|
|
39
|
+
if (attribution.element) attrs.element = attribution.element;
|
|
40
|
+
if (attribution.navigationEntry) attrs.pageUrl = (0, _cleanUrl.cleanURL)(attribution.navigationEntry.name); // used to ensure the LCP gets the correct URL at harvest time if a soft nav has occurred before page load
|
|
41
|
+
if (attribution.url) attrs.elUrl = (0, _cleanUrl.cleanURL)(attribution.url);
|
|
45
42
|
largestContentfulPaint.update({
|
|
46
43
|
value,
|
|
47
44
|
attrs
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2020-
|
|
2
|
+
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { onLCP } from 'web-vitals/attribution';
|
|
@@ -15,26 +15,23 @@ if (isBrowserScope) {
|
|
|
15
15
|
}) => {
|
|
16
16
|
/* Largest Contentful Paint - As of WV v3, it still imperfectly tries to detect document vis state asap and isn't supposed to report if page starts hidden. */
|
|
17
17
|
if (initiallyHidden || largestContentfulPaint.isValid) return;
|
|
18
|
-
let attrs
|
|
18
|
+
let attrs = {
|
|
19
|
+
timeToFirstByte: attribution.timeToFirstByte,
|
|
20
|
+
resourceLoadDelay: attribution.resourceLoadDelay,
|
|
21
|
+
resourceLoadDuration: attribution.resourceLoadDuration,
|
|
22
|
+
resourceLoadTime: attribution.resourceLoadDuration,
|
|
23
|
+
// kept for NR backwards compatibility, deprecated in v3->v4
|
|
24
|
+
elementRenderDelay: attribution.elementRenderDelay
|
|
25
|
+
};
|
|
19
26
|
const lcpEntry = attribution.lcpEntry;
|
|
20
27
|
if (lcpEntry) {
|
|
21
|
-
attrs =
|
|
22
|
-
|
|
23
|
-
eid: lcpEntry.id,
|
|
24
|
-
element: attribution.element,
|
|
25
|
-
timeToFirstByte: attribution.timeToFirstByte,
|
|
26
|
-
resourceLoadDelay: attribution.resourceLoadDelay,
|
|
27
|
-
resourceLoadDuration: attribution.resourceLoadDuration,
|
|
28
|
-
resourceLoadTime: attribution.resourceLoadDuration,
|
|
29
|
-
// kept for NR backwards compatibility, deprecated in v3->v4
|
|
30
|
-
elementRenderDelay: attribution.elementRenderDelay,
|
|
31
|
-
...(attribution.navigationEntry && {
|
|
32
|
-
pageUrl: cleanURL(attribution.navigationEntry.name)
|
|
33
|
-
}) // used to ensure the LCP gets the correct URL at harvest time if a soft nav has occurred before page load
|
|
34
|
-
};
|
|
35
|
-
if (attribution.url) attrs.elUrl = cleanURL(attribution.url);
|
|
28
|
+
attrs.size = lcpEntry.size;
|
|
29
|
+
attrs.eid = lcpEntry.id;
|
|
36
30
|
if (lcpEntry.element?.tagName) attrs.elTag = lcpEntry.element.tagName;
|
|
37
31
|
}
|
|
32
|
+
if (attribution.element) attrs.element = attribution.element;
|
|
33
|
+
if (attribution.navigationEntry) attrs.pageUrl = cleanURL(attribution.navigationEntry.name); // used to ensure the LCP gets the correct URL at harvest time if a soft nav has occurred before page load
|
|
34
|
+
if (attribution.url) attrs.elUrl = cleanURL(attribution.url);
|
|
38
35
|
largestContentfulPaint.update({
|
|
39
36
|
value,
|
|
40
37
|
attrs
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright 2020-
|
|
2
|
+
* Copyright 2020-2026 New Relic, Inc. All rights reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { onLCP } from 'web-vitals/attribution'
|
|
@@ -15,23 +15,22 @@ if (isBrowserScope) {
|
|
|
15
15
|
/* Largest Contentful Paint - As of WV v3, it still imperfectly tries to detect document vis state asap and isn't supposed to report if page starts hidden. */
|
|
16
16
|
if (initiallyHidden || largestContentfulPaint.isValid) return
|
|
17
17
|
|
|
18
|
-
let attrs
|
|
18
|
+
let attrs = {
|
|
19
|
+
timeToFirstByte: attribution.timeToFirstByte,
|
|
20
|
+
resourceLoadDelay: attribution.resourceLoadDelay,
|
|
21
|
+
resourceLoadDuration: attribution.resourceLoadDuration,
|
|
22
|
+
resourceLoadTime: attribution.resourceLoadDuration, // kept for NR backwards compatibility, deprecated in v3->v4
|
|
23
|
+
elementRenderDelay: attribution.elementRenderDelay
|
|
24
|
+
}
|
|
19
25
|
const lcpEntry = attribution.lcpEntry
|
|
20
26
|
if (lcpEntry) {
|
|
21
|
-
attrs =
|
|
22
|
-
|
|
23
|
-
eid: lcpEntry.id,
|
|
24
|
-
element: attribution.element,
|
|
25
|
-
timeToFirstByte: attribution.timeToFirstByte,
|
|
26
|
-
resourceLoadDelay: attribution.resourceLoadDelay,
|
|
27
|
-
resourceLoadDuration: attribution.resourceLoadDuration,
|
|
28
|
-
resourceLoadTime: attribution.resourceLoadDuration, // kept for NR backwards compatibility, deprecated in v3->v4
|
|
29
|
-
elementRenderDelay: attribution.elementRenderDelay,
|
|
30
|
-
...(attribution.navigationEntry && { pageUrl: cleanURL(attribution.navigationEntry.name) }) // used to ensure the LCP gets the correct URL at harvest time if a soft nav has occurred before page load
|
|
31
|
-
}
|
|
32
|
-
if (attribution.url) attrs.elUrl = cleanURL(attribution.url)
|
|
27
|
+
attrs.size = lcpEntry.size
|
|
28
|
+
attrs.eid = lcpEntry.id
|
|
33
29
|
if (lcpEntry.element?.tagName) attrs.elTag = lcpEntry.element.tagName
|
|
34
30
|
}
|
|
31
|
+
if (attribution.element) attrs.element = attribution.element
|
|
32
|
+
if (attribution.navigationEntry) attrs.pageUrl = cleanURL(attribution.navigationEntry.name) // used to ensure the LCP gets the correct URL at harvest time if a soft nav has occurred before page load
|
|
33
|
+
if (attribution.url) attrs.elUrl = cleanURL(attribution.url)
|
|
35
34
|
|
|
36
35
|
largestContentfulPaint.update({ value, attrs })
|
|
37
36
|
})
|