storybook init for ember seems incomplete

Created on 8 Oct 2018  路  14Comments  路  Source: storybookjs/storybook

Bug or support request summary

The result of storybook setup in an ember app seems to differ considerably from that included in this guide

Based on the wording in the quick start guide, the storybook init command is supposed to carry out the steps in the slow start guide automatically.

Missing steps:

  • adding STORYBOOK_NAME={ember_app_name} to .env (or create file if missing)
  • adding storybook to package.json script reads start-storybook -p 6006 rather than "storybook": "start-storybook -p 9001 -c .storybook"
  • No preview-head.html is generated
  • The config file in the ember docs differs to the one generated by story which is better/ correct?

Also note that in carrying out the above steps manually I'm unable to load assets from the ember app via the preview-head file and am not entirely sure what I'm missing but wanted to clear up any issues with basic setup first.

Steps to reproduce

npm install i -g @storybook/cli
cd ~/Projects/my-ember-app
storybook init

Compare diff with instructions in ember guide

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/ember v4.0.0-alpha.24
ember inactive question / support

Most helpful comment

@fran-worley right, I am meeting with @rwjblue to talk about other solutions to build a solution for ember that would be less fragile and more alike to other forms of rendering components without having to bundle the entire application. Will respond here when I have more information about that.

All 14 comments

Let's wait for @gabrielcsapo =)

@fran-worley the doc is here https://github.com/storybooks/storybook/blob/master/docs/src/pages/basics/guide-ember/index.md and it does document what is necessary to get it started.

@shilman would be able to release the latest docs?

@gabrielcsapo the main part of my query was why changes made by storybook init differ so much from the docs or am I misunderstanding the purpose of storybook init?

@fran-worley I think a lot of the stuff in the quick-start is on a project basis. For examples the preview-head.html file could be automatically generated, but for some projects it is a little bit more involved, do you have ideas on what should be in init? I used the basic ember-cli new case as a starting point for discussion, I think a lot more could be added to help onboard people to storybook from any ember project they are working on.

@gabrielcsapo a good start would be to align all the other points I have identified as they are pretty easy to achieve. Either the readme has steps that are unnecessary and should be removed to avoid confusion, or init should replicate it.

I think generating a preview_head.html would be sensible but I agree the actual content varies project to project. I wonder if we could find a way to generate the meta tags in the same way that ember does {{content-for 'head'}}. My other issue with the current setup is that it's quite brittle for development as addons or env vars/ config can change the ember-app head content which would not be reflected in storybook without manually reworking the preview head.

@fran-worley right, I am meeting with @rwjblue to talk about other solutions to build a solution for ember that would be less fragile and more alike to other forms of rendering components without having to bundle the entire application. Will respond here when I have more information about that.

I think having a brocolli funnel for ember called ember-storybook would aid in creating the preview-head in real time, let me start working on that and in the meantime I will start updating the code here to be less brittle.

@rwjblue were talking about this in our meeting so let me see what I can get working today

@fran-worley if you are interested in opening issues against this https://github.com/gabrielcsapo/ember-storybook I can start working on getting them integrated

@fran-worley open PR for this is happening https://github.com/storybooks/storybook/pull/4335 to clean up ember support and streamline it

@gabrielcsapo 馃憤 Looks like #4335 solves my issue with rendering assets in the preview_head! Hadn't appreciated the -s option in the storybook cli!

I'll give this another go and report back. I'll keep an eye on gabrielcsapo/ember-storybook and raise any further issues there.

will close this and any subsequent issues we can triage independently thank you for the feedback @fran-worley!

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oriSomething picture oriSomething  路  3Comments

purplecones picture purplecones  路  3Comments

xogeny picture xogeny  路  3Comments

tirli picture tirli  路  3Comments

arunoda picture arunoda  路  3Comments