Skip to content
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

Use View Transitions API for <transition> #7881

Closed
hfhchan opened this issue Mar 11, 2023 · 4 comments
Closed

Use View Transitions API for <transition> #7881

hfhchan opened this issue Mar 11, 2023 · 4 comments
Labels
✨ feature request New feature or request transferred to rfc discussions Please manually search in http://github.com/vuejs/rfcs/discussions for the latest discussions

Comments

@hfhchan
Copy link

hfhchan commented Mar 11, 2023

What problem does this feature solve?

View Transitions API (currently supported by Chrome only) is a browser-provided API to do full page or shared element transitions. It greatly simplifies the implementation of <transition> as the Vue can directly mutate the DOM state and no need to keep both the old and new components in the DOM at the same time.

What does the proposed API look like?

The <transition> element should call the View Transition API directly if it is supported. Alternatively, a new element such as <native-transition> can be provided as it seems the currently CSS syntax is not identical.

@hfhchan hfhchan added the ✨ feature request New feature or request label Mar 11, 2023
@RihanArfan
Copy link

I'm very interested in this too and given it some thought. Since the current <transition> element is used for making regular CSS transitions, I think the View Transition API should be a separate component which could be used with the vue-router.

Also worth noting it's being added to Nuxt 🥳 nuxt/nuxt#20092

@yisibl
Copy link

yisibl commented Aug 4, 2023

Astro 2.10: Persistent State in View Transitions

@Anoesj
Copy link

Anoesj commented Aug 22, 2023

It seems to me developers would need to add more CSS in their projects to support both the View Transitions API (if available) and Vue's own transitions API. Therefore, if this is added, it probably needs to be an opt-in feature. A new "modern" prop on the <Transition> and <TransitionGroup> components to enable it could work. Also, adding a global Vue config setting to enable modern on all instances of <Transition> and <TransitionGroup> by default might be nice ("app.config.enableModernTransitions"?).

@Anoesj
Copy link

Anoesj commented Aug 22, 2023

Tagging @danielroe, maybe you have some ideas on how to properly add this to Vue? 😃

@vuejs vuejs locked and limited conversation to collaborators Aug 31, 2023
@sodatea sodatea converted this issue into a discussion Aug 31, 2023
@sodatea sodatea added the transferred to rfc discussions Please manually search in http://github.com/vuejs/rfcs/discussions for the latest discussions label Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✨ feature request New feature or request transferred to rfc discussions Please manually search in http://github.com/vuejs/rfcs/discussions for the latest discussions
Projects
None yet
Development

No branches or pull requests

5 participants