-
Notifications
You must be signed in to change notification settings - Fork 6
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 JSX docs view to all components #122
Conversation
Deploy preview for helix-react ready! Built with commit ff951d0 |
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.
@nicko-winner, just a few small comments/questions. 👍
import { callback } from '../storyUtils'; | ||
|
||
addParameters({ | ||
jsx: { skip: 0 }, |
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 @nicko-winner, what's the purpose of this line again?
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 creates a global param, and sets the arguments for storybook. We are telling the JSX plugin that is being applied globally to all stories to skip: 0 times, which means, do not exclude any markup from the JSX window display:
If you had markup that looks like this:
skip: 0 would would show all the markup.
<div>
<span>
<a></a>
</span>
</div>
skip: 1. would skip the outermost div:
<span>
<a></a>
</span>
skip: 2 would skip the outer 2 tags:
<a></a>
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.
Ok thanks for the explanation above. 🙄
## 📚 Storybook | ||
[Storybook](https://storybook.js.org/) is an open source tool for developing UI components | ||
in isolation for React, Vue, and Angular. | ||
You can use this as a playground for all our components. | ||
|
||
1. Install Dependencies | ||
|
||
```bash | ||
yarn install | ||
``` | ||
|
||
2. Run Storybook | ||
|
||
```bash | ||
npm start | ||
``` | ||
The script should automatically open Storybook in your browser, but you can always navigate to `http://localhost:6006/?path=/story` | ||
|
||
3. Play Around | ||
<img width="639" alt="Screen Shot 2020-05-15 at 2 32 35 PM" src="https://user-images.githubusercontent.com/22566333/82084224-f5c99880-96b8-11ea-92e2-403b3f4378db.png"> | ||
|
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.
Until we add a separate contribution guide, please change to something like "Setting up a Local Dev Environment", for new contributors. 🙂 You can move it towards the end of README if that makes more sense.
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.
sure
import { boolean, select, text } from '@storybook/addon-knobs/react'; | ||
|
||
addParameters({ | ||
jsx: { skip: 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.
What does the { skip: 2 }
do?
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.
see earlier response.
Move storybook to setup dev ENV section
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.
Dev LGTM
Also removed storybook docs now that we are hosting storybook, if we wanted to bring them back maybe it would make more sense to add that information to a CONTRIBUTING.md.