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

Storybook with all the demos #25

Open
armanbilge opened this issue Mar 29, 2022 · 2 comments
Open

Storybook with all the demos #25

armanbilge opened this issue Mar 29, 2022 · 2 comments

Comments

@armanbilge
Copy link
Collaborator

This is a cool idea from @rpiaggio. I don't know what a storybook is actually, is there an example of this?

@armanbilge
Copy link
Collaborator Author

armanbilge pushed a commit that referenced this issue Jun 8, 2022
@hugo-vrijswijk
Copy link
Contributor

Having Storybook would be very useful and could replace all the demo projects. It's great for showing what variants there are of a component and what interactions it can have. I'm unsure how easy it would be to integrate scala.js components into Storybook. Each 'story' in Storybook is a .tsx/.jsx or .mdx page. The storybook CLI is pretty tightly integrated with looking for these files and parsing them, so we would either:

  1. Add .tsx/.mdx stories and render our Scala.js components in them. I have no idea how easy it is to use exported Scala.js React components in TS code
  2. Create a layer over Storybook to include Scala story files. I am uncertain if this is possible since Webpack/Vite do this with just-in-time transpilation
  3. Output *.stories.js files from Scala.js that Storybook picks up. This might be the best option, assuming Scala.js can output in the *.stories.js format, only the files we want to export. So each export would be a separate *.stories.js file, and 'shared' code is not (would just be .js files)

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

No branches or pull requests

2 participants