Dropbox

We’re using TTVC to measure performance on the web—and now you can too

Aug 31, 2022Andrew Hyndman
We’re using TTVC to measure performance on the web—and now you can too
SummaryAI, from the source post

This post introduces and open-sources the @dropbox/ttvc library, which enables the measurement of Time To Visually Complete (TTVC) in real-world user scenarios. It details the advantages of TTVC over metrics like LCP, explaining how it encourages layout stability and a more complete user experience. The post outlines the technical implementation of the library, leveraging MutationObserver and IntersectionObserver APIs to detect DOM mutations and image loading within the viewport, and using requestIdleCallback to determine when the page is considered visually complete. It also covers handling edge cases like user interaction and background tabs, and provides guidance on integrating the library into projects, including support for single-page applications and AJAX request instrumentation.