How to make mithril work with View Transition #3014
Unanswered
DellZHackintosh
asked this question in
Q&A
Replies: 2 comments 18 replies
-
What does your code look like so far? I've looked into it myself for how integrating with the view transitions API might look like, but I never dug deep enough to come up with anything concrete so far. |
Beta Was this translation helpful? Give feedback.
11 replies
-
Hey @dead-claudia, I've seen your issue. You could contact chrome team at the same time, to find if there's still a chance to adapt. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have been exploring the View Transition API, which simplifies implementing transitions while offering greater controllability compared to the animation techniques provided by Mithril (see Mithril animation). In my experiments, I attempted to hook into
m.route.set
,m.redraw
, and evenm.redraw.sync
because invokingdocument.startViewTransition(m.route.set)
directly has not proven reliable. This unreliability is due to the fact thatm.redraw
depends onrequestAnimationFrame
and lacks a mechanism to indicate its status, causing the view transition to begin before the redraw cycle has fully completed.The tests I conducted indicate that this hooking approach does not produce the intended effect. Even if it were to work sporadically, it would not serve as a reliable solution in a production environment. Would you consider modifying
m.route.set
andm.redraw
to return a promise, or help finding another temporary hook method to ensure Mithril's compatibility with the View Transition API?Thank you for your time and consideration.
Beta Was this translation helpful? Give feedback.
All reactions