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

Integrate component demos #7

Open
rexxars opened this issue Sep 3, 2014 · 8 comments
Open

Integrate component demos #7

rexxars opened this issue Sep 3, 2014 · 8 comments

Comments

@rexxars
Copy link
Member

rexxars commented Sep 3, 2014

A really awesome feature, which has been suggested by multiple people on IRC, is to have demos of each component available through the site.

This will require a certain amount of standardization and security considerations, obviously.

@rexxars
Copy link
Member Author

rexxars commented Sep 3, 2014

GreenJello suggests on IRC something similar to browserify-cdn.

@rexxars
Copy link
Member Author

rexxars commented Sep 3, 2014

If we can set a standard where each Git repo should have a demo.js or similar, we should be able to webpack/browserify it. If we also dictate that it should render the demo onto a page, in lets say document.body, then we're one step closer. We'd have to make it possible to add CSS and external JS to the page, but I think that's manageable.

We could then run the demos in a sandboxed iframe, perhaps? A bit like JSBin etc.

@andreypopp
Copy link

I'd suggest using webpack with predefined config (jsx, css, fonts, images should be enough). You can see the simplest example of React component, React Font Awesome which depends on styles and static assets. Specifically see examples/ directory and webpack.config.js inside.

So each component should have demo/index.js (or something like that) in its repository which should be used as an entry point for webpack.

@ioRekz
Copy link

ioRekz commented Sep 3, 2014

That would be awesome. Adding code edition like this https://gcanti.github.io/resources/tcomb-react-bootstrap/playground/playground.html or props editor would be quite nice as well.

@KyleAMathews
Copy link

More practical perhaps would be to pull in the demo inside an iFrame. I don't won't to rewrite all my demos to work with whatever standard. The package.json could have a demo key with a URL pointing at a demo page.

@notduncansmith
Copy link

Why not use just Codepen? http://codepen.io

@petehunt
Copy link

petehunt commented Sep 4, 2014

+1 @andreypopp -- standardizing on a webpack config would be awesome

@jecel0911
Copy link

Agree, it would be awesome to have demos. webpack some config standard will be a good start.

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

7 participants