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 JSX docs view to all components #122

Merged
merged 6 commits into from
Dec 1, 2020
Merged

Add JSX docs view to all components #122

merged 6 commits into from
Dec 1, 2020

Conversation

nicko-winner
Copy link
Contributor

@nicko-winner nicko-winner commented Nov 13, 2020

2020-11-13_14-13-47

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.

@netlify
Copy link

netlify bot commented Nov 13, 2020

Deploy preview for helix-react ready!

Built with commit ff951d0

https://deploy-preview-122--helix-react.netlify.app

Copy link
Member

@100stacks 100stacks left a 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 },
Copy link
Member

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?

Copy link
Contributor Author

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>

Copy link
Member

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. 🙄

Comment on lines -121 to -141
## 📚 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">

Copy link
Member

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.

Copy link
Contributor Author

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 },
Copy link
Member

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?

Copy link
Contributor Author

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
@100stacks 100stacks added this to the v1.5.0-alpha milestone Dec 1, 2020
Copy link
Member

@100stacks 100stacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dev LGTM

@100stacks 100stacks merged commit b02ce0d into master Dec 1, 2020
@100stacks 100stacks deleted the JSX-docs-view branch December 1, 2020 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants