pocka / storybook-addon-vue-info

Info addon for Vue components
https://storybook-addon-vue-info.netlify.com/?path=/story/examples-basic-usage--simple-example
MIT License
164 stars 28 forks source link

support storybook 4 (5) #62

Closed iztsv closed 5 years ago

iztsv commented 5 years ago

Is your feature request related to a problem? Please describe.

The current storybook version is 4. Also, the storybook team is planning to release version 5 (v5.0.0-alpha.1 is released already). Do you have a plan to support storybook v4 and v5?

pocka commented 5 years ago

Yes. I'm going to update dependencies in release/v1.0 branch. But I think this addon will work well with storybook@4 (I'm not sure about v5...)

iztsv commented 5 years ago

Thanks for the feedback!

Yes, the addon works fine with storybook@4.1.6

Also, I tried to use the addon with storybook@4.2.0-alpha.11 and it does not work :( You can see the error in the following repo.

jlpospisil commented 5 years ago

@pocka Will the updates make it compatible with @storybook/addon-knobs? Right now, knobs stop working when this decorator is added.

noah004B commented 5 years ago

I have the same issue. Knobs stop working with storybook@4.1.7

pocka commented 5 years ago

@jlpospisil
What version of storybook are you using?

I think the problem with knobs addon is different from the one @ilyaztsv points out. Should move it into another issue IMO.

jlpospisil commented 5 years ago

@pocka storybook and all add-ons are @latest

pocka commented 5 years ago

Bug details

When we use this addon with .addDecorator at storybook@4.2.0-alpha.XX, this addon throws an error.

`template` or `render` must be on component options, but got undefined.

After my quick search, https://github.com/storybooks/storybook/pull/5057 (storybook@4.2.0-alpha.6) changed behavior for decorators and causes the error.

Confirmed versions

pocka commented 5 years ago

Fixed with @1.0.0-alpha.1 (Commit d11151d69988f3a0f192e04e9714e154578094a6)

simezi commented 5 years ago

Hi, @pocka

I upgraded storybook@5.0.0 and encountered an bug on starting storybook today. Here is error log.

ERR! Error: Cannot find module 'emotion-theming/package.json'
ERR!     at Function.Module._resolveFilename (module.js:538:15)
ERR!     at Function.resolve (internal/module.js:18:19)

Perhaps this might be because storybook-addon-vue-info depends on old @storybook/addons. As a workaround , I wrote resolutions as below and solved the problem

{
    "storybook-addon-vue-info/@storybook/addons":"^5.0.0"
} 

Could you update dependency for next version of storybook-addon-vue-info ?

Thanks in advance.

pocka commented 5 years ago

@simezi I've published 1.0.0-beta.1 which supports both storybook@4.x and storybook@5.0 (https://github.com/pocka/storybook-addon-vue-info/commit/4dd389f76639cbbd6a0629000b6949c045543642). This version depends on @storybook/addons as peerDependencies so it will use your installed version of the package.

simezi commented 5 years ago

@pocka I appreciate your kindness and quick release. ❤️

marina-mosti commented 5 years ago

@pocka Thanks for the update, but somehow 1.0.0-beta.1 doesn't seem to be working with 5.0. Is there any particular configuration changes that we need to apply other than the ones on the migration guide? I'm getting a blank screen on every story that uses the addon, plus :key error warnings from vue.

pocka commented 5 years ago

@immarina

Is there any particular configuration changes that we need to apply other than the ones on the migration guide?

To migrate from storybook-addon-vue-info@0.x, you need to:

There should be no changes required for the Storybook side to use the addon.

plus :key error warnings from vue.

hmm... I noticed React complains no "key" props thing, but Vue didn't.

dartist21 commented 5 years ago

@pocka

NOTE: info option is required for the addon. If you omit it, it won't work.

Can we omit somehow in future releases? Not very comfortable to use, since a description is not always needed

pocka commented 5 years ago

@dartist21 Do you mean "display info without info parameter"? It's by design, to enable users to turn on/off the addon per story. You can write info: true or info: {} when you don't need summary texts.

pocka commented 5 years ago

If you have any problems related to SB4/5 or usage questions about 1.0 version, please open a new issue.