-
Notifications
You must be signed in to change notification settings - Fork 961
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
would it be possible for createBrowserHistory to also have entries and index? #441
Comments
I haven't checked the code yet, but it seems the key challenge is when you call Then it's just listening to My hope is there isn't some edge case that breaks the predictability of this, and that's why you didn't do it. Let me know. |
This is not possible. The browser maintains its own internal history stack that we have no visibility into. I'd suggest you take some time and experiment with the browser's history object and try to figure out why the browser itself doesn't expose index or entries. It will help you to understand why we can't do that here. |
I have. It's completely doable, minus page-refreshes, where we would lose our mirrored history state while the actual browser remembers it. Is that what you are talking about? |
Yes, that's exactly what I'm talking about. If you can't persist something like |
what are your thoughts on https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigation if it has enough browser support, which it seems, we can record entries in local storage and know whether to re-use them on next visit if |
We've tried using It could perhaps be supplied as an add-on, but would have all the same caveats as that code. |
Those issues (particularly blocking cookies + private mode in safari) certainly mess things up. And I guess you're right--a use at your own risk addon is the only way to professionally make such functionality available. Nice work finding those issues by the way. |
Having consistency with
createMemoryHistory
is very useful and important. I can only assume there is some challenges to addingentries
andindex
tocreateBrowserHistory
. If not, I'd be more than happy to add it--any direction of where to start and potential pitfalls would be much appreciated.The text was updated successfully, but these errors were encountered: