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

MDX: Support CSF3 play/render functions #16159

Merged
merged 3 commits into from Sep 25, 2021
Merged

MDX: Support CSF3 play/render functions #16159

merged 3 commits into from Sep 25, 2021

Conversation

shilman
Copy link
Member

@shilman shilman commented Sep 25, 2021

Issue: #15762

What I did

Added CSF3's play/render functions to MDX:

<Meta render={(args) => <Button {...args} />
<Story name="Foo" render={(args) => <Button {...args} />
<Story name="Foo" play={() => console.log('play')} />

The MDX compiler still compiles to CSF2, which also supports these functions. I'm planning to migrate the compiler to output CSF3 once MDX v2 stabilizes and it's time to revisit all this.

@jonniebigodes we should talk about documentation updates for this when you have time!

How to test

  • See attached snapshot tests
  • See attached e2e test in official-storybook

@nx-cloud
Copy link

nx-cloud bot commented Sep 25, 2021

Nx Cloud Report

CI ran the following commands for commit 2ed7856. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@shilman shilman added this to the 6.4 PRs milestone Sep 25, 2021
Copy link
Member

@tmeasday tmeasday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shilman shilman closed this Sep 25, 2021
@shilman shilman reopened this Sep 25, 2021
@shilman shilman merged commit 8395c06 into next Sep 25, 2021
@shilman shilman deleted the 15762-mdx-csf3-support branch September 25, 2021 21:53
@shilman shilman mentioned this pull request Sep 25, 2021
4 tasks
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.

None yet

2 participants