Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Explore how to integrate the new View Transitions API #178

Closed

Description

@luisherranz

Let's explore how to integrate the new View Transitions API!

@DAreRodz played with it in this branch, but everything was hardcoded. Let's see what tools we can build to make using this API a breeze for theme creators.


About running document.startViewTransition with client-side navigation:

  • Should the router support it?

    • Should it be configured using the router's state? Like:

      store({
        state: {
          router: {
            viewTransitions: true,
          },
        },
      });
    • Should it be a <meta> tag like the client-side navigation?

      <meta itemprop="wp-view-transitions" content="active">
    • Should it be the same <meta> tag as the client-side navigation?

      <meta itemprop="wp-interactivity" content='{ "clientSideNavigation": true, "viewTransitions": true }'>
    • Should the client-side navigation be a state configuration instead of a <meta> tag?

      store({
        state: {
          router: {
            clienSideNavigation: true,
            viewTransitions: true
          },
        },
      });
    • Can we make it so document.startViewTransition is not hardcoded into the router, and instead is injected as external functionality? (make the router "extensible")

About setting view-transition-name dynamically:

  • Can we create a directive to set it dynamically right before the user navigates?

    <a
      class="wp-block-group"
      data-wp-link
      data-wp-view-transition-name="featured-image"
    >
      <h3 class="wp-block-header">Some Post Title</h3>
      <img class="wp-block-image" src=".../featured-image.jpg" />
    </a>
  • Should it be part of `wp-link'?

    <a
      class="wp-block-group"
      data-wp-link='{ "prefetch": true, "viewTransitionName": "featured-image" }'
    >
      <h3 class="wp-block-header">Some Post Title</h3>
      <img class="wp-block-image" src=".../featured-image.jpg" />
    </a>
  • If this needs to match the CSS of the theme, how can a theme "inject" this directive in the correct place of the HTML?

  • Should blocks support it by default? (configurable in the Editor)


Other questions?

Activity

  1. luisherranz commented on Jun 15, 2023

    @luisherranz
    MemberAuthor
  2. luisherranz commented on Jun 30, 2023

    @luisherranz
    MemberAuthor

    The Astro team is working on an API to do client-side navigation. It has directives for the transitions, so we should take a look and check if some of their ideas are good and could be applied here as well: withastro/roadmap#607

  3. locked and limited conversation to collaborators on Jul 27, 2023
  4. converted this issue into a discussionon Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions