Skip to content
This repository was archived by the owner on Aug 21, 2026. It is now read-only.
This repository was archived by the owner on Aug 21, 2026. It is now read-only.

When should the URL change when using transitionWhile? #232

Closed

Description

@jakearchibald

With MPA:

  1. Begin fetching
  2. Time passes
  3. Fetch complete
  4. Switch to new page - URL changes here

With transitionWhile:

  1. Begin fetching
  2. transitionWhile called - URL changes here
  3. Time passes
  4. Fetch complete
  5. Alter DOM

This means old-page content is being shown between steps 2-5, but with the new URL. This presents issues for relative URLs (including links, images, fetch()), which won't behave as expected.

It feels like URL changing should be deferred until the promise passed to transitionWhile resolves, perhaps with an optional commitURLChange() method to perform the swap sooner.

Activity

  1. jakearchibald commented on May 23, 2022

    @jakearchibald
    Author

    Along with the URL issue, there's also the general issue of the content not matching the URL.

  2. domenic commented on May 23, 2022

    @domenic
    Collaborator

    This is essentially a dupe of #66 . Let me merge it into there.

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