-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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 Storybook to the user guide #738
Conversation
Congrats @arunoda! It's awesome to see |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems there's a missing link in the doc
* Screencast: [Getting Started with React Storybook](https://egghead.io/lessons/react-getting-started-with-react-storybook) | ||
* [GitHub Repo](https://github.com/kadirahq/react-storybook) | ||
* [Documentation](https://getstorybook.io/docs) | ||
* Snapshot Testing with React Storybook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing link ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah.
@@ -41,6 +41,7 @@ You can find the most recent version of this guide [here](https://github.com/fac | |||
- [Continuous Integration](#continuous-integration) | |||
- [Disabling jsdom](#disabling-jsdom) | |||
- [Experimental Snapshot Testing](#experimental-snapshot-testing) | |||
- [Turbo Charge Component Development with React Storybook](#turbo-charge-component-development-with-react-storybook) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks too much like an ad :-) Can we make it appear a bit more utilitarian?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this?
Developing UI Components with React Storybook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
* With some emoji | ||
* With disabled mode | ||
|
||
With React Storybook, you can manage these different states (or stories) and develop them without running your app. You can also deploy your Storybook as a static app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it would be great to mention that this is a third party tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this?
NOTE: React Storybook is an open source third party tool. It's maintained by the community, but not the core React team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than making a separate note, would be nice to integrate organically into the paragraph as a first sentence. It doesn't need to be super thorough. Just saying "React Storybook is a project that <...>" makes it clear enough.
Then, apply following command inside your app: | ||
|
||
```sh | ||
getstorybook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this guaranteed to work? Does Storybook support our Babel preset, NODE_PATH
resolution, react-native-web
alias, and other stuff in our Webpack configs? Is it being tested on npm 2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to get the NODE_PATH support and RN alias. It's pretty similar Webpack config and yep tested on NPM2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to finish these by next Wednesday: storybookjs/storybook#468
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I finished all of them and we are ready to go.
See: storybookjs/storybook#468
Old title was looks like a marketing pitch. Change it to something looks great. The new one is: Developing UI Components with React Storybook.
@gaearon I've apply changes as suggested and now |
I’m almost happy to merge it but I’m not quite satisfied with the first run experience. The URL should be highlighted: storybookjs/storybook#531. Another thing I found confusing is it’s not clear what I should do next. The guide explains:
This is okay but I can see it causing confusion:
I would rather want to see a step-by-step guide to adding an existing component to storybook:
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import App from '../App';
storiesOf('App', module)
.add('normal', () => (
<App />
)); And then mention that we recommend using it on smaller components than |
@gaearon I think I can work on those issues on Storybook. (You've submitted) We use
We can change the example on Writing Stories page to use some real component in his app. Assuming
That's why I like to use something like |
I understand Kadira is monetizing their hosted Storybook service. Will Create React App also provide free marketing for other tools? |
@yanivtal I want to clear about what we are doing here. We don't mention anything about our hosted services here. Yes, we are trying to build some hosted services and make development of Storybook self sustaining without relying on donations. I think there's nothing wrong with that. |
@gaearon @arumoda I don't think there's anything wrong with what you're doing. More people should be able to make a living off their tools. But Storybook isn't a library. It's a freemium service. Get started for free or use our hosted service for a better experience. There's nothing wrong with that, but I don't think Create React App should favor some paid services over others. |
@yanivtal But, it is a library. It's not a freemium service.
|
K, I'll withdraw my concerns. Keep up the great work everyone! |
@gaearon I've fixed issues you've mentioned on the React Storybook repo. I assume this is much better than the previous one. |
also it would be nice to have default stories for actual CRA components instead of new ones.
instead of :
|
@sylvainbannier We tried that. That's why we go with some example Component. |
I have tried to follow this guide and set up storybook into my project. Actually, I didn't find any
To name this thing integration, I expected at least that Also, I don't understand the purpose of separate |
@just-boris yep it's not like a direct integration to CRA. Storybook has a it's own webpack setup and allow developers to customize it as they want. CRA doesn't offer ways to extend it for good reasons. So, this is our kind of integration which works pretty fine and not hard to manage. It creates few files. You've a pretty valid point about the This is a completely optional thing. That's why I hope we don't do any direct integration to CRA codebase or send it by default with CRA. This is just a section on the docs. |
Hey, it seems like there is no any progress. Does is mean that not very many people interested in this feature, so we can close this? |
FWIW, I hope Storybook gets the small promotion of being in the CRA docs as an optional tool. Styleguidist is nice and it may be worthwhile to also add it to CRA in the "optional ecosystem", but it's not really comparable to Storybook. Storybook is the leading and best supported option among a number of solutions tackling a true component-based workflow. The point isn't just to collaborate with designers or to have a reference page for widgets. It's to support a whole new frontend development workflow which helps to scale development teams, improve UI testing, make edge cases explicit, speed up new developer onboarding, support user research, provide a standard on which new tools for designers can be built, share modules across projects, develop new features in isolation from the app itself, and on and on. Is Storybook there yet? No. Are details like the FTR, I have no personal investment in either option. I don't (yet?) use Storybook, and only tried Styleguidist for a few weeks before deciding it didn't fit my personal needs. I'm just speaking as someone whose imagination was captured by trying devcards in Clojurescript a couple years ago and is excited the future is slowly starting to arrive. |
It means I haven't had time to review it 😉 . |
LGTM. |
* Add Storybook to the user guide * Add the missing "Snapshot Testing" link. * Change the title to something nicer Old title was looks like a marketing pitch. Change it to something looks great. The new one is: Developing UI Components with React Storybook. * Mention React Storybook as a third party tool. * Nits * Minor changes
* Add Storybook to the user guide * Add the missing "Snapshot Testing" link. * Change the title to something nicer Old title was looks like a marketing pitch. Change it to something looks great. The new one is: Developing UI Components with React Storybook. * Mention React Storybook as a third party tool. * Nits * Minor changes
* Add Storybook to the user guide * Add the missing "Snapshot Testing" link. * Change the title to something nicer Old title was looks like a marketing pitch. Change it to something looks great. The new one is: Developing UI Components with React Storybook. * Mention React Storybook as a third party tool. * Nits * Minor changes
Should this now suggest you use |
Add instructions on how to add Storybook to the User Guide.
I also mentioned a bit of information about benefits of using Storybook.
Related to: #297 (comment)