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

CSF: Warn when CSF and storiesOf mixed in one file #8411

Merged
merged 1 commit into from Oct 14, 2019

Conversation

shilman
Copy link
Member

@shilman shilman commented Oct 14, 2019

Issue: #8306

What I did

Show an error when a calls storiesOf from a file with a default export.

Should we throw an error instead? (This is a breaking change, but maybe a good one?)

How to test

Add a storiesOf call from a CSF file in official-storybook

@shilman shilman added bug patch:yes Bugfix & documentation PR that need to be picked to main branch labels Oct 14, 2019
@shilman shilman added this to the 5.2.x milestone Oct 14, 2019
@shilman shilman requested a review from tmeasday October 14, 2019 03:37
@vercel
Copy link

vercel bot commented Oct 14, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/storybook/monorepo/1bdjqlms8
🌍 Preview: https://monorepo-git-8306-csf-storiesof-mix.storybook.now.sh

@shilman shilman changed the title CSF: Forbid mixing CSF and storiesOf calls in one file CSF: Warn when CSF and storiesOf calls are mixed in one file Oct 14, 2019
@shilman shilman changed the title CSF: Warn when CSF and storiesOf calls are mixed in one file CSF: Warn when CSF and storiesOf are mixed in one file Oct 14, 2019
@shilman shilman changed the title CSF: Warn when CSF and storiesOf are mixed in one file CSF: Warn when CSF and storiesOf mixed in one file Oct 14, 2019
@shilman shilman merged commit 945e1c9 into next Oct 14, 2019
@shilman shilman deleted the 8306-csf-storiesof-mix branch October 14, 2019 07:30
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Oct 14, 2019
shilman added a commit that referenced this pull request Oct 14, 2019
CSF: Warn when CSF and `storiesOf` mixed in one file
@kevinSuttle
Copy link
Contributor

What's the goal of this? Just curious.

Will storiesOf be deprecated?

@shilman
Copy link
Member Author

shilman commented Oct 15, 2019

@kevinSuttle It breaks HMR when the two are mixed because the loading behavior is different between the two formats. storiesOf won't be deprecated any time soon. It's too widely used, and for now it's the only way to create stories dynamically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants