angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

Trying to use the new router in 1.4 #330

Open DeborahK opened 9 years ago

DeborahK commented 9 years ago

I tried to incorporate the new 1.4 router into an existing little application and ran into LOTS of issues: 1) When routing to a page that gets data, it issues the get request twice. (Same code with ngRoute works fine.) 2) Using camel case for component names does not work. Seems to try to "dash" the names. movieList becomes movie-list and stops working. 3) Every view must have a controller even if it does not need one. 4) Every component seems to require a new module. (Thought I didn't spend a lot of time on this one.) 5) Route parameters don't seem to work. 6) etc..

Reading the current state of the 1.4 router ... is it worth it for me to research/report each of these items with repro cases? Or is it just not far enough along to bother?

afirdousi commented 9 years ago

Honestly speaking, it is a little too early to move to the new component based router. I had a few trivial example projects(demo projects) where I moved UI Router to the New Component Router but there is a whole lot that needs to be perfected on the new router. I found a lot of edge cases. The API has changed a couple of times and I am not yet sure what exactly will be the final version.

Answering to your point#4: Every component seems to require a new module. This is not required but good to have. Once they bring in lazy loading (which is part of 1.5 wishlist), it will be easy to ship to it.

Having said all this, bringing in a whole new router and make folks move back from ui router to something within angular eco system itself is a GREAT EFFORT from the Angular team. The announcement I believe was a little too early and they might not have expected this response from industry.

As an early adopter, lets hope for the best!

DeborahK commented 9 years ago

Angular 1.4 is currently in "RC" status. To me that means that it is ready to go and just looking for a "final review" before release. As you said, the new router is no where near this status.

Is the new router going to be removed from 1.4 as it was from 1.3?

alvarezmario commented 9 years ago

I don't think so. But its development is clearly stopped. I think they are working on other Angular2 stuff before finishing the Router component. Also I doubt that 1.4 will reach GA before the new router is ready. So, my advice is to be calm and continue using 1.3.

DeborahK commented 9 years ago

I gave a presentation on the new router at the anglebrackets conference last week and giving another two Angular talks next week. So my questions are not for myself, but what to tell the attendees.

I will tell them that it appears work on the 1.4 router has stopped and not to bother trying it yet at this point.

Thanks for your help!

alvarezmario commented 9 years ago

You can also look at #317

DeborahK commented 9 years ago

Yea, I looked at that before I posted. :-)

afirdousi commented 9 years ago

The best way would be to talk about the approach the new router will take and how the new component router approach WILL take you closer to Angular 2.

afirdousi commented 9 years ago

So this came out in today's 1.4 Release:

"There were two features that were pulled out of the 1.4 release. The component helper (#10007) and the component oriented hierarchical router. The main reason for this decision was that both of these deliverables were not ready for the important task of simplifying the migration path from Angular 1 to Angular 2. Rather than delay the 1.4 release further, we decided to move these two deliverables into the 1.5 release."

http://angularjs.blogspot.com/?m=1

DeborahK commented 9 years ago

Thanks for the update!