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

Add a category feature to Storybook. #458

Closed
arunoda opened this issue Sep 15, 2016 · 13 comments
Closed

Add a category feature to Storybook. #458

arunoda opened this issue Sep 15, 2016 · 13 comments

Comments

@arunoda
Copy link
Member

arunoda commented Sep 15, 2016

No description provided.

@kevinSuttle
Copy link
Contributor

What are you thinking this could be used for? I'm interested.

@arunoda
Copy link
Member Author

arunoda commented Sep 29, 2016

It's about organizing a pretty large storybook. Now we are thinking about moving this into tags.

We can tag stories. Then we can filter them our focus on a set of tags at a moment.

@jbovenschen
Copy link
Member

We need this also, we do have a internal storybook with around 200 different stories of different "packages", I like the idea of tagging stories so you can have some overlap between them.

@siddharthlatest
Copy link

Is this on the roadmap?

@ndelangen ndelangen added this to the v3.1.0 milestone Apr 2, 2017
@ndelangen
Copy link
Member

@jbovenschen I'd love to hear about your idea's how your large library could be improved.

Technically, I think what would be interesting is to allow addons to provide custom UI, in this department. that way, people can create or choose a story-navigator that suits their project.

@jbovenschen
Copy link
Member

The structure of our repo is as follows;

It's a mono-repo build using lerna, so we have around 30 packages, with all of their own primitives and stories.

Those packages could have both bindings to react-dom and react-native.
The biggest hickup was that we could not define the packages to target within the running storybook.

This could be solved with some kind of glob you could pass to the start-storybook command.
$ start-storybook --filter ./packages/(ui-grid|ui-flex)/*.stories.js or something.

Another issue is when trying to run all the storybook packages at once, this will be super heavy for a clean webpack run, because you would not change most of the packages, could possibly be solved by using dll's within webpack, dll's would also be nice for the core packages and plugins used by storybook because you would definitely not change them when building ui-components.

Improving the ui could be done with the earlier idea of tag's where you could define the used packages per story.

Hope this helps to give you any idea.

@usulpro
Copy link
Member

usulpro commented Apr 3, 2017

Looks like tags is something that could be implementing via addons like storybook-chapters + custom ui addons, but we need to provide better API for that.

@shilman
Copy link
Member

shilman commented Apr 3, 2017

@jbovenschen FYI you can control the loader like this in .storybook/config.js:

  const regex = process.env.YOUR_VAR ? /(ui-grid|ui-flex)/*\.stories.js/ : ...
  const context = require.context('../packages', true, regex)
  context.keys().map(context)

I'm sure there are good reasons to build this into storybook, but just wanted to let you know that it should be easy to get something working on the current version.

@ndelangen
Copy link
Member

Improving webpack performance using:

Another issue is when trying to run all the storybook packages at once, this will be super heavy for a clean webpack run, because you would not change most of the packages, could possibly be solved by using dll's within webpack, dll's would also be nice for the core packages and plugins used by storybook because you would definitely not change them when building ui-components.

IS something I have in mind doing.
Maybe someone would like to do a POC for that. After webpack 2 release is working well.

@ndelangen
Copy link
Member

ndelangen commented Apr 3, 2017

I'm not sure what you mean by:

The biggest hickup was that we could not define the packages to target within the running storybook.

Do you mean you want to control which versions of react storybook uses?

@jbovenschen
Copy link
Member

Improving webpack performance using:

Currently I don't have much time to work on another project, besides other stuff. But if nobody takes it maybe I will in the future.

The biggest hickup was that we could not define the packages to target within the running storybook.

I meant to say that there is no "Build in method" to filter stories, so we use a method like @shilman describes.

Maybe something we could add to the docs?

@ndelangen
Copy link
Member

Yes, we should add this to the docs, and have a demo-setup using it!
I created an issue for this: #746

@ndelangen
Copy link
Member

#1356 #1387 #1401 #1427 #151
About to get released in 3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants