elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.81k stars 8.2k forks source link

Upgrade Storybook to 8.x #171591

Open Ikuni17 opened 11 months ago

Ikuni17 commented 11 months ago

Blocked by Webpack 5 Upgrade (#89741)

Migration Docs

While working on #171258 I ran the migration scripts for storiesOf with:

 npx storybook@latest migrate storiesof-to-csf --glob="x-pack/**/*.stories.@(mdx|tsx)" --parser=tsx
 npx storybook@latest migrate csf-2-to-3 --glob="x-pack/**/*.stories.@(mdx|tsx)" --parser=tsx

Other glob patterns would not detect the stories or make relevant changes. Needs to be ran against packages/** as well. Possibly a different parser for mdx. There will be quite a few ESLint and TS errors which need resolved manually after the scripts.

### Tasks
- [ ] Revert #171453
- [ ] Revert #171258
- [ ] Add Ops team as Codeowners of `.ci/.storybook/main.js` if exists for Composite story
- [ ] Revert https://github.com/elastic/kibana/pull/172032
- [ ] Evaluate if #176500 was fixed via the upgrade
elasticmachine commented 11 months ago

Pinging @elastic/kibana-operations (Team:Operations)

legrego commented 5 months ago

Voicing my support for this one 💚. We discussed elsewhere that our current suite of Storybook dependencies adds significant noise to our vulnerability scans. Updating Storybook would make upgrades of other dependencies much easier and give us a clearer picture of our actual risk.

legrego commented 5 months ago

It looks like Storybook 8.0 has been released. They have a migration guide to move from 6 to 8: https://storybook.js.org/docs/migration-guide/from-older-version

edit: moving to v8 may first require updating webpack (https://github.com/elastic/kibana/issues/89741): https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#webpack4-support-discontinued

vadimkibana commented 5 months ago

+1 for this effort