Skip to content

[Chore] Update Storybook to latest v10 - #9863

Open
weronikaolejniczak wants to merge 11 commits into
elastic:mainfrom
weronikaolejniczak:chore/update-storybook
Open

[Chore] Update Storybook to latest v10#9863
weronikaolejniczak wants to merge 11 commits into
elastic:mainfrom
weronikaolejniczak:chore/update-storybook

Conversation

@weronikaolejniczak

@weronikaolejniczak weronikaolejniczak commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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)

  • Consolidated packages removed (@storybook/addon-essentials, @storybook/test, @storybook/manager-api, etc.), their functionality ships in the storybook package; imports updated accordingly (@storybook/addon-actionsstorybook/actions, @storybook/teststorybook/test ...),
  • stories import types from @storybook/react-webpack5 instead of @storybook/react (because of the new storybook/no-renderer-packages lint rule; eslint-plugin-storybook bumped to v10.5,
  • .storybook/ config updated to the new APIs; new emotion-css-prop.d.ts types the css prop so Emotion's Theme resolves to the copy augmented by UseEuiTheme,
  • stories are excluded from the main tsconfig (v10 types require moduleResolution: "bundler") and instead evaluated by .storybook/tsconfig.json which yarn lint runs as a second tsc pass,
  • @testing-library/user-event upgraded v13v14 (replaces the removed @storybook/test's userEvent): 7 test suites migrated to the async APIs, plus advanceTimers setup for fake-timer tests,
  • storybook added to jest's transformIgnorePatterns exceptions (v10 ships ESM-only dist),
  • CI image bumped to Node 22.22.0 (matches .nvmrc); Storybook v10 requires Node ≥20.19, CI had 20.15.1,
  • make CI container resolve IPv4 first, otherwise it breaks Playwright browser downloads because of unroutable IPv6 addresses.

QA instructions for reviewer

  • yarn workspace @elastic/eui start runs without errors,
  • random stories render correctly (spot-check a few components),
  • controls panel works (change args, function toggles),
  • actions panel logs events,
  • code Snippet panel shows correct JSX per story,
  • toolbar: light/dark mode switch works,
  • toolbar: high contrast mode switch works,
  • toolbar: writing mode (LTR/RTL/vertical) switch works,
  • toolbar: theme switcher works,
  • viewport switching works,
  • query params (e.g. shared story links) still resolve,
  • CI is green (VRT passes, yarn lint/test-* pass).

@weronikaolejniczak weronikaolejniczak self-assigned this Aug 3, 2026
@weronikaolejniczak weronikaolejniczak added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tsc excludes *.stories.* while .storybook/tsconfig.json typechecks Storybook sources/stories, and adds this check to the lint script.
  • Updates several Jest/RTL tests for @testing-library/user-event v14 async behavior and ensures Jest transpiles the storybook package 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.

Comment thread packages/eui/.storybook/addons/code-snippet/event-handlers/query_params.ts Outdated
Comment thread packages/eui/.storybook/addons/code-snippet/event-handlers/setup.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • highContrastMode is currently derived via a strict string check (=== 'true'). A number of stories set globals: { highContrastMode: true } (boolean), which will now be coerced to false here 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)}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 281 out of 283 changed files in this pull request and generated no new comments.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
50 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euiconfirmmodal (2 differences)

StoryBeforeAfterDiff
playground desktop
playground mobile

euiflyout (18 differences)

StoryBeforeAfterDiff
high contrast desktop
high contrast mobile
playground desktop
playground mobile
push flyouts desktop
push flyouts mobile
playground desktop
playground mobile
playground desktop
playground mobile
playground desktop
playground mobile
menu bar example desktop
menu bar example mobile
pagination example desktop
pagination example mobile
playground desktop
playground mobile

euiheader (5 differences)

StoryBeforeAfterDiff
elastic navigation pattern desktop
elastic navigation pattern mobile
multiple fixed headers desktop
multiple fixed headers mobile
popover example mobile

euimodal (14 differences)

StoryBeforeAfterDiff
initial focus desktop
initial focus mobile
playground desktop
playground mobile
toggle example desktop
toggle example mobile
playground desktop
playground mobile
playground desktop
playground mobile
playground desktop
playground mobile
playground desktop
playground mobile

euicollapsiblenav (4 differences)

StoryBeforeAfterDiff
full header pattern desktop
full header pattern mobile
playground desktop
playground mobile

euidatagrid (5 differences)

StoryBeforeAfterDiff
full screen with flyout desktop
full screen with flyout mobile
compact desktop
column selector desktop
column selector mobile

euioverlaymask (2 differences)

StoryBeforeAfterDiff
playground desktop
playground mobile

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
25 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euiflyout (14 differences)

StoryBeforeAfterDiff
playground desktop
playground mobile
playground desktop
playground mobile
playground desktop
playground mobile
playground desktop
playground mobile
menu bar example desktop
menu bar example mobile
pagination example desktop
pagination example mobile
playground desktop
playground mobile

euiheader (4 differences)

StoryBeforeAfterDiff
elastic navigation pattern desktop
elastic navigation pattern mobile
multiple fixed headers mobile
popover example mobile

euicollapsiblenav (4 differences)

StoryBeforeAfterDiff
full header pattern desktop
full header pattern mobile
playground desktop
playground mobile

euidatagrid (3 differences)

StoryBeforeAfterDiff
full screen with flyout mobile
column selector desktop
column selector mobile

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (2 differences)

StoryBeforeAfterDiff
full screen with header desktop
compact desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
8 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euiflyout (6 differences)

StoryBeforeAfterDiff
playground desktop
playground mobile
pagination example desktop
pagination example mobile
playground desktop
playground mobile

euidatagrid (2 differences)

StoryBeforeAfterDiff
full screen with header desktop
compact desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
7 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euiflyout (6 differences)

StoryBeforeAfterDiff
playground desktop
playground mobile
pagination example desktop
pagination example mobile
playground desktop
playground mobile

euidatagrid (1 difference)

StoryBeforeAfterDiff
compact desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (1 difference)

StoryBeforeAfterDiff
keyboard shortcuts desktop

@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review August 6, 2026 10:52
@weronikaolejniczak
weronikaolejniczak requested a review from a team as a code owner August 6, 2026 10:52
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (1 difference)

StoryBeforeAfterDiff
compact desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (2 differences)

StoryBeforeAfterDiff
full screen toggle desktop
full screen toggle mobile

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (1 difference)

StoryBeforeAfterDiff
no toolbar desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
2 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (2 differences)

StoryBeforeAfterDiff
compact desktop
no toolbar desktop

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
3 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (3 differences)

StoryBeforeAfterDiff
compact desktop
keyboard shortcuts desktop
no toolbar desktop

@weronikaolejniczak
weronikaolejniczak marked this pull request as draft August 10, 2026 08:04
@weronikaolejniczak weronikaolejniczak added the skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR) label Aug 10, 2026
@weronikaolejniczak
weronikaolejniczak marked this pull request as ready for review August 10, 2026 14:41
@weronikaolejniczak weronikaolejniczak removed the skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR) label Aug 10, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
1 visual difference(s) found - expand to review, then click Approve visual changes to update baselines

euidatagrid (1 difference)

StoryBeforeAfterDiff
compact desktop

@weronikaolejniczak weronikaolejniczak added the skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR) label Aug 10, 2026
@weronikaolejniczak

Copy link
Copy Markdown
Contributor Author

buildkite test this

Adding skip-vrt because of this flake that's on main

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @weronikaolejniczak

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💔 Build Failed

Failed CI Steps

History

cc @weronikaolejniczak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) skip-vrt Skips Visual Regression Testing job in CI (clearly state why you're using it in your PR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants