-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Support for Chrome's Document Transitions #5689
Comments
@geoffrich did some exploration here https://github.com/geoffrich/sveltekit-shared-element-transitions |
I think we need to add a lifecycle function that runs immediately before the DOM updates that are followed by |
May I suggest: But yes, this would be super helpful for integrating with shared element transitions. My demo currently starts the transition in From the explainer:
As for bikeshedding: if we're going after your previous comment, perhaps |
Maybe |
or |
any news on this one? |
What news? This feature isn't even finalized from browsers yet, we won't add support before that happens. |
Revisiting this now that the View Transitions API (as it's now called) is in Chrome stable. Opened a PR, would be glad for feedback from anyone who has played around with this stuff: #9605 |
…#9605) Fixes #5689. This adds an onNavigate lifecycle function. --------- Co-authored-by: Rich Harris <git@rich-harris.dev> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: Geoff Rich <4992896+geoffrich@users.noreply.github.com> Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Tee Ming <chewteeming01@gmail.com> Co-authored-by: Rich Harris <rich.harris@vercel.com>
Describe the problem
This issue is to track support for Chrome's
Document Transitions API
AKAShared Element Transitions
on navigations inside sveltekitMore info about Chrome's feature and status can be found here:
https://github.com/WICG/shared-element-transitions/blob/main/developer-guide.md
https://github.com/WICG/shared-element-transitions/blob/main/explainer.md
https://chromestatus.com/feature/5193009714954240
The only reason this is hard to implement in userland is because the time between beforeNavigate and afterNavigate could be considerable considering sveltekit may have to make an http request in the middle of it or importing other modules.
Describe the proposed solution
Provide hooks like
afterNavigate
andbeforeNavigate
but that triggers just before and after the dom updates.That way the user can call
document.createDocumentTransition
on their ownAlternatives considered
Provide a property in the
sveltekit.config.js
file to optionally enable this feature.This way is the simple one, sveltekit just have to call
document.createDocumentTransition
before new navigations updates the dom, update the dom and then resolve the promise.Importance
nice to have
Additional Information
No response
The text was updated successfully, but these errors were encountered: