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

Addon-docs: Module story format & framework param #7110

Merged
merged 5 commits into from
Jun 19, 2019

Conversation

shilman
Copy link
Member

@shilman shilman commented Jun 17, 2019

Issue: #7101

What I did

This PR combines two different ideas: module story format and adding a "framework" parameter for stories. I combined the two PRs because they touch the same code and it's a pretty simple "regular" change that gets repeated across all the apps.

export default {
  title: 'Root/path/to/component'
}
export const story1 = () => <Component />
export const story2 = () => <Component something={false} />

How to test

cd examples/official-storybook
yarn storybook

Probably should add unit tests as well, and potentially convert the other examples to the new load API. Suggestions?

@vercel
Copy link

vercel bot commented Jun 17, 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-7101-module-story-format.storybook.now.sh

@shilman shilman added this to the 5.2.0 milestone Jun 17, 2019
@shilman shilman mentioned this pull request Jun 17, 2019
21 tasks
app/angular/src/client/preview/index.js Outdated Show resolved Hide resolved
examples/official-storybook/config.js Show resolved Hide resolved
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.

Some comments

examples/official-storybook/config.js Show resolved Hide resolved
lib/core/src/client/preview/start.js Outdated Show resolved Hide resolved
lib/core/src/client/preview/start.js Outdated Show resolved Hide resolved
lib/core/src/client/preview/start.js Show resolved Hide resolved
@shilman shilman requested a review from tmeasday June 18, 2019 03:18
@shilman shilman changed the title Module story format & framework param Addon-docs: Module story format & framework param Jun 18, 2019
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.

👍

@shilman shilman mentioned this pull request Jun 18, 2019
3 tasks
@@ -15,5 +14,9 @@ export const {
raw,
} = clientApi;

const framework = 'angular';
Copy link
Member

Choose a reason for hiding this comment

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

I understand that passing framework will be used later (I see it already in https://github.com/storybookjs/storybook/pull/7119/files#diff-0f7bedc2d2cb7019c3fe0f0f28c18959R13). Are any other usecases to this ? (I am always standing for things to be generic =) )

Copy link
Member Author

Choose a reason for hiding this comment

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

@igor-dv Yeah, I use it to automatically configure things about docs. For example, react defaults to inlining story renders, whereas the rest default to iframes. React and vue support Props prop tables, the rest do not, etc.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it worth exposing "feature sets" that each framework supports instead of the framework

Copy link
Member Author

Choose a reason for hiding this comment

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

That's not a bad idea, though I plan to switch on the framework string to figure out e.g. how to extract the prop definitions. In addition, I believe that having this parameter also coincides with the multiframework stuff that @Hypnosphi is working on, so I thought it would just be a good thing to establish while I am making use of it in the docs work, rather than adding some new mechanism.

@shilman shilman merged commit fbb11ad into next Jun 19, 2019
@shilman shilman deleted the 7101-module-story-format branch June 19, 2019 03:20
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.

4 participants