vue-router icon indicating copy to clipboard operation
vue-router copied to clipboard

[Docs] Incomplete Navigation Resolution Flow

Open kirillbunin opened this issue 6 years ago • 13 comments

What problem does this feature solve?

https://github.com/vuejs/vue-router/blob/dev/docs/en/advanced/navigation-guards.md#the-full-navigation-resolution-flow

I think the docs are lacking full flow, not mentioning 'beforeRouteLeave' for example. Would be cool if diagram were to be created, such as used on Vue lifecycle

https://vuejs.org/v2/guide/instance.html#Lifecycle-Diagram

kirillbunin avatar May 04 '18 11:05 kirillbunin

Based on my reading of source code, it appears beforeRouteLeave is the first item in the navigation guard lifecycle. This makes sense to me because the intention, at least in the docs, is to be a hook for preventing users from leaving the page.

https://github.com/vuejs/vue-router/blob/dev/src/history/base.js#L117

trainiac avatar May 09 '18 18:05 trainiac

After looking at the docs again the leave hooks are referenced in the flow but are not using the keyword beforeRouteLeave which actually made me miss it too. This PR changes that but I dont think I'm qualified to make the diagram :).

trainiac avatar May 09 '18 18:05 trainiac

Now that you've said it, it surely does make more sense! Docs are still a little bit more hard to grasp the main ones :D Especially when looked on late at night))

kirillbunin avatar May 09 '18 20:05 kirillbunin

I have attempted to create a lifecycle diagram, but I don't think it is clear enough! Feedback welcome

lifecycle

rigor789 avatar May 31 '18 10:05 rigor789

@posva Hey! Could you give me some feedback on the diagram, I went purely based on the docs - and I do think it can be improved!

rigor789 avatar Jun 01 '18 22:06 rigor789

Sorry I haven't given you feedback on this yet. I'll likely check it in the following weeks/month

posva avatar Jun 22 '18 13:06 posva

@posva no worries, take your time! 👍

rigor789 avatar Jun 22 '18 13:06 rigor789

I'm fairly sure beforeRouteEnter doesn't get called if the component is re-used

719media avatar Jul 17 '18 17:07 719media

beforeRouteLeave also depends on whether the component is re-used.

trainiac avatar Dec 12 '18 02:12 trainiac

does exist any update?(i loved this diagram too much)

annymosse avatar Jul 11 '19 16:07 annymosse

Hey @posva You can give a feedback here?

angeliski avatar Oct 10 '19 17:10 angeliski

@pribilinskiy is called "Open Source Project". When we contribute we do it with extra time that is not billable.

Your comment was unnecesary rude and adds no value to this thread. Consider it next time.

alvarosabu avatar Jul 23 '20 12:07 alvarosabu

My apologies, better will try to contribute instead of criticizing

steven-pribilinskiy avatar Aug 07 '20 16:08 steven-pribilinskiy