-
Notifications
You must be signed in to change notification settings - Fork 56
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
Soft Navigations #879
Comments
A (rough and initial) spec for this is at https://wicg.github.io/soft-navigations |
Hi @yoavweiss -- thanks for bringing this to our attention. Our biggest question has to do with the question of DOM modifications. You state a soft navigation "modifies the DOM" but it's not clear why this is a requirement? It seems like you're trying to make a distinction between "navigations" and "interactions", it's unclear how this subtle (and underspecified?) distinction can be reliably determined by your proposed heuristics. We can imagine that the heuristics can be defined to catch current examples but would be wrong about future applications. We wonder if simply using the navigation API should be the trigger, and then possibly provide the developer a hook to filter out navigations they don't feel are worth tracking would be more reliable? |
Thanks for taking a look. I added a goals section to the explainer that clarifies some of the constrains around the design.
That's a great question. I've ran a bunch of experiments, and this seemed to align well with SPAs today. But it is possible that the heuristic will evolve as part of the Origin Trial, or given this reported issue.
The Navigation API doesn't provide any more guarantees than the History API did regarding what is and isn't an actual navigation.
The newly added [goals] section should clarify why that strategy will not work well for the use case. |
Hi @yoavweiss, We looked at this again today during a breakout and had some questions. Thank you! |
@yoavweiss any feedback? |
Apologies for my delay here, I was implementing some changes related to this feedback to test their feasibility.
The heuristics are in fairly good shape, so I wouldn't expect significant changes on it in terms of implementation. I'm hoping to get the spec to catch up with the implementation in the next few days.
Yeah, that's the intent.
Not at the moment. This might be future evolution of the feature, but there aren't current plans for this.
Mozilla position
Thanks for that feedback. The current implementation changes that requirement from "DOM modification" to a contentful paint that's a direct result of user interaction. I'll modify the spec to that effect. |
Hi @yoavweiss, Thank you for clarifying. We took another look today. Also, as a general principle, when introducing heuristics, it's generally good to also introduce a way to override the heuristic. If that's too hard, then the data collected by the heuristic should be treated as potentially noisy, i.e. this concept of Soft navigations should not be relied upon for anything that affects the user experience. For analytics, it may be ok; probably better to err on the side of false positives than false negatives, and include enough data that the false positives could be filtered out on the analytics side. |
In terms of spec, any paint that's considered for LCP is one that soft navigations consider as a contentful paint. This area (PaintTiming+LCP) is currently in the process of being rewritten to make it clearer. ^^ @clelland In terms of hover effects, they may be considered as a contentful paint, but won't be counted as a soft navigation since:
This seems like a useful principle! There's already WICG/soft-navigations#13 requesting this. I agree that it can be useful, but given the analytics-only nature of the feature, I also agree that it's non-blocking. |
Awesome, thanks! When do you think you may be able to make the explainer changes? I currently added it to be looked at again 2 weeks from now (next week is Design Principles week) but if you can get them in before our plenary this week (2am EST on Thursday) we may be able to close then. |
I just updated the explainer to emphasize which events count for interactions. Let me know if that works! :) |
Thanks! Could pressing a key also be the tab key? If so, how do you distinguish focus styling from soft navigations? Edit: I guess this prevents that?
But then where does the contentful paint come in? |
One missing condition in my previous clarification (now fixed! thanks!!) is that the keypress is unfocused (i.e. its target is the body element). So a tab key that changes focus would not be considered for a soft navigation, but e.g. a tab key that is used to move between different pages would be.
For a soft navigation to be detected, an eligible event ("click" or unfocused keyboard event) would need to spawn tasks that both change the URL and append DOM nodes that end up with contentful paints. |
It still seems problematic that it requires a DOM node to be appended. I've seen (and implemented) soft navigations were the only DOM change was an attribute value (to select an active tab, for example, causing various |
@plinss - Indeed CSS-only soft navigations are not handled by the current heuristic. So far after a ~year of experimentation, I've seen a single case in the wild where this is an issue. It seems like something we could solve in a future iteration of the heuristic, but one that would require a bit more research. |
What about attribute value changes, are those considered 'appending a DOM node'? (If so, you might want to spell that out a bit better.) |
Attribute change is not currently considered. I agree that for some attributes (e.g. an image's |
We understand that the current heuristics are based on most common current practices and it looks like you're prepared to evolve them as newer techniques become more popular. We're still concerned about lack of author control for extending/enhancing the heuristics, but given that this is only for performance measurements, we're going to close this as satisfied. Our main remaining concern is that others may want to repurpose this signal in the future, and without author controls, this signal won't be reliable enough. Please consider adding a note to the spec to explain this limitation. Thanks for flying TAG. |
こんにちは TAG-さん!
I'm requesting a TAG review of Soft Navigations.
“Soft navigations” are JS-driven same-document navigations that are using the history API or the new Navigation API, triggered by a user gesture and modifies the DOM, modifying the previous content, as well as the URL displayed to the user.
w3c/performance-timeline#168 outlines the desire to be able to better report performance metrics on soft navigations. Heuristics for detecting soft navigations can measure their SPA’s performance metrics, and optimize them to benefit their users.
Further details:
You should also know that the spec and feature rely on infrastructure for Task Attribution. It's currently defined in the same spec as this feature, but could be considered separately in the future (if more features use it). It also has some overlap with a TC39 proposal called AsyncContext.
Beyond that, the feature's usability relies on Performance Entry's navigationId, which is currently a WIP.
We'd prefer the TAG provide feedback as (please delete all but the desired option):
💬 leave review feedback as a comment in this issue and @-notify yoavweiss
The text was updated successfully, but these errors were encountered: