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

Render React components with it's source... #56

Closed
antoinegrant opened this issue Apr 5, 2016 · 14 comments
Closed

Render React components with it's source... #56

antoinegrant opened this issue Apr 5, 2016 · 14 comments

Comments

@antoinegrant
Copy link

and perhaps with an editable source and live preview!

This could potentially be implemented in storybook: http://stack.formidable.com/component-playground/

@ritz078
Copy link
Contributor

ritz078 commented Apr 7, 2016

I don't think we should go ahead with this idea at this moment. react-storybook shouldn't take the component development out of the application. We should edit real files because otherwise using this module will become as good as using codepen or jsfiddle. At the same time as long as we are using this for development and not for component display, we can use devtools to see source code.

@achtan
Copy link

achtan commented Apr 11, 2016

view source - yes
edit source - no

@jeef3
Copy link
Contributor

jeef3 commented Apr 11, 2016

I would actually start to wonder the value of seeing even the source inline (other than to make this a complete component IDE of course).

Instead, what do you want Storybook to become? So far it is a place for seeing the different states a component might be in, while also providing hot-reloading, ideal for development. Does Storybook then become a living styleguide perhaps? A library so other developers on your team can see what components are available and how to use them? If this is the case, then there might be value in not necessarily story source code, but example usage source code? Could this be extracted from the story somehow and displayed, maybe?

@arunoda
Copy link
Member

arunoda commented Apr 11, 2016

@jeef3 It's too early to say where Storybook goes. Currently, it's only work as dev tool. But we are working on a static builder. See: #88

With that, we could publish our storybook into a set of static HTML files and publish to GitHub pages (or similar).

There is also an attempt to use markdown inside stories and render proptypes. See: #19 (comment)

So, React Storybook could be used as a living style guide too.

@stewartduffy
Copy link
Contributor

If there is talk of adding support for displaying code example - I think it's worth looking at how material ui do it in their docs. Quite a nice implemtation. They store their code example in external js module & import it in twice to their page. One using the raw webpack loader, they pass the result of this file into a markdown component & the pass the regular loaded example to their page component that renders the example. This way their code example stays in sync with actual component rendered. See https://github.com/callemall/material-ui/blob/master/docs/src/app/components/MarkdownElement.js & https://github.com/callemall/material-ui/blob/master/docs/src/app/components/pages/components/FlatButton/Page.js

@arunoda
Copy link
Member

arunoda commented Apr 16, 2016

@stewartduffy using rawLoaders is a pretty interesting idea. @mnmtanish Check this.

@necolas
Copy link
Contributor

necolas commented Apr 20, 2016

With that, we could publish our storybook into a set of static HTML files and publish to GitHub pages (or similar).

I'm using this and it's a great feature. View source / edit source is complex and I'm not sure what value it adds to react development workflows.

@willdady
Copy link

Not sure if this is what everyone else had in mind but I'd rather see the component's implementation, not the source code. If I wanted to see the source code I'd look at the source code. If my story looked like this:

storiesOf('ProgressBar', module)
  .add('25%', () => (
    <ProgressBar progress={0.25} />
  ));

I'd like to see <ProgressBar progress={0.25} /> rendered somewhere in the storybook. Maybe as a separate panel above the action logger, or a separate tab?

@antoinegrant
Copy link
Author

@willdady that's what I had in mind when stating this ticket.

@achtan
Copy link

achtan commented Apr 26, 2016

@willdady exactly!

@ritz078
Copy link
Contributor

ritz078 commented Apr 26, 2016

Or maybe a panel showing the state and props just like React Devtools

@danielkcz
Copy link
Contributor

Yes, that's definitely something that is missing to see what actual properties were used to display component in such state. As of now it only relies to having good enough description of the story.

@arunoda
Copy link
Member

arunoda commented Jun 16, 2016

@mnmtanish and @roonyh is working on project related to this.
See: https://github.com/kadirahq/react-storybook-story

We'll launch this soon. Anyway, you can use this right now as well.

@thani-sh
Copy link
Contributor

Fixed with this addon

ndelangen pushed a commit that referenced this issue Apr 5, 2017
Default loaders.js ignores .md, .mdown .markdown
ndelangen pushed a commit that referenced this issue Apr 5, 2017
ndelangen pushed a commit that referenced this issue Apr 11, 2017
ndelangen pushed a commit that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants