question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rearchitect Router so it's more modular

See original GitHub issue

Which @angular/* package(s) are relevant/releated to the feature request?

router

Description

The Angular router’s current architecture is problematic for a couple big reasons:

  • It is not extensible. Developers cannot easily extend or change the Router’s functionality to support features that would be useful to their applications. Instead, these features have to be built in to the core Router code and exposed through some endpoint (i.e. RouteReuseStrategy, some option on ExtraOptions which is used as an switch in the internal code, etc.)
  • It is not tree shakeable. Due to its non-modular nature, almost all features (lazy loading, guards, resolvers) are generally baked in to the Router’s internals unless explicitly configurable through a Strategy that can provide a no-op implementation. Simple applications that do not use these features still incur the bundle size cost.

Proposed solution

Because of the above two problems, we’re often quite limited on what features we can implement. The router should be rearchitected with the following goals in mind:

Alternatives considered

N/A

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:133
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
micrucommented, Dec 3, 2021

Any news on this? Would be really great to have more flexibilty with the router, especially to change the execution order of guards and resolvers as its often nearly impossible use them both in conjucation as it should be

0reactions
atscottcommented, May 4, 2022

@micru It’s on our radar and I’m trying to slowly chip away at some smaller complexities in the router that would make this more difficult to accomplish. Some of these items include #45735, #45240, #45877. Special cases and unpredictability in how the Router internals operate make it harder to expose swappable parts because it’s harder to match the expectations or even know what those are.

There’s no additional information at the moment though. We haven’t started work on taking a deep dive into what APIs we want to make pluggable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rearchitect the Data Center Through Fully Modular Design
For this type of data center, time to market could be more than 20 months. In addition to its long lead time, the...
Read more >
RE: Virtual Router Specific Config - Extreme Networks - 25934
A couple of issues/questions: 1) it seems that it is very difficult to identify virtual router-specific config. For example - if I go...
Read more >
Better Express Routing & Architecture for Node.js
So for this post, I'm going to talk about how to write a more modular, extensible, testable, and scalable implementation of your routing....
Read more >
Pioneering the IP and Optical Transformation - Cisco
Communication service providers (CSPs) are working to balance their need to ... Figure 5 – Routing Line Card Bandwidth Enabled by Optical Pluggable...
Read more >
How to refactor / re-architect the components/state here in ui ...
module ('routerApp', ['ui.router', 'feed']); routerApp.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/login ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found