Repository navigation
Add Soft Navigation docs - #45053
Add Soft Navigation docs#45053
Conversation
|
@mmocny could you review for technical accuracy? |
|
@chrisdavidmills as discussed |
chrisdavidmills
left a comment
There was a problem hiding this comment.
Very nice work, @tunetheweb, this generally makes sense. I've left quite a few comments, but most of them are fairly minor language nitpicks.
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
|
Thanks very much @chrisdavidmills for the detailed review and spotting those errors! I think I've addressed all the feedback. I've left a couple of comments open in case you wanna discuss those further. Ready for another look. |
mmocny
left a comment
There was a problem hiding this comment.
Lots of good new content!
I spotted a few small grammar issues, but I wonder if AI reviewer would spot more. I didn't try.
chrisdavidmills
left a comment
There was a problem hiding this comment.
Nice work, @tunetheweb, this is pretty close now. I've left a few more comments on the new content you added last time around.
|
|
||
| The **`getLargestInteractionContentfulPaint()`** method of the {{domxref("PerformanceSoftNavigation")}} interface returns the current largest {{domxref("InteractionContentfulPaint")}} relevant to this soft navigation. | ||
|
|
||
| Some {{Glossary("SPA", "Single Page Applications (SPAs)")}} may paint first, and update the URL afterwards. When measuring {{Glossary("Largest contentful paint", "Largest Contentful Paint (LCP)")}} for {{Glossary("Soft navigation", "soft navigations")}} developers will want to include these paints, despite them happing before the URL updates. Since developers will not know if an interaction and a paint, may also result in a URL update and so a soft navigation, they would need to measure and buffer all `InteractionContentfulPaint` entries. |
There was a problem hiding this comment.
| Some {{Glossary("SPA", "Single Page Applications (SPAs)")}} may paint first, and update the URL afterwards. When measuring {{Glossary("Largest contentful paint", "Largest Contentful Paint (LCP)")}} for {{Glossary("Soft navigation", "soft navigations")}} developers will want to include these paints, despite them happing before the URL updates. Since developers will not know if an interaction and a paint, may also result in a URL update and so a soft navigation, they would need to measure and buffer all `InteractionContentfulPaint` entries. | |
| Some {{Glossary("SPA", "Single Page Applications (SPAs)")}} may paint first and update the URL afterwards. When measuring {{Glossary("Largest contentful paint", "Largest Contentful Paint (LCP)")}} for {{Glossary("Soft navigation", "soft navigations")}}, developers will want to include these paints despite them happening before the URL updates. Since developers will not know if an interaction and a paint will also result in a URL update and therefore a soft navigation, they would need to measure and buffer all `InteractionContentfulPaint` entries. |
There was a problem hiding this comment.
@mmocny suggested changes to this text so changed it to this:
Some {{Glossary("SPA", "Single Page Applications (SPAs)")}} may paint first, and update the URL afterwards. When measuring {{Glossary("Largest contentful paint", "Largest Contentful Paint (LCP)")}} for {{Glossary("Soft navigation", "soft navigations")}}, developers will want to include these paints, despite them happening before the URL updates. Because any interaction with any paints could in theory also lead to a URL update and thus soft navigation at any point in the future this could be difficult to measure without potentially saving a temporary reference to every interaction's LCP, should it be needed.
Let me know if you've any further changes.
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
chrisdavidmills
left a comment
There was a problem hiding this comment.
OK, @tunetheweb, a couple of last minute wording suggestions for the last round of changes.
If you are happy with these (and @mmocny is happy), then I'm happy.
…ulpaint/index.md Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
…ctioncontentfulpaint/index.md Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
chrisdavidmills
left a comment
There was a problem hiding this comment.
@tunetheweb, awesome, approving.
I'll just hold off on merging until @mmocny gives us an LGTM, too.
|
LGTM, thanks for the updates! (I dont have access to formally Approve the PR) |
No worries, this is perfect. Let's do this! |
|
Gahhh just spotted this:
Fix here: #45106 |
| } | ||
| }); | ||
| observer.observe({ type: "interaction-contentful-paint", buffered: true }); | ||
|
|
||
| ## Specifications | ||
|
|
There was a problem hiding this comment.
FYI, malformed Markdown in a few files (has been fixed)

Description
Chrome 151 includes the Soft Navigations and Interaction Contentful Paint spec addressing a long-standing issue of measuring performance across SPAs
Motivation
Document APIs available unflagged in Chromium-based browsers
Additional details
Related issues and pull requests
I've a BCD change in flight for this too (mdn/browser-compat-data#30195), but it's waiting on w3c/browser-specs#2593 to land first