Skip to content

API shape for monitoring new navigation-like entries such as App History, BFCache, etc #182

@nicjansma

Description

@nicjansma

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions