-
Notifications
You must be signed in to change notification settings - Fork 12
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
Remove automatic injections #41
Comments
hi! Ping on this. specifically, ember v4.0 will not work with this pattern. |
It is unquestionable, that these implicit injections will have to be removed eventually due to emberjs/ember.js#19680. Thus I recommend that anyone wanting to or currently using this addon, overrides https://github.com/willviles/ember-useragent/blob/master/app/initializers/user-agent.js in their own app with a no-op, like: // app/initializers/user-agent.js
export function initialize() {} This way the implicit injections are already disabled and you can't accidentally make use of them. Please note, that if you're making this change in an app that already uses |
As a way forward for Optionally configuration could be included, to completely disable the injection, which should be recommended to be enabled by all new users. This way the breaking release can be delayed indefinitely, all the while being ready for Ember 4.0. |
I think we already did this for users in ember-source >= 3.26 |
@snewcomer perfect, thanks! I wasn't sure any more and didn't re-read. |
Released in |
ember-useragent/addon/initializers/user-agent.js
Lines 7 to 14 in 32039b6
Initializers and implicit automatic injections are becoming somewhat of an anit-pattern lately. I would recommend to remove them.
I just got bitten by this, because I was tying to inject a service with a different name (
native/user-agent
) asuserAgent
, but gotember-useragent
s service, as it's auto-injected before.The text was updated successfully, but these errors were encountered: