-
Notifications
You must be signed in to change notification settings - Fork 26
Description
As a followup to recent changes for the WICG App History proposal to integrate it with the PerformanceTimeline, we discussed on a recent W3C WebPerf call what kind of API shape would be ideal for monitoring all of the new possible navigation entry types, e.g.:
- Regular Navigations
PerformanceNavigationTiming- The only type that exists today
- Monitored via the
navigationkeyword in a PerformanceObserver - Has fields for network timestamps,
.name(URL), etc
- App History (Soft Navs)
- A new proposed
SameDocumentNavigationEntrytype - Has
.success,.startTimeand.durationfields only
- A new proposed
- BFCache
- Proposal to have BFCache navs show up, should it have a different entry type than
PerformanceNavigationTiming? - Would probably want to have the same reduced fields as App History, but maybe even
.durationis not appropriate?
- Proposal to have BFCache navs show up, should it have a different entry type than
One question is: How we want these new navigation types to integrate with the existing PerformanceTimeline and PerformanceObservers?
Today, you simply get a single "the navigation" NavigationTiming entry if you do this:
const observer = new PerformanceObserver(...);
observer.observe({ type: "navigation" });
With these new possible "navigation-like" types, would you get additional entries from the above observer?
Or should we expose them elsewhere?
For example, we may want to require developers to specifically observe new types if they want them (for back-compat):
const observer = new PerformanceObserver(...);
observer.observe({ types: ["navigation", "same-document-navigation"] });
We could also offer a new "super" type to listen for, that would emit entries for the above navigations, plus any new ones that are created in the future:
const observer = new PerformanceObserver(...);
observer.observe({ type: "all-navigations" });
The alternative is to simply emit these new ones under the navigation observer, as IIRC we crawled the web and found that nearly everyone looking at NavigationTiming from a PerformanceObserver was just looking at the [0]th entry.
We had some discussion about this on a recent call, and you can find our minutes here;
This issue is intended as a continuation of that discussion to gather more feedback on the above ideas.