loki icon indicating copy to clipboard operation
loki copied to clipboard

Problems caused by skip() & lokiSkip(): they break other storybook plugins

Open jacksbox opened this issue 6 years ago • 3 comments

lokiSkip() and asyc are pretty handy functions, but they break other storybook plugins: e.g. the storyshots plugin, which complains, that lokiSkip isn't a function. this happens because loki just registers this functions when it is configuring storybook. All other plugins, don't use the loki config-storybook and will therefor break.

Please find another possibility to add this functions (just register a normal storybook plugin?) or keep the cli option to exclude stories.

jacksbox avatar Aug 22 '18 16:08 jacksbox

I'm not sure is it related, but I also faced problem while passing @storybook/addon-viewport parameters to .lokiSkip.

Example:

storiesOf('Card', module)
    .add('default', () => (
        <Card />
    ))
    .lokiSkip('iphone6', () => (
        <Card />
    ), { viewport: { defaultViewport: 'iphone6' }})

Parameters are not recognized and both use the same viewport. But using .add instead of .lokiSkip works as expected and sets viewport according to parameters.

erzhtor avatar May 06 '19 08:05 erzhtor

Any update there?

erzhtor avatar May 21 '19 11:05 erzhtor

I have the same problem. Are there any updates?

Setup

Node v12.16.2 Loki v0.22.1 Storybook v5.3.13 Storybook addons: docs, viewport

Example

storiesOf('Card', module)
    .addParameters({ component: Card })
    .add('default', () => (
        <Card />
    ))
    .lokiSkip('default2', () => (
        <Card />
    ))

What do I expect?

If I start storybook there should be two stories. If I go to the Docs tab in storybook there should be the documentation of all two stories, including the props list of the component on top and the code of each story visible next to each rendered story. Cod button example in right bottom corner: Bildschirmfoto 2020-07-01 um 09 07 05

What is really happening?

I can not see the code from the default2 story, but I can from the default story. Code button: Bildschirmfoto 2020-07-01 um 09 07 00

Suggestions

This looks like lokiSkip prevents some functionality of the add-ons. It should be possible to pass the whole add function through the lokiSkip to prevent

Tobi-mmt avatar Jul 01 '20 07:07 Tobi-mmt