-
-
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
CLI: Add Next.js framework automigration #19574
Conversation
return null; | ||
} | ||
|
||
// we only migrate from react-webpack5 projects |
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.
Given that @storybook/react-webpack5
is only available in 7.0+
, It seems far more likely that someone would be upgrading from a project with @storybook/react
& @storybook/builder-webpack5
. Perhaps, for this scenario, we could leverage the fix tested here, and then re-run this fix?
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 would happen after another migration that would have migrated users to react-webpack5
This package provides a better experience for Next.js users, however it is only compatible with the webpack 5 builder, so we can't automigrate for you, as you are using the Vite builder. | ||
|
||
If you are interested in using this package, see: ${chalk.yellow( | ||
'https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#nextjs-framework' |
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.
Let's just point them to the framework README. I don't think that info belongs in the migration guide.
Decided to leave this until after the post has gone out & somebody has time to properly test it |
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.
@yannbf we didn't feel comfortable doing a last-minute merge on this before the post went out. changes LGTM so if you want to merge & release now that you're back from vacation that WFM
I based the SvelteKit automigration on this work, with some modifications. Feel free to be inspired or ignore it. |
c131e01
to
ec2ab18
Compare
Issue: N/A
What I did
This adds an automigration for projects using
@storybook/react-webpack5
and Next.js, so they can use the new@storybook/nextjs
package instead.For
@storybook/react-vite
and Next.js users, it will warn them, but not migrate anything:TODO:
How to test
sb automigrate
in a React Webpack5 + Next.js projectIf your answer is yes to any of these, please make sure to include it in your PR.