[Chore] Update Storybook to latest v10 - #9863
Conversation
dbf5fb2 to
23e84f1
Compare
There was a problem hiding this comment.
Pull request overview
This PR upgrades EUI’s Storybook tooling to the latest v10 release, updating Storybook configuration and migrating stories/tests to the new module entrypoints used by Storybook 10 and newer Testing Library APIs.
Changes:
- Upgrades Storybook (and related tooling like
@storybook/test-runner,eslint-plugin-storybook) and migrates story imports (e.g.,@storybook/react-webpack5,storybook/actions,storybook/test). - Adjusts TypeScript project boundaries so package
tscexcludes*.stories.*while.storybook/tsconfig.jsontypechecks Storybook sources/stories, and adds this check to thelintscript. - Updates several Jest/RTL tests for
@testing-library/user-eventv14 async behavior and ensures Jest transpiles thestorybookpackage when needed.
Reviewed changes
Copilot reviewed 273 out of 275 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eui/package.json | Bumps Storybook + user-event versions and related dev tooling for v10 compatibility |
| packages/eui/tsconfig.json | Excludes story files from the package TS program (delegates to Storybook TS config) |
| packages/eui/.storybook/tsconfig.json | Expands Storybook TS includes (stories + d.ts) and switches to moduleResolution: bundler |
| packages/eui/.storybook/main.ts | Updates Storybook v10 config (stories glob, addons, webpack alias for storybook/test) |
| packages/eui/.storybook/preview.tsx | Migrates viewport import and normalizes highContrastMode global value handling |
| packages/eui/.storybook/decorator.tsx | Updates toolbar globals typing/values to match new globals handling |
| packages/eui/.storybook/utils.ts | Migrates actions import to storybook/actions |
| packages/eui/.storybook/test.ts | Migrates Storybook test utilities import to storybook/test |
| packages/eui/.storybook/vrt.ts | Migrates CSF type import to Storybook v10 internal CSF entrypoint |
| packages/eui/.storybook/test-runner.ts | Keeps VRT test runner integration compatible with updated Storybook toolchain |
| packages/eui/scripts/jest/config.js | Ensures Jest transpiles storybook package from node_modules |
| packages/eui/.storybook/emotion-css-prop.d.ts | Adds Storybook-local Emotion css prop typing support |
| packages/eui/.storybook/addons/code-snippet/event-handlers/query_params.ts | Migrates manager API import paths (and needs type-only imports per review comment) |
| packages/eui/.storybook/addons/code-snippet/event-handlers/setup.ts | Migrates core-events import path (and needs type-only import per review comment) |
| packages/eui/.storybook/addons/code-snippet/decorators/jsx_decorator.tsx | Updates addon internals to new Storybook module entrypoints |
| packages/eui/src/components/date_picker/super_date_picker/super_date_picker.test.tsx | Updates user-event usage to v14 patterns (including setup for fake timers) |
| packages/eui/src/components/search_bar/search_bar.test.tsx | Updates user-event import + async act usage |
| packages/eui/src/components/tool_tip/tool_tip.test.tsx | Updates user-event import + async act usage |
| packages/eui/src/components/flyout/manager/flyout_managed.test.tsx | Updates user-event import + async act usage |
| packages/eui/src/components/datagrid/controls/display_selector.test.tsx | Updates user-event import + async interaction helpers |
| packages/eui/src/components/date_picker/super_date_picker/date_popover/absolute_tab.test.tsx | Switches from Storybook user-event to RTL user-event for Jest environment |
| packages/eui/src/components///*.stories.tsx | Bulk migration of story Meta/StoryObj imports to @storybook/react-webpack5 and actions/tests to storybook/* entrypoints |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1d1f793 to
a806577
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 275 out of 277 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/eui/.storybook/preview.tsx:36
highContrastModeis currently derived via a strict string check (=== 'true'). A number of stories setglobals: { highContrastMode: true }(boolean), which will now be coerced tofalsehere and prevent those stories from rendering in high contrast mode.
<EuiProviderDecorator
colorMode={context.globals.colorMode}
highContrastMode={context.globals.highContrastMode === 'true'}
{...(context.componentId === 'theming-euiprovider' && context.args)}
b2d9202 to
d1ae41a
Compare
50 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuiconfirmmodal (2 differences)
euiflyout (18 differences)
euiheader (5 differences)
euimodal (14 differences)
euicollapsiblenav (4 differences)
euidatagrid (5 differences)
euioverlaymask (2 differences)
|
d1ae41a to
cbbd409
Compare
25 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuiflyout (14 differences)
euiheader (4 differences)
euicollapsiblenav (4 differences)
euidatagrid (3 differences)
|
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (2 differences)
|
Storybook 10 requires Node.js 20.19+ or 22.12+.
6d12f3f to
a459c2a
Compare
8 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuiflyout (6 differences)
euidatagrid (2 differences)
|
0769df3 to
a459c2a
Compare
7 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuiflyout (6 differences)
euidatagrid (1 difference)
|
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (1 difference)
|
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (1 difference)
|
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (2 differences)
|
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (1 difference)
|
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (2 differences)
|
3 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (3 differences)
|
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselineseuidatagrid (1 difference)
|
|
buildkite test this Adding |
💚 Build Succeeded
History
|
💔 Build Failed
Failed CI StepsHistory
|





































































































































































Important
No need to review all 275 files changed. The bulk of the change is updated imports: a6cc857
Note
This doesn't affect EUI production. Only local dev and CI.
Summary
Closes https://github.com/elastic/eui-private/issues/738
Storybook v8.4 → v10.5 (releases, migration guide)
@storybook/addon-essentials,@storybook/test,@storybook/manager-api, etc.), their functionality ships in thestorybookpackage; imports updated accordingly (@storybook/addon-actions→storybook/actions,@storybook/test→storybook/test...),@storybook/react-webpack5instead of@storybook/react(because of the newstorybook/no-renderer-packageslint rule;eslint-plugin-storybookbumped tov10.5,.storybook/config updated to the new APIs; newemotion-css-prop.d.tstypes thecssprop so Emotion'sThemeresolves to the copy augmented byUseEuiTheme,v10types requiremoduleResolution: "bundler") and instead evaluated by.storybook/tsconfig.jsonwhichyarn lintruns as a second tsc pass,@testing-library/user-eventupgradedv13→v14(replaces the removed@storybook/test'suserEvent): 7 test suites migrated to the async APIs, plusadvanceTimerssetup for fake-timer tests,storybookadded to jest'stransformIgnorePatternsexceptions (v10ships ESM-only dist),.nvmrc); Storybook v10 requires Node ≥20.19, CI had 20.15.1,QA instructions for reviewer
yarn workspace @elastic/eui startruns without errors,yarn lint/test-*pass).