@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.
Files changed (51) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +1 -1
  3. package/dist/cjs/common/constants/env.cdn.js +2 -2
  4. package/dist/cjs/common/constants/env.npm.js +2 -2
  5. package/dist/cjs/common/util/event-origin.js +36 -0
  6. package/dist/cjs/common/vitals/constants.js +1 -1
  7. package/dist/cjs/features/ajax/instrument/index.js +3 -2
  8. package/dist/cjs/features/jserrors/shared/cast-error.js +5 -5
  9. package/dist/cjs/features/metrics/aggregate/index.js +3 -0
  10. package/dist/cjs/features/metrics/instrument/index.js +7 -0
  11. package/dist/cjs/features/page_view_timing/aggregate/index.js +31 -4
  12. package/dist/cjs/features/session_replay/shared/stylesheet-evaluator.js +1 -1
  13. package/dist/cjs/features/session_trace/aggregate/trace/storage.js +4 -28
  14. package/dist/esm/common/constants/env.cdn.js +2 -2
  15. package/dist/esm/common/constants/env.npm.js +2 -2
  16. package/dist/esm/common/util/event-origin.js +30 -0
  17. package/dist/esm/common/vitals/constants.js +1 -1
  18. package/dist/esm/features/ajax/instrument/index.js +3 -2
  19. package/dist/esm/features/jserrors/shared/cast-error.js +5 -5
  20. package/dist/esm/features/metrics/aggregate/index.js +3 -0
  21. package/dist/esm/features/metrics/instrument/index.js +12 -2
  22. package/dist/esm/features/page_view_timing/aggregate/index.js +31 -4
  23. package/dist/esm/features/session_replay/shared/stylesheet-evaluator.js +1 -1
  24. package/dist/esm/features/session_trace/aggregate/trace/storage.js +4 -28
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/dist/types/common/util/event-origin.d.ts +13 -0
  27. package/dist/types/common/util/event-origin.d.ts.map +1 -0
  28. package/dist/types/common/vitals/constants.d.ts +1 -1
  29. package/dist/types/features/ajax/instrument/index.d.ts.map +1 -1
  30. package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
  31. package/dist/types/features/metrics/instrument/index.d.ts.map +1 -1
  32. package/dist/types/features/page_view_timing/aggregate/index.d.ts +12 -1
  33. package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
  34. package/dist/types/features/session_trace/aggregate/trace/storage.d.ts +0 -1
  35. package/dist/types/features/session_trace/aggregate/trace/storage.d.ts.map +1 -1
  36. package/package.json +3 -3
  37. package/src/common/util/event-origin.js +36 -0
  38. package/src/common/vitals/constants.js +1 -1
  39. package/src/common/vitals/interaction-to-next-paint.js +1 -1
  40. package/src/features/ajax/instrument/index.js +3 -2
  41. package/src/features/jserrors/shared/cast-error.js +5 -5
  42. package/src/features/metrics/aggregate/index.js +3 -0
  43. package/src/features/metrics/instrument/index.js +14 -2
  44. package/src/features/page_view_timing/aggregate/index.js +33 -4
  45. package/src/features/session_replay/shared/stylesheet-evaluator.js +1 -1
  46. package/src/features/session_trace/aggregate/trace/storage.js +4 -33
  47. package/dist/cjs/common/vitals/first-input-delay.js +0 -36
  48. package/dist/esm/common/vitals/first-input-delay.js +0 -29
  49. package/dist/types/common/vitals/first-input-delay.d.ts +0 -3
  50. package/dist/types/common/vitals/first-input-delay.d.ts.map +0 -1
  51. 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
- }