-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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: Support MDX source in Preview w/ no Story blocks #7966
Conversation
…tial issue with line breaks?
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/7kwn8a0km |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hi team I am wondering how far away this request is before it can be apart of the "@next" release? Thanks |
@sanchez This works. I'm hesitant to merge, however, since it's just adding complexity to something that already seems unnecessarily complex. I'll try to figure it out with @atanasster once he's back from vacation next week. |
Awesome and Thanks. Currently as it stands the only way for me to test this feature is to pull the request and link to an existing project correct? If only there was a next of a next. Cheers! |
@sanchez correct. it's really easy to pull & test it out in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Sorry for the slow merge!!!
Hrm I've seen to have run into this issue in v5.3.19. Not sure if I'm missing something. buttons.stories.js
buttons.mdx
|
@joshjeong seems to be working here (see the button "view source in preview" mindway down the page) and the code in our monorepo: https://storybookjs.netlify.app/official-storybook/?path=/docs/addons-docs-mdx-id--hello-story do you need to rename your file "button.stories.mdx"? |
Wouldn't that require a Meta tag and create separate stories? |
Issue: #7844
What I did
The mdx compiler now works directly with the AST to change props of components
added test cases for
The
<Preview />
component in addon-docs checks for the mdxSource property to display source code.How to test
The change is a new double pass:
while previously the original ast was preserved, so it can be a breaking change
Is this testable with Jest or Chromatic screenshots?
yes not sure how to test from the scripts, but this hint from @shilman works:
yarn jest --testPathPattern=mdx-compiler-plugin.test.js
Does this need a new example in the kitchen sink apps?
added example to addon-docs.stories.mdx in official-storybook
Does this need an update to the documentation?
no