-
Notifications
You must be signed in to change notification settings - Fork 3k
Question for AngularJS Core Team #7
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
Comments
1/ it's not just about nested routes, it's about nested and concurrent views. we need a better way to serialize the current (complex) view state in the url and deserialize it when the url is changed or page is reloaded. we also need to be able to generate these urls so that they don't have to be handcrafted in templates. All of the current features like deeplinking, pushState + legacy browser fallback, cmd-click opens a new tab, etc 2/ to get this right, this should be a green field project without worrying about backwards compatibility 3/ the original proposal in 3.1. looks too simplistic, while I don't have first hand experience with embers routing from what I read it looks worthy looking at as it solves some of the problems described above. 3.3. is serverside and thus mostly irrelevant have you looked at https://github.com/yaptv/StateTree it looks promising |
Embers syntax (as I know it) is somewhat like:
To me, that is quite similar to the syntax in 3.1 except that it encapsulates a hole lot of other "fields" into each individual route, but I see that as an non-issue as they are passed through gracefully, so in order to bring it to a "state based" pattern we would just need some other fields instead of the controller and template. Right now I don't see any advantages of having named routes (articles, index, list) as above over just defining the actual route ('/admin/articles', '/', '/list'). That would bring us to a syntax as:
So the syntax could encapsulate the same set of information to me, unless there is something I am missing in the way Ember work?... The only less simple structure is a Graph, will we have the need for that? Anyways... I would still like to keep the principal of keeping the knowledge of the "left hand" object out of the router, so the "subroutes" parameter actually bothers me just a little, just not enough at the moment... Instead I would like the router to be able to just give as rich as possible information about what changed in the URL... And the above for now should be all about augmenting the input in a way that we can define the granularity of the "change-information" we receive. This could then be handed to either a Controller where the developer was free to do with it what he wanted, or he could include a custom directive/set of directives which was a simple "first" implementation, or finally a state machine (loaded or defined by a directive??), that would then activate/call handlers, connect viewports, load templates etc. Basically what I would like to see is a router that only cares about routes, and leave the other part of the implementation to whatever comes after the router. This would separate responsibility in a more healthy way in my mind. To do that the right way, template handling would have to go from the current RouteProvider, but other than that, it is properly not that far of. I don't see the need for a grand new design on that part. What would your thoughts be on that as an idea of separating concerns? |
@IgorMinar Thanks a lot for the feedback, that's definitely helpful. Basing the routing engine on a state machine was definitely the direction we were thinking.
I brought this up as a structure/syntax example, as it solves many nesting problems that the proposed implementations don't. Anyway, thanks again for the feedback. |
I've looked at StateTree and Stativus. I'm currently experimenting with Stativus. I think the differences are probably a matter of preference but StateTree is clearly focused on a subset of the problem:
I think that the Angular way here will be to create providers that work together to solve this problem but still allow some flexibility and replacement. Comparing StateTree to other systems has helped me identify the following component roles:
I'll also add some obvious observations:
I'll be experimenting with this over the next week. I have project deadlines that are wreaking havoc with the time I'd like to spend on this but the ad hoc approach I hope to replace is increasingly fragile. Michael |
Thanks @IgorMinar I'm going to go ahead and close this issue as I don't think the core team has the time to keep an ongoing dialogue, but we were able to address what I felt to be the pressing concerns and was even provided a good starting point. @gregwebs you are more than encouraged to join the team too and help us figure out where to go from here. I am going to step down from the leadership role other than to in an advisory capacity. I encourage everyone to take liberties but above all else try to work in a democratic capacity. I have spoken with @nateabele about helping to ensure the project retains a forward momentum as I respect his work both on CakePHP and Lithium but again all projects on AngularUI are wholly democratic so this is a guidance capacity. Please refrain from any further comments on this thread |
We are initially planning on building a third-party solution, but we want to design it with the intention of eventually becoming a PR that you guys would look forward to merging into the core. I'd appreciate your input so that we can make this as mergable as possible.
The text was updated successfully, but these errors were encountered: