@newrelic/browser-agent 1.305.0-rc.2 → 1.305.0-rc.4

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.
@@ -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.305.0-rc.2";
20
+ const VERSION = exports.VERSION = "1.305.0-rc.4";
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.305.0-rc.2";
20
+ const VERSION = exports.VERSION = "1.305.0-rc.4";
21
21
 
22
22
  /**
23
23
  * Exposes the build type of the agent
@@ -54,5 +54,5 @@ const ffVersion = exports.ffVersion = (() => {
54
54
  * @type {number}
55
55
  */
56
56
  const originTime = exports.originTime = Date.now() - (0, _now.now)();
57
- const supportsNavTimingL2 = () => typeof PerformanceNavigationTiming !== 'undefined' && globalScope?.performance?.getEntriesByType('navigation')?.length > 0;
57
+ const supportsNavTimingL2 = () => typeof PerformanceNavigationTiming !== 'undefined' && globalScope?.performance?.getEntriesByType('navigation')?.[0]?.responseStart;
58
58
  exports.supportsNavTimingL2 = supportsNavTimingL2;
@@ -21,6 +21,7 @@ const timeToFirstByte = exports.timeToFirstByte = new _vitalMetric.VitalMetric(_
21
21
  * - in browsers that do not support PerformanceNavigationTiming API
22
22
  * - in an iOS browser
23
23
  * - cross-origin iframes specifically in firefox and safari
24
+ * - onTTFB relies on a truthy `responseStart` value, should ensure that exists before relying on it (seen to be falsy in certain Electron.js cases for instance)
24
25
  */
25
26
  if (_runtime.isBrowserScope && (0, _runtime.supportsNavTimingL2)() && !_runtime.isiOS && window === window.parent) {
26
27
  (0, _attribution.onTTFB)(({
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.305.0-rc.2";
14
+ export const VERSION = "1.305.0-rc.4";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.305.0-rc.2";
14
+ export const VERSION = "1.305.0-rc.4";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -49,4 +49,4 @@ export const ffVersion = (() => {
49
49
  * @type {number}
50
50
  */
51
51
  export const originTime = Date.now() - now();
52
- export const supportsNavTimingL2 = () => typeof PerformanceNavigationTiming !== 'undefined' && globalScope?.performance?.getEntriesByType('navigation')?.length > 0;
52
+ export const supportsNavTimingL2 = () => typeof PerformanceNavigationTiming !== 'undefined' && globalScope?.performance?.getEntriesByType('navigation')?.[0]?.responseStart;
@@ -14,6 +14,7 @@ export const timeToFirstByte = new VitalMetric(VITAL_NAMES.TIME_TO_FIRST_BYTE);
14
14
  * - in browsers that do not support PerformanceNavigationTiming API
15
15
  * - in an iOS browser
16
16
  * - cross-origin iframes specifically in firefox and safari
17
+ * - onTTFB relies on a truthy `responseStart` value, should ensure that exists before relying on it (seen to be falsy in certain Electron.js cases for instance)
17
18
  */
18
19
  if (isBrowserScope && supportsNavTimingL2() && !isiOS && window === window.parent) {
19
20
  onTTFB(({
@@ -26,5 +26,5 @@ export const ffVersion: number;
26
26
  * @type {number}
27
27
  */
28
28
  export const originTime: number;
29
- export function supportsNavTimingL2(): boolean;
29
+ export function supportsNavTimingL2(): any;
30
30
  //# sourceMappingURL=runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/runtime.js"],"names":[],"mappings":"AAcA;;GAEG;AACH,qCAEqB;AAErB;;GAEG;AACH,oCAeK;AAEL,oDAUI;AAEJ,oDAA6F;AAE7F,sCAA2F;AAE3F,qCAAyD;AAEzD,4BAA8E;AAE9E;;;;;;GAMG;AACH,iCAAwE;AAExE,+BAOI;AAEJ;;;;GAIG;AACH,yBAFU,MAAM,CAE4B;AAErC,+CAA4J"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/common/constants/runtime.js"],"names":[],"mappings":"AAcA;;GAEG;AACH,qCAEqB;AAErB;;GAEG;AACH,oCAeK;AAEL,oDAUI;AAEJ,oDAA6F;AAE7F,sCAA2F;AAE3F,qCAAyD;AAEzD,4BAA8E;AAE9E;;;;;;GAMG;AACH,iCAAwE;AAExE,+BAOI;AAEJ;;;;GAIG;AACH,yBAFU,MAAM,CAE4B;AAErC,2CAAoK"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.305.0-rc.2",
3
+ "version": "1.305.0-rc.4",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -195,6 +195,7 @@
195
195
  "build:npm": "npm run npm:build:esm && npm run npm:build:cjs && npm run npm:build:types && npm run npm:pack",
196
196
  "cdn:build": "npm run cdn:build:prod",
197
197
  "cdn:build:local": "npm run cdn:webpack",
198
+ "cdn:build:local-external": "npm run cdn:webpack -- --env mode=local-external",
198
199
  "cdn:build:prod": "npm run cdn:webpack -- --env mode=prod",
199
200
  "cdn:build:dev": "npm run cdn:webpack -- --env mode=dev",
200
201
  "cdn:build:experiment": "npm run cdn:webpack -- --env mode=experiment",
@@ -84,4 +84,4 @@ export const ffVersion = (() => {
84
84
  */
85
85
  export const originTime = Date.now() - now()
86
86
 
87
- export const supportsNavTimingL2 = () => typeof PerformanceNavigationTiming !== 'undefined' && globalScope?.performance?.getEntriesByType('navigation')?.length > 0
87
+ export const supportsNavTimingL2 = () => typeof PerformanceNavigationTiming !== 'undefined' && globalScope?.performance?.getEntriesByType('navigation')?.[0]?.responseStart
@@ -15,6 +15,7 @@ export const timeToFirstByte = new VitalMetric(VITAL_NAMES.TIME_TO_FIRST_BYTE)
15
15
  * - in browsers that do not support PerformanceNavigationTiming API
16
16
  * - in an iOS browser
17
17
  * - cross-origin iframes specifically in firefox and safari
18
+ * - onTTFB relies on a truthy `responseStart` value, should ensure that exists before relying on it (seen to be falsy in certain Electron.js cases for instance)
18
19
  */
19
20
  if (isBrowserScope && supportsNavTimingL2() && !isiOS && window === window.parent) {
20
21
  onTTFB(({ value, attribution }) => {