Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Soft Navigation #603

Open
tkadlec opened this issue Feb 10, 2023 · 4 comments
Open

Add support for Soft Navigation #603

tkadlec opened this issue Feb 10, 2023 · 4 comments

Comments

@tkadlec
Copy link
Contributor

tkadlec commented Feb 10, 2023

Chrome is experimenting with support for Soft Navigations, which would make it possible for folks to see Core Web Vitals (and other page lifecycle metrics) for single-page applications. https://developer.chrome.com/blog/soft-navigations-experiment/

This would be awesome to support because right now testing SPA's in WebPageTest with multi-page steps means we can't provide those metrics.

There are a few things we could use here:

One is to look for soft-navigation events in a Performance Observer like so:

const observer = new PerformanceObserver(console.log);
observer.observe({ type: "soft-navigation", buffered: true });

The other is to look at the trace events the Chrome team was kind enough to add: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/timing/soft_navigation_heuristics.cc;drc=0c4306fc554c80506eb0f9b833a5d2a5fdd452d5;l=204

@pmeenan
Copy link
Contributor

pmeenan commented Feb 10, 2023

Enabling it with --enable-experimental-web-platform-features globally might be risky because that triggers a bunch of other features too. Could be useful for a one-off. Let me poke around and see if there is a blink-specific feature flag that can be enabled with --enable-blink-features= instead.

@pmeenan
Copy link
Contributor

pmeenan commented Feb 10, 2023

I'll need to double-check but I think --enable-blink-features=SoftNavigationHeuristics should turn just that feature on. @yoavweiss do you know for sure? I can't remember if that can be used for all of the runtime_enabled_features or each one needs to be plumbed specifically.

@tkadlec
Copy link
Contributor Author

tkadlec commented Feb 10, 2023

I also don't mind if our initial support is a bit more experimental for sure. Like...something you have to opt into until it stabilizes a bit, but let's see what the wise Mr. @yoavweiss has to say. :)

@yoavweiss
Copy link
Contributor

--enable-blink-features="SoftNavigationHeuristics,NavigationId" should work, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants