-
Notifications
You must be signed in to change notification settings - Fork 26
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
Some lower-level navigate options? #113
Comments
I'm not entirely sure on this, but aren't there situations where |
Yeah, it would need to reject if the |
It's important to keep in mind that our goal with app history is not to provide a primitive that allows any possible navigation. It's to provide an API which guides people along a very specific path for building single-page apps. For the I don't think
Similarly, |
Yeah, I'm happy with that. Agreed that the "expose everything" model doesn't work well here. |
I was thinking about a few ways navigations can happen, and maybe we want to expose those as options?
replace
is currently a boolean, but it feels like it needs to be three states. So, how aboutentryPlacement
:"add"
- Creates a new history entry and adds it to the timeline, clearing forward history."replace"
- Creates a new history entry and replaces the current item in the timeline."auto"
- What browsers do now, where it depends on the current URL and the target URL.Also
nextDocument
:"new"
- Forces the creation of a new document for the new history entry."reuse-current"
- Reuses the current document for the new history entry."auto"
- What browsers do now, where it depends on the target URL.And
fragmentScroll
:"prevent"
- will not scroll to fragment."force"
- will scroll to fragment if there's a match."auto"
- will not scroll if the URL is different to the current URL, and the document is reused. Otherwise scrolls.The above would be similar to
pushState
, and it would reject if theurl
is another origin.Creates a new entry with the same URL. This isn't something you can do right now without redirect tricks.
The text was updated successfully, but these errors were encountered: