[CLEANUP beta] Deprecate owner.inject#19680
Conversation
a11ae84 to
bd3db85
Compare
fbbd92b to
2a2ea04
Compare
|
@snewcomer can the cleanup/removal of the old API land in its own PR with |
|
@mixonic So this timeline took me a bit to grep but is laid out in this RFC .
Sry if the above was rehashing something you already know. But the deprecation + removal of the supporting infrastructure for @pzuraq noted we could assert as well. I think that was only if we didn't wrap up the work that is in this PR in time. |
| this.component = CoreOutlet.create(); | ||
| let outletTemplateFactory = this.owner.lookup('template:-outlet'); | ||
| let environment = this.owner.lookup('-environment:main'); | ||
| this.component = CoreOutlet.create({ environment, template: outletTemplateFactory }); |
There was a problem hiding this comment.
☝️ this is important to note. This was refactored from the implicit injection.
There was a problem hiding this comment.
I believe this needs to be ported to @ember/test-helpers https://github.com/emberjs/ember-test-helpers/blob/9219247259ef6b4d8a339ca71a1374e2ffe69603/addon-test-support/%40ember/test-helpers/setup-rendering-context.ts#L266
There was a problem hiding this comment.
There was a problem hiding this comment.
landed and released as @ember/test-helpers@2.4.2
6a75dd5 to
e22a8fa
Compare
pzuraq
left a comment
There was a problem hiding this comment.
So I believe that _lazyInjections can also be removed as part of this work. As far as I can tell, it's basically creating and setting up lazy versions of implicit injections, only in DEBUG, and I can't see any usage in the ecosystem at all: https://emberobserver.com/code-search?codeQuery=_lazyInjections
It's explicitly marked as a private API as well, so should be fine to remove. Overall this PR looks amazing and once those changes are made, I think we're good to merge!
| assertResources('/b', ['/b', '/c']), | ||
| assertResources('/c', ['/c']), | ||
| assertResources('/d', ['/d', '/e']), | ||
| assertResources('/e', ['/e']), |
There was a problem hiding this comment.
I don't think the intention here was parallel. So I made it serial. This was also due to the fact that creating a singleton service per app instance that tracked "network" requests in each route was proving difficult when they happen in parallel. Lmk if anybody has any comments here.
| '_injections', | ||
| '_internalReset', | ||
| '_invoke', | ||
| '_lazyInjections', |
There was a problem hiding this comment.
I checked out lazyInjections and it looks like it is used to validate service injections and not implicit.
|
@snewcomer I don't understand the statement:
Deprecated functionality is not removed, it is merely warned against in development builds. Do you mean "if a user were to use an explicit injection as suggested by the deprecation message, then any edit: Ok, I see what you're going for. |
| { | ||
| id: 'remove-owner-inject', | ||
| until: '5.0.0', | ||
| url: 'https://deprecations.emberjs.com/v3.x#toc_implicit-injections', |
There was a problem hiding this comment.
There was a problem hiding this comment.
If you can update the link here to point to the correct 4.x deprecation page we can land this PR independent of ember-learn/deprecation-app#932, IMO
mixonic
left a comment
There was a problem hiding this comment.
Awesome stuff here @snewcomer !
6ed912e to
cfad78f
Compare
|
Force pushed a single commit for a clean history, letting CI run. |
|
I believe this currently incompatible with This broke embroider's canary tests: embroider-build/embroider#932 @mixonic My work on embroider has been nontrivially impact due to Anyways, adding at-least |
|
@stefanpenner I would be happy to add this. I love adding this type of regression testing! |
ember-canary requires `template` + `environment` be provided to the view. This seems like a reasonable change, but does require “low level” libraries such as `@ember/test-helpers` to make some changes. (Ember PR emberjs/ember.js#19680)
|
@snewcomer awesome. At the very-least, I think ember could get lots of milage out of smoke testing |
|
proposed fix for |
|
@snewcomer also, if you have cycles a small inline comment in ember.js, specifically around #19680 (comment) to inform authors that changes need to be made in parallel with Ultimately, having ember provide a "public api" for test-helpers to tap into here could prove to be the best long-term solution. But may not be the most pragmatic choice right now. |
description of problem: emberjs/ember.js#19680 (comment) fix in @ember/test-helpers: emberjs/ember-test-helpers#1110
|
Fix for my above issue landed as @ember/test-helpers@2.4.2 |
* [fixes #932] fix ember-canary test scenario description of problem: emberjs/ember.js#19680 (comment) fix in @ember/test-helpers: emberjs/ember-test-helpers#1110 * [fixes ember-canary/ember-beta] migrate ember-cli-template-lint -> ember-template-lint Ember-cli-template-lint is deprecated, and now incompatible with ember 4.x
|
@stefanpenner This PR to smoke test ember-test-helpers, ember-string and ember-legacy-built-in-components is passing now! Would appreciate a review if you have some time. |

RFC: emberjs/rfcs#680
See https://github.com/emberjs/rfcs/blob/sn/owner-inject-deprecation/text/0680-implicit-injection-deprecation.md#1-deprecate-implicit-injection-on-target-object for the reasons why we first added the initial deprecation in
3.26.0and are now adding another deprecation but removing the functionality ofapp.inject.injectionref #19617