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

Document module / storiesof / mdx story formats #7498

Merged
merged 4 commits into from
Jul 22, 2019
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Jul 20, 2019

Issue: #7440

What I did

  • Update "writing stories"
  • Create module / storiesof / mdx docs

@vercel
Copy link

vercel bot commented Jul 20, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-7440-module-format-docs.storybook.now.sh

Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

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

LGTM a few typos

- a classic [storiesOf format](../../formats/storiesof-story-format/), which adds stories through Storybook's API.
- an experimental [MDX format](../../formats/mdx-story-format/), which mixes longform Markdown docs and JSX stories.

Since Module format is a new additon to Storybook, most Storybook examples you'll find in the wild are written in the legacy [storiesOf format](../stories-of-format/).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Since Module format is a new additon to Storybook, most Storybook examples you'll find in the wild are written in the legacy [storiesOf format](../stories-of-format/).
Since Module format is a new addition to Storybook, most Storybook examples you'll find in the wild are written in the legacy [storiesOf format](../stories-of-format/).

```

This will add stories in the storybook like this:
The `load` function may be called multiple times to load stories from different locations.
Copy link
Member

Choose a reason for hiding this comment

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

Will have to change this :)

title: 'Module Story Format'
---

Module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2.
The module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2.


Module story format is the recommended way to [write stories](../../basics/writing-stories/) since Storybook 5.2.

It's called "module" format because the stories and component metadata are defined as ES6 modules. Every Module story file consists of a required default export and one or more named exports.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
It's called "module" format because the stories and component metadata are defined as ES6 modules. Every Module story file consists of a required default export and one or more named exports.
It's called "module" format because the stories and component metadata are defined as ES6 modules. Every module story file consists of a required default export and one or more named exports.


It's called "module" format because the stories and component metadata are defined as ES6 modules. Every Module story file consists of a required default export and one or more named exports.

Module format is supported in all frameworks except React Native, where you should use the [storiesOf format](../storiesof-story-format) instead.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Module format is supported in all frameworks except React Native, where you should use the [storiesOf format](../storiesof-story-format) instead.
The module format is supported in all frameworks except React Native, where you should use the [storiesOf format](../storiesof-story-format) instead.

));
```

The string argument to `storiesOF` is the component title. IF you pass a string like `'Widgets|Button/Button'` it can also be used to position your component's story within [Storybook's story hierarchy](../../writing-stories/#story-hierarchy).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
The string argument to `storiesOF` is the component title. IF you pass a string like `'Widgets|Button/Button'` it can also be used to position your component's story within [Storybook's story hierarchy](../../writing-stories/#story-hierarchy).
The string argument to `storiesOf` is the component title. IF you pass a string like `'Widgets|Button/Button'` it can also be used to position your component's story within [Storybook's story hierarchy](../../writing-stories/#story-hierarchy).

require('../stories/Bar.stories.js');
}

configure(loadStories, module);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
configure(loadStories, module);
load(loadStories, module);

?

@shilman shilman merged commit 123d80e into next Jul 22, 2019
@shilman shilman deleted the 7440-module-format-docs branch July 22, 2019 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants