-
-
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
Changes from 1 commit
18c3476
04f0387
16347ba
686cc62
96627c1
ef29d2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
- [Deployment](#deployment) | ||
- [Building for Relative Paths](#building-for-relative-paths) | ||
- [GitHub Pages](#github-pages) | ||
|
@@ -858,6 +859,44 @@ Snapshot testing is a new feature of Jest that automatically generates text snap | |
|
||
This feature is experimental and still [has major usage issues](https://github.com/facebookincubator/create-react-app/issues/372) so we only encourage you to use it if you like experimental technology. We intend to gradually improve it over time and eventually offer it as the default solution for testing React components, but this will take time. [Read more about snapshot testing.](http://facebook.github.io/jest/blog/2016/07/27/jest-14.html) | ||
|
||
## Turbo Charge Component Development with React Storybook | ||
|
||
Usually, in our app, we have a lot of UI components, and they've different states. | ||
For an example, a simple button component could have following states: | ||
|
||
* With a text label | ||
* 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. How about this?
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
That means, everyone in your team can view and review different states of UI components without starting a backend server or creating an account in your app. | ||
|
||
![React Storybook Demo](http://i.imgur.com/7CIAWpB.gif) | ||
|
||
**Here's how to setup your app with Storybook:** | ||
|
||
First, install the following NPM module globally: | ||
|
||
```sh | ||
npm install -g getstorybook | ||
``` | ||
|
||
Then, apply following command inside your app: | ||
|
||
```sh | ||
getstorybook | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this guaranteed to work? Does Storybook support our Babel preset, There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Hey, I finished all of them and we are ready to go. |
||
``` | ||
|
||
After that, follow the instructions on the screen. | ||
|
||
For more information, have a look at following links: | ||
|
||
* 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Oh yeah. |
||
|
||
## Deployment | ||
|
||
## Building for Relative Paths | ||
|
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