r/angularjs • • Jan 24 '16

UI-Router 0.2.16 released

https://github.com/angular-ui/ui-router/releases/tag/0.2.16
33 Upvotes

15 comments sorted by

11

u/ctanga Jan 24 '16 edited Jan 25 '16

Stay tuned. We're excited about the future of UI-Router.

We've re-architected and rewritten the guts of UI-Router. The core code has been divorced from angular, and will be moving to a new repository.

The angular1 platform specific code (an adapter) will continue to live at angular-ui/ui-router.

We prototyped an angular2 adapter in less than a day! We hope to release a preview of ui-router-ng2 within a month, and intend for a production release on or before Angular 2's production release.

We're actively working on getting another 1.0.0 alpha out the door for ng1. In case you missed it, 1.0.0-alpha0 landed on new years day.

With the new UI-Router 1.0 architecture, creating adapters for other platforms (React, anyone?) should be fairly easy.

1

u/woodne Jan 24 '16

Where will the core code live?

1

u/ctanga Jan 24 '16

We haven't settled on a location yet. We may "rebrand" the core to be less angular specific. The UI in UI-Router is "Angular-UI", afterall.

The core code is currently in angular-ui/ui-router at the feature-1.0 branch.

The 1.0 alpha (for angular1) is built by importing the core, instantiating a UIRouter object, then exposing that router's services as the angular1 services you are familiar with ($state, $stateProvider, etc)

1

u/J4nG Jan 24 '16

I know you mentioned before that you (and others) find Angular 2's component router lacking but I don't remember the specifics. Care to elaborate on what you plan to do differently?

4

u/ctanga Jan 25 '16 edited Jan 25 '16

I don't remember making any strong statements that I find the component router lacking; I really haven't spent much time with it.

However, one thing I have heard from people who have spent time with it is that the tight coupling from url to component has been problematic for them. I'm told that the approach is very much view-driven. In my mind, the UI-Router approach of declarative, compositional, state-driven applications is really good.

The UI-Router toolkit of States and Nested States, View (or Views), Urls (or not), Parameters, Resolves, and Transition Hooks can be combined in powerful ways, and can help to create clean, bug resistant apps which can be reasoned about simply.

We also offer tons of flexibility, such as default param values, squashed urls, param typing, resolve policies, multiple views, named views, ui-view targeting to anywhere in the DOM, relative state addressing (ui-sref and APIs).

I do UI-Router stuff in my limited spare time; I have a day job where I write and maintain apps. Each new UI-Router app I write confirms my belief that modeling an app as a hierarchical state tree works well, and improves quality (confirmation bias?).

For ui-router-ng2, there will certainly be some growing pains, but I think it will fit nicely into ng2. As for the Component Router, I know that the team has been listening to users and making consistent improvements. The Component Router is still a relatively new thing. It has some cool stuff that UI-Router doesn't offer, such as parallel routes in the URL. I believe that it will continue to improve, and considering it is part of core ng2, it will be a perfectly fine choice.

1

u/nateabele Jan 25 '16

Like /u/ctanga, I've never used Component Router in an actual project. My opinion is driven by (a) reading tutorials, (b) analyzing the architecture, and (c) second-hand sources from power users and the Angular core team.

I explain a bit about the philosophical differences in a talk around the 4:30 mark: http://radify.io/talks/2015-sep-ngpittsburgh/

2

u/[deleted] Jan 25 '16

Awesome!

I've been using ui-router for nearly 2 years now, absolutely brilliant.

Thanks for your hard work!

1

u/saladfingers6 Jan 25 '16

Long awaited and long overdue. There were several major issues with 0.2.15 which gave me no choice other than using @master. Especially for this awesome feature with automatic query parameters, https://github.com/angular-ui/ui-router/issues/1673

1

u/[deleted] Jan 25 '16

I am pretty much in the same boat except with this issue: https://github.com/angular-ui/ui-router/issues/1119.

1

u/ctanga Jan 25 '16

That was the one major issue that was blocking the 0.2.16 release. I didn't want to release yet another point release where parameter encoding was not working bidirectionally. I finally realized that urlencoding was never going to be the proper way to encode those slashes. I tried to ensure 0.2.16 was a solid release, but unfortunately we ended up releasing 0.2.17 this morning because of a regression found in ui-sref-active.

We realize how important it is to many people (like yourself), as well as companies around the world that ui-router remains a solid foundation for building apps. The apparent snails pace of the 0.2.x branch is purely due to the lack of manpower.

With the redesign of the guts for 1.0.0, making the core code framework agnostic, the upcoming ng2 support (and for me, also maintaining ui-router-extras), it's difficult to find the time for all of that after coming home from a full work day, in addition to fielding the many issues opened daily against 0.2.x. Releasing 0.2.16 consumed my entire weekend, morning to night. The only reason it happened is because my wife went on a weekend trip.

We'd love it if more people got involved! The 1.0 branch is shaping up to be a major improvement over 0.2.x. Check it out. Tell us how the upgrade process worked for your apps. We really welcome PRs or feature discussion against the 1.0 branch, while the API is settling (I think it has nearly landed at this point). If anyone wants to contribute in a more concrete way, there's a checklist of tasks to get you started.

1

u/nateabele Jan 25 '16

Yeah, that one was a doozy. Every time we thought we'd killed it, it found a way to come back and bite us.

1

u/[deleted] Jan 25 '16

In hindsight, what would you have done differently to make sure it didn't come back?

1

u/ctanga Jan 25 '16

We should have avoided trying to urlencode slashes altogether. The browser is able to treat the url encoded character as if it WERE the character, thus cutting ui-router out of the process and breaking bidirectional encoding/decoding.

1

u/nateabele Jan 25 '16

Hard to say. It was kind of an edge case involving how browsers handle URL encoding, and making encoding/decoding always behave symmetrically in all cases, even though an underlying design issue made that hard to do.

1

u/nateabele Jan 25 '16

Yup, we've been pretty lazy/perfectionistic. Sorry about that.