Closed
Description
What problem does this feature solve?
By deprecating and eventually removing the beforeEnter
route guard, the lib can remove the weight and complexity of the feature. Existing features can do the same or better.
Flaws with beforeEnter
:
- Encourages devs to add code to the router that can't be code split.
- Doesn't work well with universal web applications because it is called on server and client side causing redundant work.
- There is no beforeUpdate so in the case that a route that can be reused (/profile/123/ -> /profile/123/), developers almost always have to share code between the router and the route component to handle the update case.
beforeRouteEnter solves all of these problems.
What does the proposed API look like?
use beforeRouteEnter or other methods instead of beforeEnter