-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Issue with loading substates on Canary #14585
Comments
This is the error message that was added in tildeio/route-recognizer#118. /cc @nathanhammond |
For easier discussion, the Router.map(function() {
this.route('posts', { resetNamespace: true }, function(){
this.route('all');
});
this.route('users', { resetNamespace: true }, function(){
this.route('posts', { resetNamespace: true }, function(){
});
});
}); |
@jcope2013 You've created This route map is incorrect because there becomes no way to get to |
@nathanhammond - Maybe we can keep track (i.e. an object with a list of "seen" routes) on Ember's side also so that we can provide a better assertion/error message? |
so this is what I am trying to do I have a posts.show nested under users (goes to users/posts/show) and a posts.all (goes to posts/all) at the top level, I want to keep both the templates under the posts folder and when linking to posts.show, I want to do here it is in 2.9 On canary, since I get the resetNamespace error, I now need to remove the resetNamespace in the inner posts route nested under users so now I can no longer access the show.hbs under the posts folder while still having the route nested under users, I need to move it into posts/users/show.hbs and I need to replace the here is the equivalent changes needed to get it working in canary https://ember-twiddle.com/e786044e2cafeeea95323ab180df515b?openFiles=templates.application.hbs%2C I guess the trick is I was basing my routes off that second wins behavior and am wondering if there is a similar way to do what I was trying to achieve, mainly
|
@jcope2013 Do you agree that you were leveraging I believe what you're looking for to address Item 1 is this: http://emberjs.com/api/classes/Ember.Route.html#property_templateName Item 2 I don't believe is worth trying to solve as it confuses what is going on. |
@nathanhammond addressing 1, templateName would fix the issue of where I could keep the templates in the same location but would cause the route file to now be under routes/users/posts/show.js instead of routes/posts/show.js and the controller to be under controller/users/posts/show.js instead of controller/posts/show.js which I feel is a little bit of a downside since I like having the posts folder have all relevant files instead of sprinkling them around, I know I could do some stuff importing and exporting to get around that if necessary. 2 I could live with changing the link-to to have the fully qualified path name such as users.posts.show but the resetNamespace was sort of nice to shorten it up but could go either way there I previously liked how I could layer resetNamespaces at multiple nested layers and have them all act as top level (both at the link-to/file layer) but if what I was doing was very uncommon then I am not against changing it in my apps, I would be interested to see if any others chime in over the next few weeks once more people test canary/beta once 2.10.0 comes out |
We'll monitor this. I'm pretty strongly of the opinion that combinatorially relying on unspecified and untested implementation details, less-frequently used features, and introducing deliberately broken code paths (what happens in your application when a user directly visits One of the advantages Ember brings is that I can sit down in anybody's project and immediately be productive. Your clever abuse of how Ember resolves modules in combination with how it handles routing subverts that goal except for the most familiar of users. (You could also set up a custom resolver if you wished.) |
it seems there was a change in behavior between 2.9 and canary with loading substates where declaring the same route name twice, one nested under a different route namespace and one at the top level causes an error with the loading substate
2.9.0 loads fine
https://ember-twiddle.com/fbdb07dd1bcc7817f87643b4a8d435fa
Canary (Uncaught Error: You may not add a duplicate route named
posts_loading
)https://ember-twiddle.com/3b08aed8ebc95a5eec495e09ff781274
may be related to #14545
The text was updated successfully, but these errors were encountered: