-
-
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
[BUGFIX beta] deprecate this.resource() in Router.map() #11517
[BUGFIX beta] deprecate this.resource() in Router.map() #11517
Conversation
I assume the prod build failed because of deprecation stripping in env=prod.
https://travis-ci.org/emberjs/ember.js/jobs/67565607 |
…te('name', { resetNamespace: true }) instead
b873fa0
to
78c22ee
Compare
All green. |
I'm just curious, what's the reason for this? If |
@workmanw core team has their own rationale I'm sure, but IMO it's always been a huge confusion point for new-comers. Like, almost unanimously everyone is confused when I see them learning ember. Since you can nest The original intent was to have a concept of a resource mapping effectively for things that are models (hence the name) but it just made things more confusing and inconsistently used and abused. |
Gotcha. I hadn't really heard anything about this change and I was curious if there was some other plan for I often see changes like this and am always curious about the rationale. Not questioning it. Just trying to better understand the motivation for the change. |
@workmanw this particular case was definitely more informally discussed on IRC/slack/discuss.emberjs.com/etc. It's possible the core team has collectively not agreed to move forward on this, I just happened to be refactoring code and had the cycles to PR. |
I am in favor of this PR, but there are a few things that will still be needed:
I'll confirm with others, but I believe that this is exactly the direction we have been intending to go... |
@rwjblue happy to do both once someone confirms this/they will be merged. Thanks! |
I'm wondering if somehow, while the Router.map is being discussed, I can sneak in and ask for an opinion on #11308 ... Might be something for another time - needing more discussion etc - but if not then might be a good time to get two changes in at once or combine it into one PR or something? Given that resource is to be removed it might mean the idea behind my PR should be implemented differently |
@jmurphyau IMO definitely a different discussion, although I do like the idea of your PR at first glance! |
👍 sweet - sounds good.. Had no activity on it since I opened it and seen this PR as a chance to steal some attention ;) BTW +1 to route/resource being a pain point.. It was for me.. A |
…r options for this.route()
b1587c9
to
b6d70b0
Compare
Can someone kick saucelabs for me? I believe this |
kicked |
[BUGFIX beta] deprecate this.resource() in Router.map()
Thanks @jayphelps! |
As a follow up, could we have an ember-watson task for this? |
@tim-evans - Seems good to me, would you mind making an issue over in ember-watson repo explaining what needs to be done? |
The use of `resource` within the router is deprecated as of 2.0.0. See notice [here](emberjs/ember.js#11517). This uses ember-watson to do the manual conversion, with small aesthetic tweaks.
The use of `resource` within the router is deprecated as of 2.0.0. See notice [here](emberjs/ember.js#11517). This uses ember-watson to do the manual conversion, with small aesthetic tweaks.
Use
this.route('name', { resetNamespace: true })
instead.This has been talked about for months, but hadn't seen a PR so figured 2.0 beta it was time.
Back in March,
this.resource
was removed from the guides and released as 1.11.0.this.resource()
resetNamespace
resetNamespace
Documents resetNamespace: true guides#373