storybook
storybook copied to clipboard
[Bug]: Unclear instructions for migrating manager configuration
Describe the bug
When creating custom themes or configuring Storybook's UI, in Storybook 7 users would have the dependency @storybook/addons
and something like this in their manager.js/ts file:
.storybook/manager.ts
import { addons } from '@storybook/addons'
import { create } from '@storybook/theming/create'
const theme = create({
base: 'light',
// ...the properties
})
addons.setConfig({
theme,
showPanel: true, // show addons panel by default
panelPosition: 'right', // position addons panel on the right by default
})
In Storybook 7, @storybook/addons
was split into @storybook/manager-api
and @storybook/preview-api
but the migration notes don't really seem clear about what to do in the scenario just described.
When a user upgrades Storybook, they reach the following error:
I'd say we should improve the migration notes, but optimally provide an automigration for this.
Bump. As of 8.0.0-alpha.13, the addPanel
API used in the migration docs is not available in "@storybook/manager-api"
@Jkker can you link where addons.addPanel()
is used? It has been deprecated since 7.x in favour of addons.add()
and we should update the docs if it's still there.
Fwiw, addPanel
does not appear anywhere in the 7.6 or 8.0 docs.
I added a note to MIGRATION.md
here: https://github.com/storybookjs/storybook/pull/26039