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

addon-info: is withInfo decorator deprecated? #9211

Closed
zaki-yama opened this issue Dec 20, 2019 · 4 comments
Closed

addon-info: is withInfo decorator deprecated? #9211

zaki-yama opened this issue Dec 20, 2019 · 4 comments

Comments

@zaki-yama
Copy link

Describe the bug
Sorry this is just a question.
addon-info's withInfo() decorator is deprecated?

To Reproduce
When I write a story like this,

import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withInfo } from '@storybook/addon-info';

import Button from './Button';

storiesOf('Button', module)
  .add('Default', withInfo('Default button')(() => (
    <Button label="The Button" onClick={action('click')} />
  )));

I get the following warning in the browser's console.

Passing stories directly into withInfo() is deprecated,
          instead use addDecorator(withInfo) and pass options with the 'info' parameter

What I want to know
I found that Storybook 4 had introduced story parameters.
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#addon-story-parameters
But addon-info wasn't listed here.

So I want to ask you 3 questions:

  1. Is it correct that withInfo() is also deprecated, and I shouldn't use it any more?
  2. Do you have any plans about from which version I can't use this decorator style?
  3. Are there any codemods? I found update-addon-info.js, but it just replaces old addWithInfo() API
@shilman
Copy link
Member

shilman commented Dec 21, 2019

Addon-info is being superceded by addon-docs, which fixes a bunch of bugs and is easier to maintain. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

@zaki-yama
Copy link
Author

@shilman
Thank you! I'll try the new addon-docs.
What about my questions? Is withInfo() also deprecated like other addons' withXXX methods, right?

@shilman
Copy link
Member

shilman commented Dec 22, 2019

@zaki-yama It looks like it's deprecated and better to use parameters: { info: ... }} instead. But still supported (for now)!

@zaki-yama
Copy link
Author

@shilman
I understood! Thank you.

sqs added a commit to sourcegraph/sourcegraph-public-snapshot that referenced this issue Jul 24, 2020
We don't use it, it just takes up pixels, and it's deprecated anyway (see storybookjs/storybook#9211 (comment)).
sqs added a commit to sourcegraph/sourcegraph-public-snapshot that referenced this issue Sep 11, 2020
This addon adds a tab to the top right of storybook components that (annoyingly) covers up part of the component. It is also deprecated (storybookjs/storybook#9211 (comment)). It does not seem to be useful or actually used by any of us.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants