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

When should the URL change when using transitionWhile? #232

Closed
jakearchibald opened this issue May 20, 2022 · 2 comments
Closed

When should the URL change when using transitionWhile? #232

jakearchibald opened this issue May 20, 2022 · 2 comments

Comments

@jakearchibald
Copy link

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.

@jakearchibald
Copy link
Author

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

@domenic
Copy link
Collaborator

domenic commented May 23, 2022

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants