Skip to content

Angular 1.4 router and ui-router future #1759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pocesar opened this issue Feb 18, 2015 · 31 comments
Closed

Angular 1.4 router and ui-router future #1759

pocesar opened this issue Feb 18, 2015 · 31 comments
Assignees

Comments

@pocesar
Copy link

pocesar commented Feb 18, 2015

Just to make sure, the new router on Angular 1.4 (and I think it will be around for 2.x too, not sure) share some concepts from ui-router but from a different angle, will ui-router keep going as a parallel along with the almost-same-funcionality-besides-states with the new official router? Or plans to push a merge of concepts and technology to the official router?

@akholodenko
Copy link

And to add on, will Angular 1.4 have any breaking updates to the current stable build of UI Router?

@btford
Copy link

btford commented Feb 25, 2015

I think it will be around for 2.x too

yup

I'm responsible for the new router in angular core. I've been getting similar questions, so I thought I'd join in on the discussion.

I can't speak for this project, but anyone interesting in guiding the new router is welcome. I'd be grateful to have @nateabele and co's help. Because routing sits at the top of your app, it's probably the most important part of migration. For apps that want to go Angular 1.x to Angular 2, the new router has features that will smooth this transition. I'd like to work together to make it possible to either adapt route configs for ui-router to work with the new angular router, or make it easy to slowly route-by-route transition from ui-router to the new angular router.

I do not maintain a large angular app written with ui-router, so I'm hoping to have feedback from developers interested in this. But I'm open to supporting this effort however I can. :)

@gmoothart
Copy link

My team maintains an angular app with ui-router, and we're looking at transitioning to the new router. I'd be happy to help.

@amcdnl
Copy link
Contributor

amcdnl commented Mar 6, 2015

@btford We have a large app using ui-router with lots of nested routes and even using lazy-loading. Would love to chat more about how to transition.

@nateabele
Copy link
Contributor

Hi everybody, I'm finally getting un-buried from travel and moving. So, here's the deal. We're in the final planning stages of throwing everything we've been working on over the past few months into a 1.0 release, which will expand significantly on the current feature set of UI-Router. This release will introduce several new APIs and, while we're not breaking anything, several current APIs will eventually be deprecated.

So, all that leads to the obvious question: what do you do with your app?

I think it comes down to one thing: does your app's architecture (or your brain) fit better within a state-machine paradigm or not?

Both answers to that question are equally valid. If you answered yes, get ready for the best UI Router yet. If not, then @btford and I look forward to your help in developing a transition plan to New Router. From what I've seen so far, I don't think it'll be terribly difficult. Thanks everyone for your interest.

@joshikeerti
Copy link

I have an app using ui-router and has some complex nesting and routing. However, I am going to start on a new app and I am wondering if I should use the new router or the ui-router.
Initially we started using ui-router because it handled a lot of the cases the default router did not handle. Will the new router be comparable to the ui-router in terms of features going forward?

@amcdnl
Copy link
Contributor

amcdnl commented Mar 6, 2015

@nateabele they announced @ ngconf that the new router will help facilitate in the migration to Angular 2.0. How do you see ui-router playing a role in that w/ the 1.0 release?

Also, in Angular 1.5 lazy loading is coming out of the box, is this on the timeline for ui-router? I know there is a third-party module but just curious if you see that coming to the core.

@nateabele
Copy link
Contributor

@joshikeerti It's really going to depend on your app. The main use cases that UI Router was designed around were nested & parallel views and routes, which New Router handles perfectly.

@amcdnl Those plans are still in motion so it's hard give an exact answer. For now, suffice it to say that, while the original reasons UI Router came into being are mostly obviated by New Router, it has evolved to a place where I still feel that it fills an important gap in terms of the design of complex application architectures. Having said that, my goal is to build off of the advances of 2.0 in general and 2.0 Router in particular as harmoniously as possible.

Also, in Angular 1.5 lazy loading is coming out of the box, is this on the timeline for ui-router? I know there is a third-party module but just curious if you see that coming to the core.

Yes. More on that soon.

@futurechan
Copy link

👍

@demisx
Copy link

demisx commented Apr 14, 2015

I truly hope both routers can co-exist in parallel. I have a feeling we'll stick around with the UI router for as long as we can.

@georgebarbarosie
Copy link

I've been going through the ngNewRouter docs and discussions, and I'm wondering if the following deduction i've made is correct: ui-router's 'resolve' mechanism is not available with ngNewRouter, so app developers would have to move resolution logic into the component's canActivate hooks to resolve promises before route activation?

@evillemez
Copy link

I made a similar comment in an angular/router issue, but maybe it's best made here. One of the key features for our team is routing that is independent of browser urls. We have a large-ish app that runs in a browser, or desktop client, and does not use URLs for routing anywhere. We used ui-router primarily for this reason. It's a realtime websocket app, and every new connection goes through several auth and security procedures before anything of interest is shown. Once they're past that, the app restores the user to their previous state, which we store server side.

Anyway, point is... To me, browser urls are a side feature, even though for most apps it's the primary use case. You always need to transition the app by activating and deactivating components, and passing along arguments. In most of those cases you'll get the arguments from the URL, and there will be a path associated with the state you're going to. But, like in our case, not always.

So... for my team the key question in any migration to Angular 2 is, how do I build an app that doesn't require paths for routing? Right now the new Angular router does, but there may be plans to support it down the road, but I can't really tell. The issue is tagged for a future release, but I haven't really come across any discussion of potential apis, so I dunno if it's a major priority or not. If anyone is interested, the relevant discussion is here:

angular/router#121

This is one of those cases though where I wonder if it's just not what the new router is for, and maybe cases like this is where ui-router will continue to be used. But if so... what does the ui-router-based angular 2 upgrade path look like in theory?

@nateabele nateabele self-assigned this Jun 14, 2015
@christopherthielen
Copy link
Contributor

We plan to make ui router work with angular 2, but there is nothing concrete yet. Once 1.0 matures, we will put more thought into what that will look like. Our longer term goal is that ui router be agnostic to the framework it's running in (angular1, angular2, react?)

That said, I suspect as new router evolves it will start addressing some of the "corner" use cases that ui router handles.

@christopherthielen
Copy link
Contributor

UI-Router 1.0 preview is available: https://github.com/angular-ui/ui-router/tree/feature-1.0

@amcdnl
Copy link
Contributor

amcdnl commented Jun 26, 2015

@christopherthielen I'd love to see future-state integration out of the box. ;)

@christopherthielen
Copy link
Contributor

@amcdnl me too!

@balteo
Copy link

balteo commented Aug 6, 2015

Hi all,
Any planned release date for UI router 1.0?
Regards,

@fxck
Copy link

fxck commented Aug 12, 2015

Can I read more about the 1.0 somewhere? Or that readme is all there is?

cc @nateabele @christopherthielen

@nateabele
Copy link
Contributor

@bopm
Copy link

bopm commented Dec 16, 2015

Ok, Angular 2 beta is here. What's new about ui-router usage with ui-router?

@christopherthielen
Copy link
Contributor

I've begun work on UI-Router 1.0 + ng2

http://plnkr.co/edit/PF69BVa1WnUYZKkURgMm

@bopm
Copy link

bopm commented Jan 12, 2016

👍

@demisx
Copy link

demisx commented Jan 12, 2016

👍 Yea-a-a-a-h!!!

@asaarnak
Copy link

Great, ui-router rocks! I hope to use future states.

@Namek
Copy link

Namek commented Feb 3, 2016

@christopherthielen If there's anything I could add, please don't make the same mistakes as done in default A2 Router. I'm referring you to angular/angular#5875 and angular/angular#6634 Mostly it's about creating/destroying components and passing input/output. Using a router shouldn't lead to much changes in component code when we decide to transform it to a route component. I agree with angular/router#121 too.

@evillemez
Copy link

Here here, a component is a component regardless of whether or not it's activated by a route. At least, it would be nice if that were the case.

@christopherthielen
Copy link
Contributor

We have a ui-view (like router-outlet), which can be filled with any component based on activated state.

How would you want inputs/outputs to work?

@nateabele
Copy link
Contributor

Yeah, I still don't 100% understand how those (@Input and @Output, specifically) would apply, but yes, we're definitely committed to UI Router's current goals of enabling declarative, high-level design.

@cburgdorf
Copy link

@christopherthielen can I look into the code for the ui-router for Angular 2 work in progress somewhere?

@christopherthielen
Copy link
Contributor

@cburgdorf

Unfortunately, there are a few blockers to checking in the ng2 code. I need to first split the 1.0 code into core code (in a separate repository) and ng1 code. I'd like ui-router 1.0.0-alpha.1 to be built/released off this split repository setup, then commit the initial ng2 repository. (See my checklist on #2223).

I've updated the plunker a few times. It has working uiSref and uiView. If you really can't wait, you can check out the transpiled modules starting at line 3725

@christopherthielen
Copy link
Contributor

For those watching this issue: Initial ng2 support was released in alpha.3: https://github.com/angular-ui/ui-router/releases/tag/1.0.0-alpha.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests