Skip to content
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

feat: removes auto injection of userAgent service #42

Merged
merged 2 commits into from Oct 27, 2021

Conversation

willviles
Copy link
Owner

@willviles willviles commented Aug 19, 2021

Ember v4.0 removes support for implicit injections, as perf emberjs/ember.js#19680. If you were relying on this feature in your code, you should migrate your code base and explicitly inject the userAgent service at the call sites.

If you absolutely must temporarily restore the old behavior, you can include this intializer as app/intializers/user-agent.js:

export function initialize() {
const application = arguments[1] || arguments[0];
application.inject('controller', 'userAgent', 'service:userAgent');
application.inject('component', 'userAgent', 'service:userAgent');
application.inject('route', 'userAgent', 'service:userAgent');
application.inject('view', 'userAgent', 'service:userAgent');
}

Please note, that you will still have to migrate your app to use explicit injections, in order to be able to upgrade to Ember v4.0, so this should only be used as a last-resort temporary band-aid.

Ref: #41 (comment).
Thanks to @buschtoens

README.md Show resolved Hide resolved
Co-authored-by: Jan Buschtöns <jan.buschtoens@clark.de>
@willviles willviles merged commit 43c9c2c into master Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants