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
CLI: MDX template support #8396
Conversation
@Aaron-Pool I've tested all of the templates per the instructions above, and the Vue MDX templates are failing due to some babel issue. Would you mind taking a look? The difference between these test cases and |
@shilman didn't have time to dig in super deep this morning, but I did see that you have two Vue mdx stories with JSX, and to the best of my knowledge, that's still a no go. |
@shilman I don't really understand what's going on there you may need to spell it out for me. |
@Aaron-Pool the MDX files in the template are functions that return objects that contain |
@shilman, I don't think that's correct. If you look at the areas I commented, they use JSX in render functions. Which aren't So, no matter what order the Babel loaders run in, the final product be in an error state. If the Vue jsx one runs first, then it will incorrectly transpile the jsx outside of the story blocks and things will be broken. If react jsx runs first, it will try to transpile the jsx in the story incorrectly, and things will be broken. Bit of a catch-22. That was why in a thread a while ago I suggested using babel macros by Kent Dodds to implement story blocks for different view layers, because it's a pretty elegant way of scoping Babel transformations to a particular code block. Still something worth considering imho. |
@Aaron-Pool You're right! 🙇 I'm going to remove that story from the template for now, and we can figure a better solution together separately. UPDATE: Removed the JSX stories but still getting the same error. 😭 What else is different about the |
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.
Looks fine for me, in the Vue area, at least 👍
Issue: #7543
What I did
--story-format
option tosb init
, defaulting to CSFHow to test
New test argument for testing MDX: