-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Docs: Update migration guides #26182
Conversation
- Add 6 to 8 guide - Account for auto-blockers
- Remove babel breaking change mention
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.
Appreciate you taking the time to put this together and so that we can try and unblock users as much as possible during their transition from 6.x to 8. Left some items for you to look into. Let me know once you've addressed them and we'll take it from there.
Co-authored-by: jonniebigodes <[email protected]>
- Fix typos and small prose improvements
|
||
If any of these changes apply to your project, please read through the linked migration notes before continuing. | ||
|
||
If any of these new requirements or changes are blockers for your project, we recommend [migrating to Storybook 7](../../release-7-6/docs/migration-guide). |
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.
I think this isn't true for Webpack4. As far as I know, we don't have Webpack4 support in Storybook 7.
### Upgrade MDX1 to MDX3 | ||
|
||
Storybook 8 uses MDX3 by default for rendering [docs](./writing-docs/index.md). The upgrade from MDX1 to MDX3 is not fully automated due to the large number of changes between versions (particularly v1 to v2). Fortunately, we have some tips to help make it a lot easier. |
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.
This is already part of the automigrations. A manual migration afterwards is only necessary if the user declines the automigration. Nevertheless, the whole Upgrade MDX1 to MDX3
section adds so much valuable information that I think it's nice to have it!
### `storiesOf` to CSF | ||
|
||
Storybook architecture focuses on performance and now needs statically analyzable code. For that reason, it does not work with `storiesOf`. We provide a codemod which, in most cases, should automatically make the code changes for you (make sure to update the glob to fit your files): | ||
|
||
<!-- prettier-ignore-start --> | ||
|
||
<CodeSnippets | ||
paths={[ | ||
'common/storybook-migrate-stories-of-to-csf.npm.js.mdx', | ||
'common/storybook-migrate-stories-of-to-csf.pnpm.js.mdx', | ||
'common/storybook-migrate-stories-of-to-csf.yarn.js.mdx' | ||
]} | ||
/> | ||
|
||
<!-- prettier-ignore-end --> | ||
|
||
This will transform your stories into [CSF 1](/blog/component-story-format/) stories, which are story functions that don't accept [args](../writing-stories/args.md). These are fully supported in Storybook 8, and will continue to be for the foreseeable future. | ||
|
||
However, we recommend [writing all **new** stories in CSF 3](../writing-stories/index.md), which are story objects that are easier to write, reuse, and maintain. | ||
|
||
### `storiesOf` to dynamically created stories | ||
|
||
If you are using `storiesOf` for its ability to create stories dynamically, you can build your own "storiesOf" implementation by leveraging the new [(experimental) indexer API](../api/main-config-indexers). A proof of concept (with a deeper explanation of the implementation) can be seen in [this StackBlitz demo](https://stackblitz.com/edit/github-h2rgfk?file=README.md). |
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.
If we detect that the user uses storyStoryV7: false
, we block the upgrade to 8. And the storiesOf
API ONLY works with storyStoryV6 (storyStoryV7: false)
. So in theory, the user has to remove storyStoryV7: false
to allow the upgrade. In this middle state, Storybook will be broken for user's who continue to use storiesOf
in Storybook 6. So they upgrade to Storybook 8 and then they have to run the necessary steps to get rid of the storiesOf
API. I just wanted to clarify this.
- Restructure to more accurately provide `storyStoreV7`, `storiesOf`, and MDX 2 guidance
@valentinpalkovic — Thank you for the well-considered feedback! I tried to address your comments here. Mind taking another look? |
* next: (39 commits) Typo cleanup Add story for empty argTypes and address review fix issues with types, change the comment to not be jsdoc Add E2E test for multiple CSF files with same title in autodocs Fix overflow bug by using a better link remove deprecation of `manager-api`'s `types` export Don't show empty arg tables in doc pages Fix Yarn2Proxy findInstallations method revert component values back to array done perf(manager): improve performance when switching stories Add todo comment Refactor MDX to CSF transform function to return an object instead of a tuple Rename broken MDX files to .mdx.broken Upgrade migration-guide to mention limitations of mdx-to-csf codemod Fix issues where stories.js files were generated although a story doesn't exist Rename transformed mdx files Add version range for removeLegacyMDX1 fix Fix typo in automigrate/types.ts ...
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!
What I did
Checklist for Contributors
Testing
Manual testing
migration-guide-updates-2
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>