angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

Feature flagged / transparently versioned urls (two states sharing a url based off of a switch) #3769

Closed vort3xxx closed 4 years ago

vort3xxx commented 5 years ago

This is a (check one box):

My version of UI-Router is: 1.0.15

I'm trying to implement a feature flagging strategy in an enterprise application using ui-router so that we can build new versions of route trees while maintaining existing functionality. The desired goal is to use a post-build configuration switch (a feature flag) to flip between the old states (v1) and the new states (v2) dynamically, without requiring the inbound links or URL from having to know about any sort of versioning strategy. There are thousands of inbound deep links to this application spread across multiple external applications, so having to update them to know about any sort of url versioning or flagging strategy is untenable.

We have tried a few implementations with ui-router and found that they generally seem to converge on the router needing to share two states per URL, which creates a pretty good illusion, but falls apart at runtime if the user ever refreshes a view or if a bookmark is used to access a deep link (it will load the first state defined for the url).

We've also tried a series of transition hooks that redirect from a root node, but that also causes inbound deep links to fail because they all get prefixed with a version in the url.

Can we get something added to the router to help support this sort of transparent state sharing behavior driven off of a switch?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues may be reopened.

Thank you for your contributions.