@newrelic/browser-agent 1.283.2 → 1.284.1
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/CHANGELOG.md +23 -0
- package/LICENSE +1 -1
- package/dist/cjs/common/constants/env.cdn.js +2 -2
- package/dist/cjs/common/constants/env.npm.js +2 -2
- package/dist/cjs/common/util/event-origin.js +36 -0
- package/dist/cjs/common/vitals/constants.js +1 -1
- package/dist/cjs/features/ajax/instrument/index.js +3 -2
- package/dist/cjs/features/jserrors/shared/cast-error.js +5 -5
- package/dist/cjs/features/metrics/aggregate/index.js +3 -0
- package/dist/cjs/features/metrics/instrument/index.js +7 -0
- package/dist/cjs/features/page_view_timing/aggregate/index.js +31 -4
- package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/cjs/features/session_trace/aggregate/trace/storage.js +4 -28
- package/dist/esm/common/constants/env.cdn.js +2 -2
- package/dist/esm/common/constants/env.npm.js +2 -2
- package/dist/esm/common/util/event-origin.js +30 -0
- package/dist/esm/common/vitals/constants.js +1 -1
- package/dist/esm/features/ajax/instrument/index.js +3 -2
- package/dist/esm/features/jserrors/shared/cast-error.js +5 -5
- package/dist/esm/features/metrics/aggregate/index.js +3 -0
- package/dist/esm/features/metrics/instrument/index.js +12 -2
- package/dist/esm/features/page_view_timing/aggregate/index.js +31 -4
- package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/dist/esm/features/session_trace/aggregate/trace/storage.js +4 -28
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/common/util/event-origin.d.ts +13 -0
- package/dist/types/common/util/event-origin.d.ts.map +1 -0
- package/dist/types/common/vitals/constants.d.ts +1 -1
- package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/metrics/instrument/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +12 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_trace/aggregate/trace/storage.d.ts +0 -1
- package/dist/types/features/session_trace/aggregate/trace/storage.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/common/util/event-origin.js +36 -0
- package/src/common/vitals/constants.js +1 -1
- package/src/common/vitals/interaction-to-next-paint.js +1 -1
- package/src/features/ajax/instrument/index.js +3 -2
- package/src/features/jserrors/shared/cast-error.js +5 -5
- package/src/features/metrics/aggregate/index.js +3 -0
- package/src/features/metrics/instrument/index.js +14 -2
- package/src/features/page_view_timing/aggregate/index.js +33 -4
- package/src/features/session_replay/shared/stylesheet-evaluator.js +1 -1
- package/src/features/session_trace/aggregate/trace/storage.js +4 -33
- package/dist/cjs/common/vitals/first-input-delay.js +0 -36
- package/dist/esm/common/vitals/first-input-delay.js +0 -29
- package/dist/types/common/vitals/first-input-delay.d.ts +0 -3
- package/dist/types/common/vitals/first-input-delay.d.ts.map +0 -1
- package/src/common/vitals/first-input-delay.js +0 -28
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2020-2025 New Relic, Inc. All rights reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { onFID } from 'web-vitals/attribution'
|
|
6
|
-
import { VitalMetric } from './vital-metric'
|
|
7
|
-
import { VITAL_NAMES } from './constants'
|
|
8
|
-
import { initiallyHidden, isBrowserScope } from '../constants/runtime'
|
|
9
|
-
|
|
10
|
-
export const firstInputDelay = new VitalMetric(VITAL_NAMES.FIRST_INPUT_DELAY)
|
|
11
|
-
|
|
12
|
-
if (isBrowserScope) {
|
|
13
|
-
onFID(({ value, attribution }) => {
|
|
14
|
-
if (initiallyHidden || firstInputDelay.isValid) return
|
|
15
|
-
const attrs = {
|
|
16
|
-
type: attribution.eventType,
|
|
17
|
-
fid: Math.round(value),
|
|
18
|
-
eventTarget: attribution.eventTarget,
|
|
19
|
-
loadState: attribution.loadState
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// CWV will only report one (THE) first-input entry to us; fid isn't reported if there are no user interactions occurs before the *first* page hiding.
|
|
23
|
-
firstInputDelay.update({
|
|
24
|
-
value: attribution.eventTime,
|
|
25
|
-
attrs
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
}
|