Skip to content

Commit 1cc4573

Browse files
committed
Merge branch 'main' into soft-navs
2 parents 4b04720 + 7d35287 commit 1cc4573

28 files changed

+4419
-8300
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Lint Code Base
2+
permissions:
3+
contents: read
24
on:
35
pull_request:
46
push:

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Run tests
2+
permissions:
3+
contents: read
24
on:
35
pull_request:
46
push:

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
### v5.2.0 (2026-03-25)
4+
5+
- Replace `filter()[0]` with `find()` for better performance ([#658](https://github.com/GoogleChrome/web-vitals/pull/658))
6+
- Use `queueMicrotask` for microtask scheduling ([#660](https://github.com/GoogleChrome/web-vitals/pull/660))
7+
- Simplify the event and LoAF entry clean up logic ([#662](https://github.com/GoogleChrome/web-vitals/pull/662))
8+
- Remove obsolete FID polyfill types ([#675](https://github.com/GoogleChrome/web-vitals/pull/675))
9+
- Use `LargestContentfulPaint.id` as fallback when element is removed from DOM ([#676](https://github.com/GoogleChrome/web-vitals/pull/676))
10+
- Fix bug for `onLCP` when attached late ([#697](https://github.com/GoogleChrome/web-vitals/pull/697))
11+
- FHandle initially hidden pages and onLCP registered on visibility change ([#698](https://github.com/GoogleChrome/web-vitals/pull/698))
12+
- Ensure we clear idle callbacks in `whenIdleOrHidden` ([#707](https://github.com/GoogleChrome/web-vitals/pull/707))
13+
- Limit pending events to conserve memory ([#710](https://github.com/GoogleChrome/web-vitals/pull/710))
14+
- Add `includeProcessedEventEntries` option ([#714](https://github.com/GoogleChrome/web-vitals/pull/714))
15+
- Reduce bundle size by refactoring ([#713](https://github.com/GoogleChrome/web-vitals/pull/713))
16+
317
### v5.1.0 (2025-07-31)
418

519
- Register `visibility-change` early ([#637](https://github.com/GoogleChrome/web-vitals/pull/637))

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ Metric-specific subclasses:
727727
```ts
728728
interface INPAttributionReportOpts extends AttributionReportOpts {
729729
durationThreshold?: number;
730+
includeProcessedEventEntries?: boolean;
730731
reportSoftNavs?: boolean;
731732
}
732733
```
@@ -883,6 +884,15 @@ In the [attribution build](#attribution-build) each of the metric functions has
883884
onLCP(sendToAnalytics, {generateTarget: customGenerateTarget});
884885
```
885886

887+
3. The `onINP` `AttributionReportOpts` supports an additional, optional, `includeProcessedEventEntries` configuration option. When set to `false`, the `event` performance entries will not be included in the `attribution` object to conserve memory if these entries are not needed. The default value is `true`.
888+
889+
```ts
890+
interface INPAttributionReportOpts extends AttributionReportOpts {
891+
durationThreshold?: number;
892+
includeProcessedEventEntries?: boolean;
893+
}
894+
```
895+
886896
The next sections document the shape of the `attribution` object for each of the metrics:
887897

888898
#### `CLSAttribution`
@@ -999,6 +1009,9 @@ interface INPAttribution {
9991009
/**
10001010
* An array of Event Timing entries that were processed within the same
10011011
* animation frame as the INP candidate interaction.
1012+
* This array can be quite large so it will be empty if the
1013+
* `includeProcessedEventEntries` configuration option is set to `false` to
1014+
* conserve memory if these entries are not required.
10021015
*/
10031016
processedEventEntries: PerformanceEventTiming[];
10041017
/**

0 commit comments

Comments
 (0)