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: Dynamic Source rendering for React #11332

Merged
merged 21 commits into from
Jun 30, 2020
Merged

Conversation

shilman
Copy link
Member

@shilman shilman commented Jun 27, 2020

Issue: #8342 #8444

What I did

dyanamic-source

Work in progress for rendering JSX in the code snippet, based on https://github.com/storybookjs/addon-jsx (cc @hipstersmoothie). Now, for React (and eventually all view layers), the JSX of the story function output is rendered to an example snippet dynamically.

This solves the following issues:

Still to be done:

  • Expanded test cases
    • Handle large objects/arrays gracefully
    • Handle corner cases like memo and refs
  • Figure out source customization
  • Figure out framework compatibility path forward

What I need

  • Feedback on the approach and test cases we need to worry about to make this robust
  • Volunteers to help port this to non-React frameworks

How to test

See official-storybook

@shilman shilman marked this pull request as ready for review June 27, 2020 02:35
@shilman shilman changed the title Addon-docs: Source block JSX rendering for React Addon-docs: Dynamic Source block for React Jun 27, 2020
@shilman shilman changed the title Addon-docs: Dynamic Source block for React Addon-docs: Dynamic Source rendering for React Jun 27, 2020
@shilman
Copy link
Member Author

shilman commented Jun 30, 2020

Merging this and releasing so that React users can start trying it out to keep things moving.

@ndelangen
Copy link
Member

I love this, and would love it even more, if you could switch to the HTML output as well somehow!

❤️ ♥️ ❤️

@maggiewachs
Copy link

@shilman is there an open issue that's tracking progress for non-React frameworks? Specifically, I'm looking for the code block to work with the web components build. (Many thanks for all of your work on this project! We're really digging it at Filament Group so far.)

@shilman
Copy link
Member Author

shilman commented Jul 16, 2020

Thanks @maggiewachs! There is now 😅 #11588

I had somebody else ask about lit-element support yesterday & volunteer to contribute, so hopefully we can get that going in 6.1

@ecarrera
Copy link

It will be really useful @shilman, great!! ❤️ I was thinking about it today.

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.

5 participants