storybook icon indicating copy to clipboard operation
storybook copied to clipboard

[Bug]: Unclear instructions for migrating manager configuration

Open yannbf opened this issue 6 months ago • 3 comments

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: image

I'd say we should improve the migration notes, but optimally provide an automigration for this.

yannbf avatar Jan 23 '24 15:01 yannbf

Bump. As of 8.0.0-alpha.13, the addPanel API used in the migration docs is not available in "@storybook/manager-api"

Jkker avatar Jan 23 '24 20:01 Jkker

@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.

vanessayuenn avatar Jan 25 '24 14:01 vanessayuenn

Fwiw, addPanel does not appear anywhere in the 7.6 or 8.0 docs.

kylegach avatar Feb 14 '24 21:02 kylegach

I added a note to MIGRATION.md here: https://github.com/storybookjs/storybook/pull/26039

kylegach avatar Feb 15 '24 04:02 kylegach