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
navigation keyword in a PerformanceObserver
- Has fields for network timestamps,
.name (URL), etc
- App History (Soft Navs)
- 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
.duration is not appropriate?
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.
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.:
PerformanceNavigationTimingnavigationkeyword in a PerformanceObserver.name(URL), etcSameDocumentNavigationEntrytype.success,.startTimeand.durationfields onlyPerformanceNavigationTiming?.durationis not appropriate?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:
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):
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:
The alternative is to simply emit these new ones under the
navigationobserver, 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.