loki icon indicating copy to clipboard operation
loki copied to clipboard

DeprecationWarning: `setAddon` is deprecated and will be removed in Storybook 7.0.

Open vespasianvs opened this issue 3 years ago • 10 comments

Can't see an issue for this in the list already, so adding it here. the file integration-core/src/decorate-storybook uses 'setAddon'. This is deprecated and going to be removed in Storybook 7.

Instead, stories etc need to be written in Component Story Format.

Happy to try to look at this and put in a PR if you want.

vespasianvs avatar Jul 07 '21 07:07 vespasianvs

Thanks for reporting the issue @vespasianvs 💯

Component Story Format (CSF) is supported already 👇 https://github.com/oblador/loki/blob/master/examples/react/src/stories/csf.stories.js

Would CSF support be enough? Or Would it still require changes to remove setAddon? If so, feel free to create a pull request 👍

techeverri avatar Jul 07 '21 07:07 techeverri

I think it needs setAddon removing entirely. I just get a DeprecationWarning for every storybook test when I run my jest tests against storybook using their addon-storyshots. I traced the deprecation warning and it comes from the file above.

vespasianvs avatar Jul 07 '21 08:07 vespasianvs

May take me a week or so to get round to looking BTW - gotta get on with my paid work first :)

vespasianvs avatar Jul 07 '21 08:07 vespasianvs

Had a look and the area that is affected is for the .add.skip() and .lokiSkip() and .add.async() and .lokiAsync() style functionality. I can try to hack around it and keep it, but they are already deprecated. We could just get rid of that whole notation now and get people to switch to the parameters notation.

{ loki: { skip: true } }
{ loki: { async: true } }

It looks like they been deprecated for a while now?

vespasianvs avatar Jul 14 '21 13:07 vespasianvs

Support for Storybook < 5 was deprecated (but not removed) in https://github.com/oblador/loki/releases/tag/v0.23.0

techeverri avatar Jul 14 '21 14:07 techeverri

So is it time to remove it now? Then it removes the need for that entire decorate storybook file from what I can see?

vespasianvs avatar Jul 15 '21 06:07 vespasianvs

@vespasianvs Yeah, it's been marked as deprecated for a year now, so I think it's time.

oblador avatar Jul 15 '21 16:07 oblador

Ah....wait...I thought the whole file was deprecated, but lokiAsync is still used? Is the format of

Story.parameters = { loki: { async: true } }

Already implemented? I can't see it anywhere

vespasianvs avatar Jul 19 '21 08:07 vespasianvs

Use @loki/create-async-callback for that!

oblador avatar Jul 19 '21 10:07 oblador

Ah, so I can just remove .lokiAsync for that. I don't use it, but wanted to make sure I wasn't breaking anything....

vespasianvs avatar Jul 19 '21 10:07 vespasianvs