Closed JesusTheHun closed 1 year ago
That's a really good question. There are some breaking API changes so I wouldn't expect a SB7 addon to work with 6.x and vice versa. The addon kit specifies Storybook dependencies as peer dependencies, so they'll come from your Storybook setup.
IMO you'd have to release a new major version of your addon.
I have noticed some changes, but I didn't see any hard breaking changes, meaning that if you check for the SB version at runtime, you should be able to branch your code. I don't know SB have much as you do though, hence this issue. What do you think about code branching ?
It depends a bit on how your addon is setup.
There are a few changes that could impact your addon:
register.js
was removed (deprecated in SB 6.5)@storybook/addons
@storybook/api
has been split into @storybook/preview-api
and @storybook/manager-api
@storybook/api
is still available in 7.0 but you'll see a deprecation warning.
IMO publish an alpha of your addon and try it out. I would be very interested in the results too.
Otherwise, check out https://github.com/storybookjs/addon-styling It's been set up to publish two versions. 6x on main
and 7.0 on next
auto
handles that for you by default
Official recommendation is in the migration guide: https://storybook.js.org/docs/react/addons/addon-migration-guide#releasing
Is there a way to support SB 6 and 7 with the same package? Or do I need to make a breaking change version?