-
Notifications
You must be signed in to change notification settings - Fork 296
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
Upgrade and migrate Storybook to v6 #2128
Comments
@felixarntz I don't recall what else I was waiting for here but I think it's already ready for an IB 👍 |
module.exports = {
stories: [
'../stories/**/*.stories.js',
], This should also allow for addons: [
'@storybook/addon-viewport/register',
], I think this can be simplified as Gutenberg uses to exclude the |
IB ✅ |
This is taking longer than anticipated because of some changes in Storybook 6. In Storybook 5 (the version we are using), the decorators within stories are self contained and the code for those decorators are run only when viewing the story, even they are under the same kind. For e.g the export const ReportZeroStory = () => (
<ReportZero moduleSlug="test-module" />
);
ReportZeroStory.storyName = 'Report Zero';
ReportZeroStory.decorators = [
( Story ) => {
const registry = createTestRegistry();
const testModuleDefinition = createModuleStore( 'test-module', {
storeName: 'modules/test-module',
} );
registry.registerStore( testModuleDefinition.STORE_NAME, testModuleDefinition );
provideModules( registry, [ { slug: 'test-module', name: 'Test Module' } ] );
return (
<WithTestRegistry registry={ registry }>
<Story />
</WithTestRegistry>
);
},
];
export default {
title: 'Global',
}; This will prevent decorators which is not related to the story to be run. In case a story exports different stories, for e.g Let me know what you think. |
Thanks for the report @asvinb – that the migration doesn't seem to be as straightforward as originally anticipated. Let's do some testing to see if there is a way to continue using the |
@asvinb and @aaemnnosttv as part of the work for #2941 |
QA ✅ |
Feature Description
Shortly after we recently upgraded the bulk of our dependencies in #1356, Storybook v6 was released.
The release is said to be "almost fully backwards compatible with 5.X", so it should require little to no necessary changes, but some changes may be good to include to better prepare for #1935 and other best practices as well as move away from any potentially deprecated uses.
See the official Migration Guide
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
^6.0
or compatible versionmain.js
andpreview.js
modulesstories
directory and new stories should be able to be written in CSF formatImplementation Brief
/.storybook
main.js
which contains the following:preview.js
which contains the code fromconfig.js
except the part where stories are loaded:config.js
addons.js
Test Coverage
Visual Regression Changes
QA Brief
npm run storybook
Changelog entry
The text was updated successfully, but these errors were encountered: