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

Update storybook from version 5.3.20 to 6.1.11 #4835

Merged
merged 3 commits into from
Dec 18, 2020

Conversation

jcfilben
Copy link
Collaborator

@jcfilben jcfilben commented Dec 17, 2020

What does this PR do?

Updates the storybook version to the latest, 6.1.11

This update includes changes to the CSF format for the stories. Previously the annotations looked like this:

export const Basic = () => <Button />
Basic.story = {
  name: 'foo',
  parameters: { ... },
  decorators: [ ... ],
};

The above format is deprecated and the annotation should be in this format instead:

export const Basic = () => <Button />
Basic.storyName = 'foo';
Basic.parameters = { ... };
Basic.decorators = [ ... ];
};

This PR fixes the stories to use the new format. This is where the majority of the changes come from. Also stories should no longer use storiesOf.

In the storybook/preview.js file I removed options: { showRoots: true, } because showRoots is deprecated and the behavior is now done by default and controlled within the .storybook/manager.js file instead of the preview.js file.

Also in storybook/preview.js I added layout: 'fullscreen' so the component takes up the full canvas instead of having a margin around it. The previous behavior in 5.3.20 was for the component to take up the full canvas.

More information about migrating to version 6 of storybook can be found in the version 6 migration guide as well as this more detailed markdown file.

Where should the reviewer start?

Start with the package.json and storybook/preview.js files.
Then look the stories to see the changes from the old CSF annotation format to the new format.

What testing has been done on this PR?

storybook

How should this be manually tested?

storybook

Any background context you want to provide?

What are the relevant issues?

Screenshots (if appropriate)

Do the grommet docs need to be updated?

No

Should this PR be mentioned in the release notes?

No

Is this change backwards compatible or is it a breaking change?

Backwards compatible

@ericsoderberghp ericsoderberghp merged commit c6cd57f into grommet:master Dec 18, 2020
@jcfilben
Copy link
Collaborator Author

I think we should roll back this PR since the code on the stories is not showing up.

I did find a solution based on information found here. But it requires moving export default {title: ''}; into each story with a unique name. Currently we have stories files with multiple stories within so this requires some restructuring. I think one I have this part done the storybook version can be update to 6 at the same time as the story restructuring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants