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
Route vs Resource and the resetNamespace option #11251
Comments
Thanks for asking! I personally consider it a private API at the moment, but am not opposed to making it public if folks see a need for it longer term. I am not sure that preventing a refactor to a nested layout justifies supporting both concepts long term (seems to me that the point of all deprecations is refactoring to a better pattern), but I definitely agree that we should formally decide so folks know what to do going forward. |
I am pretty strongly in favor of having a way to reset namespaces. A big app can get really gnarly without it (pods dirs 4 or 5 layers deep). |
An example: https://github.com/aptible/dashboard.aptible.com/blob/master/app/router.js#L13 I did not realize we currently have no public API for resetting namespace. |
Technically, |
I think this issue can be closed. The option |
Thanks @diogomafra! |
@diogomafra That's a dead link, the current version is here. I do think that this should be documented somewhere more user-friendly than a source file, though. I expected to see it in the Ember guide, for example. |
Linking to a blob like Here: this points to a commit on master (today): https://github.com/emberjs/ember.js/blob/d3ceb22/packages/ember-routing/lib/system/router.js#L1168 |
Since 1.11.0,
this.resource
has been deprecated in favour of nestedthis.route
. However, the difference in namespacing behaviour requires a large refactor involving moving route and template files and folders around and changing many references inlink-to
andtransitionTo
calls. In addition to requiring a refactor, it also breaks the analogy between the model tree and the route/template tree.Passing
{ resetNamespace: true }
as an option tothis.route
results in the namespacing behaviour of a resource. This has been proposed as an easy way to remove the deprecatedthis.resource
usage from applications. (See Erik Bryn's Ember 2.0 Talk at 11:10 and this StackOverflow Answer)However,
resetNamespace
is not a documented public API and if I understand the code correctly, it is merely a flag for the router to differentiate betweenthis.route
andthis.resource
. Therefore, it would stand to reason that whenthis.resource
is removed,resetNamespace
will be removed with it.An official statement regarding this may save the community a lot of unexpected grief as users follow the stability without stagnation plan.
The text was updated successfully, but these errors were encountered: