GoogleChrome / GoogleChrome/lighthouse
Report perf metrics on soft navigations
- Dominant language
- JavaScript
- Stars
- 30.8k
- Forks
- 9.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 19
Description
We (and others) have long been interested in making softnavigations more of a first-class experience in Lighthouse. You should be able to know the LCP, FCP, Speed index, etc for that softnav, just like you do for a hard nav.
-------
soft navs are (almost) a thing: https://github.com/WICG/soft-navigations
there's several heuristics to be satisfied (either with the new Navigation API or with the older pushState style).. when they're good, blink marks it as a soft nav.
There's [two](https://groups.google.com/a/chromium.org/g/blink-dev/c/MK01W5X_x6E/m/FHNQ_pJXCAAJ) [intents](https://groups.google.com/a/chromium.org/g/blink-dev/c/IK-IZTBo59U/m/r8WaR2YOBQAJ?utm_medium=email&utm_source=footer) to expose this concept to the perf timeline.
--------
And there's **instrumentation** behind all this. It appears as though we may have everything we need to support this in lighthouse! 🎉 This'd definitely improve our timespan story.
* [Report LCP for soft navigations (Ib3fd6541)](https://chromium-review.googlesource.com/c/chromium/src/+/3913152)
* [Reset LCP sizes on soft navigations (Ib4270169)](https://chromium-review.googlesource.com/c/chromium/src/+/3930137)
so.. we should see trace events for post-softnav LCP candidates.. I see some [CLs](https://chromium-review.googlesource.com/c/chromium/src/+/3913570) that suggest FP, FCP are affected as well.
* [Add SoftNavigationHeuristics traces (Ifc8253db)](https://chromium-review.googlesource.com/c/chromium/src/+/3970929) and here's trace events for the heuristics individually. and the [final determination](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc;l=200-203;drc=859c521a103437de4f822ae3a20ca1ac1375c956). I'm not sure if the timestamp of this last event is meaningful tho.
This is behind ~`--enable-blink-features=SoftNavigationHeuristics` or just the blanket~ "Experimental Web Platform features" .. `--enable-experimental-web-platform-features`. I successfully saw the "A soft navigation has been detected" console message with the latter flag on https://next-movies-zeta.vercel.app/
---------
In feb 2023 https://chromium-review.googlesource.com/c/chromium/src/+/4230572 landed, adding this: `{type: 'largest-contentful-paint', includeSoftNavigationObservations: true}`
this might affect trace event emitting in softnav cases.
Contributor guide
Assessment
This issue has not been assessed yet.