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

The way blockers are called in v.5's replace/push broke our app #867

Closed
BingWangEd opened this issue Apr 26, 2021 · 2 comments
Closed

The way blockers are called in v.5's replace/push broke our app #867

BingWangEd opened this issue Apr 26, 2021 · 2 comments

Comments

@BingWangEd
Copy link

BingWangEd commented Apr 26, 2021

We upgraded to History 5 and we found history.replace was not able to update the history. I dug into the source code and this is what I found.

In v.5, when history.replace is called here, it would check allowTx. If my understanding is correct, allowTx would always return false if there’s any functions push to blockers.

This is a behavioral change from v.4, in which the replace function here would still update history.enries, if the result from blocker function here is not false.

Please correct me if I got anything wrong, but when I commented out any callback we push to blockers via history.block, the app indeed loads as expected. Is this an intentional change? I don't think I found it in documentation or in the undocumented one.

@StringEpsilon
Copy link

StringEpsilon commented Apr 26, 2021

Hi, the gist and github issue you linked are not the official documentation. Just something I compiled.

The change in blocking behavior is alluded to in the 5.0 release notes here

Better history.block API, with support for retrying transitions

and the version 5 documentation here. I've linked that latter one in my gist under the "Blocking transitions" headline, stating that

The entire blocking system has been redesigned from scratch and is therefore completely incompatible.

@BingWangEd
Copy link
Author

I see. Thanks for the quick response! Closing this issue now

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