Closed bcardarella closed 6 years ago
IMO injecting the media service is a bit aggressive, we should stop doing this.
The fact that media is a very common word just make it worse
I tend to agree. It would be easier if I can just opt-in to whichever controller/route/component/view/etc... needs the service rather than it being all
@bcardarella we use blueprints in the newer versions to generate the initializer in the app specifically so that people can choose how they want the service injected.
https://github.com/freshbooks/ember-responsive/blob/master/blueprints/ember-responsive/files/__root__/initializers/responsive.js (should land in app/initializers/responsive.js
if you've run generate
or added the addon since 2.0).
I have considered that our defaults might be excessive, the next breaking version I'll likely include less. Suggestions?
@k-fish I would suggest removing the initializer and updating the README to suggest people inject the service directly into the module they require it
Yeah that's reasonable and was something I had considered. I left it as a generated initializer so existing users and user completely new to Ember had less friction, but I agree it pollutes the app.
3.x is no longer auto-injected. Closing.
Because the media service auto-injects into all components: https://github.com/freshbooks/ember-responsive/blob/master/addon/initializers/responsive.js#L11
ember-cli-meta-tags has an attributeBinding for
media
properties: https://github.com/ronco/ember-cli-meta-tags/blob/master/addon/components/head-tag.js#L18This results in invalid tags being rendered:
and we believe this is resulting in Google not parsing our tags properly
We can just override the initializer but I feel like these addons should place nicely with one another out of the box