v144 ยท miscellaneous
ViewTransitions waitUntil() method
The ViewTransition automatically constructs a pseudo-element tree to display and animate participating elements in the transition. Per spec, this subtree is constructed when the view transition starts animating and is destroyed when the animations associated with all view transition pseudo-elements are in the finished state (or more precisely in a non-runnin
concepts
-
waitUntil
Extend a view transition's lifecycle with arbitrary async work. Useful for waiting on images, fetches, or animations that aren't tied to the DOM update.
-
Cancel or Finish
The defer-with-timeout pattern: wait for an image to decode but skip the transition if it's too slow. Promise.race + skipTransition give you graceful degradation.
-
Extension Recipes
Four real-world callers of
waitUntil()— image decode, fetch, JS animation, timeout race. Each one fires a transition and shows the timing. -
Loading States
A simulated SPA with 3 pages: navigating triggers
startViewTransition()with an async callback that waits for a configurable fetch delay. A live timeline shows each phase โ setup, capturing, waiting, animating, finished.
why it shipped
The ViewTransition automatically constructs a pseudo-element tree to display and animate participating elements in the transition. Per spec, this subtree is constructed when the view transition starts animating and is destroyed when the animations associated with all view transition pseudo-elements are in the finished state (or more precisely in a non-runnin