[9.0] Upgrade to Storybook 8 (#195148)#214680
Merged
Ikuni17 merged 14 commits intoelastic:9.0from Mar 19, 2025
Merged
Conversation
## Summary Depends on elastic#191106 Closes elastic#171591 This PR migrates Storybook from `6.x` to `8.x`. Please see the [migration guide](https://storybook.js.org/docs/migration-guide/from-older-version) for an overview of the changes because there are many breaking changes which effect Kibana. The TODO list below is not inclusive of all the changes. ## Reviewers ### Each commit contains all files changed for a specific codeowner, please find your respective commit to make review easier. A **first step before code review** should be checking the [`Storybooks Preview`](https://ci-artifacts.kibana.dev/storybooks/pr-195148/index.html) from CI for any runtime or style issues which were missed. The preview can be compared to a build from `main` [here](https://ci-artifacts.kibana.dev/storybooks/pr-212585/index.html). It is worth noting that some stories have runtime issues which existed before this migration. Most stories appear to have been migrated properly, but the Operations team does not have prior knowledge into every story. Some of the migration was able to be automated through Storybook provided scripts. It is possible this wasn't entirely correct due to the structure of some stories. Additionally, part of this migration is moving Storybook to Webpack 5 which changed how styles are being loaded. #### TODO - [x] Migrate `stories.mdx` - [x] storyshots - [x] [Migrate packages](https://storybook.js.org/docs/migration-guide/from-older-version#package-structure-changes) which were removed in `8.0` - [x] `react-doc-gen` resolution - [x] [Migrate blocks](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#addon-docs-removed-deprecated-blocksjs-entry) - [x] Migrate deprecated `addon-knobs` to [addon-controls](https://www.npmjs.com/package/@storybook/addon-controls) - [x] React Fast Refresh support - [x] Watch flag callback - [x] `canvas` webpack - [x] Rerun CSF migrations for new stories - [x] Handle ESM import for `addon-docs` - [x] `'@storybook/addon-actions' should be listed in the project's dependencies. Run 'npm i -S @storybook/addon-actions' to add iteslint[import/no-extraneous-dependencies](https://github.com/import-js/eslint-plugin-import/blob/v2.28.0/docs/rules/no-extraneous-dependencies.md)` - [x] `addDecorator` migration - [x] `addParameter` migration - [x] static build - [ ] determine if elastic#176500 is solved or push to followup PR - This will need to be fixed separately - [x] revert `.buildkite/pipelines/pull_request/base.yml` & `.buildkite/scripts/pipelines/pull_request/pipeline.ts` to `main` --------- Co-authored-by: Tiago Costa <tiago.costa@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Jacek Kolezynski <jacek.kolezynski@elastic.co> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co> Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com> (cherry picked from commit 403b5f2) # Conflicts: # package.json # src/dev/storybook/aliases.ts # src/platform/packages/shared/kbn-ambient-storybook-types/index.d.ts # src/platform/packages/shared/kbn-monaco/src/painless/constants.ts # src/platform/packages/shared/kbn-unified-tabs/src/components/__stories__/storybook_constants.ts # src/platform/packages/shared/kbn-unified-tabs/src/components/__stories__/tab.stories.tsx # src/platform/packages/shared/kbn-unified-tabs/src/components/__stories__/tabs.stories.tsx # src/platform/packages/shared/shared-ux/chrome/navigation/src/ui/navigation.stories.tsx # src/platform/plugins/shared/discover/.storybook/main.ts # src/platform/plugins/shared/expression_image/public/expression_renderers/__stories__/image_renderer.stories.tsx # src/platform/plugins/shared/expression_repeat_image/public/expression_renderers/__stories__/repeat_image_renderer.stories.tsx # src/platform/plugins/shared/expression_reveal_image/public/expression_renderers/__stories__/reveal_image_renderer.stories.tsx # x-pack/platform/plugins/private/canvas/public/components/custom_element_modal/__stories__/custom_element_modal.stories.tsx # x-pack/platform/plugins/private/canvas/public/components/element_card/__stories__/element_card.stories.tsx # x-pack/platform/plugins/private/canvas/public/components/workpad_header/editor_menu/__stories__/editor_menu.stories.tsx # x-pack/platform/plugins/shared/triggers_actions_ui/.storybook/context/http.ts # x-pack/solutions/observability/plugins/apm/public/components/app/service_map/__stories__/cytoscape_example_data.stories.tsx # x-pack/solutions/security/plugins/security_solution/public/entity_analytics/components/asset_criticality_file_uploader/asset_criticality_file_uploader.stories.tsx # yarn.lock
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
Contributor
|
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
Contributor
|
Pinging @elastic/kibana-operations (Team:Operations) |
jbudz
approved these changes
Mar 18, 2025
Contributor
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
Unreferenced deprecated APIs
History
cc @Ikuni17 |
Ikuni17
added a commit
that referenced
this pull request
Mar 24, 2025
## Summary These Stories were missed in [Upgrade to Storybook 8 (#195148)](#195148) and should be migrated to the same format as other stories for consistency and to make future migrations easier. They technically work in SB8, I forgot to run the migration script again later on while working on the original PR. The changes have already been backported to #214680 and #214681
cqliu1
pushed a commit
to cqliu1/kibana
that referenced
this pull request
Mar 31, 2025
## Summary These Stories were missed in [Upgrade to Storybook 8 (elastic#195148)](elastic#195148) and should be migrated to the same format as other stories for consistency and to make future migrations easier. They technically work in SB8, I forgot to run the migration script again later on while working on the original PR. The changes have already been backported to elastic#214680 and elastic#214681
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.0:Questions ?
Please refer to the Backport tool documentation