freshbooks / ember-responsive

Easy responsive layouts with Ember
https://freshbooks.github.io/ember-responsive/
MIT License
40 stars 19 forks source link

Unclear Usage Instructions for Use in Addon #133

Closed kkincade closed 6 years ago

kkincade commented 6 years ago

The README describes how to use ember-responsive within an Ember App's tests. However, I'm writing tests within an Ember Addon I am creating, and I'm a little confused as to what needs to be done. After running ember install ember-responsive the addon/breakpoints.js file is created.

Questions:

  1. With the newer versions of Ember CLI, there is no start-app.js file, yet the README mentions adding an import statement to it. Is the import statement necessary somewhere else?
  2. For integration tests, the README mentions importing setBreakpointForIntegrationTest from your-app-name/tests/helpers/responsive.js. Does that mean the dummy app needs to have that file? If so, shouldn't it be generated when you install ember-responsive?
  3. How do I allow the App consuming the Addon to dictate the breakpoints? I would like the application to be responsible for defining the breakpoints. Is there a way for an addon to fallback to the application's breakpoints.js file?

Thanks in advance for your help! I am a big fan of the addon and it has worked well within the application's I've used it with. This is my first time attempting to use it within an addon.

k-fish commented 6 years ago

Hey @kkincade,

I recently put a PR to fix the readme and just merged it. https://github.com/freshbooks/ember-responsive/pull/131, check to see if that clarifies your testing questions.

The issue of using breakpoints within an addon has come up before, if you specify the breakpoints in app/breakpoints.js, the app breakpoint file should be dictating the breakpoints I believe. https://github.com/freshbooks/ember-responsive/blob/eaf3f2eb144b1f60c0590840198b218b5908b740/addon/services/media.js#L125

kkincade commented 6 years ago

@k-fish thanks for the timely response! The new test instructions worked great. I will test out the addon in my application and make sure everything works as intended, but I think you are correct as my dummy app has a breakpoints.js file and it seems to be using those.

Thanks again for the help!

k-fish commented 6 years ago

No Problem, 👍