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

Throw descriptive error when 'of' prop is detected #37

Merged
merged 2 commits into from
Mar 16, 2023
Merged

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Mar 15, 2023

Works on storybookjs/storybook#20496

Mirror PR for MDX1: storybookjs/mdx1-csf#21

What Changed

This PR throws a descriptive error when the of prop on Meta or Story is found, as that is not supported in .stories.mdx files

How to test

Add a file to a sandbox like this:

import { Story, Meta } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
import { Button } from './Button';

<Meta title="storiesMdx" component={Button}/>

<Story of={ButtonStories.Primary} />

or

import { Story, Meta } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
import { Button } from './Button';

<Meta title="storiesMdx" of={ButtonStories} />

<Story story={ButtonStories.Primary} />

Change Type

  • maintenance
  • documentation
  • patch
  • minor
  • major
📦 Published PR as canary version: 0.0.5-canary.37.6aef72a.0

✨ Test out this PR locally via:

npm install @storybook/[email protected]
# or 
yarn add @storybook/[email protected]

Version

Published prerelease version: v1.0.0-next.6

Changelog

💥 Breaking Change

  • Add JSX transpilation to compiler-generated code #30 (@ndelangen)

🚀 Enhancement

🐛 Bug Fix

⚠️ Pushed to next

Authors: 10

@JReinhold JReinhold requested a review from shilman March 15, 2023 08:33
@JReinhold JReinhold self-assigned this Mar 15, 2023
@JReinhold JReinhold added bug Something isn't working patch Increment the patch version when merged labels Mar 15, 2023
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM, can you please add a unit test for this though?

@JReinhold JReinhold requested a review from shilman March 16, 2023 12:20
@shilman shilman changed the title Throw descriptive error when of prop is detected Throw descriptive error when 'of' prop is detected Mar 16, 2023
@shilman shilman merged commit 051f37c into next Mar 16, 2023
This was referenced Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants