storybookjs / addon-kit

Everything you need to build a Storybook addon
https://storybook.js.org/docs/react/addons/writing-addons
MIT License
142 stars 35 forks source link

Should preset.js include the manager? #42

Closed deviantintegral closed 1 year ago

deviantintegral commented 1 year ago

We recently noticed a browser warning in our storybook addon at https://github.com/Lullabot/storybook-drupal-addon/pull/27.

storybook/drupal-addon was loaded twice, this could have bad side-effects

It seems like this export isn't required at all for addons to work: https://github.com/storybookjs/addon-kit/blob/main/preset.js#L5-L7

In our case, we've removed it, but it did come from this repository template. Is there some other reason it is required or useful? If not, can it be removed, or left in place commented as an example with details on why it's useful?

winkerVSbecks commented 1 year ago

The present has been split into the manager.ts and preview.ts files. Here's the new syntax: https://github.com/storybookjs/addon-kit/tree/main/src/preset

It looks like when you bootstrapped the drupal-addon a while back so, you have the old syntax. But the fix you made updates it to the new syntax.