Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Deprecate beforeEnter guard #2540

Copy link
Copy link
Closed
Closed
Copy link
@trainiac

Description

@trainiac
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.