Skip to content

chore(deps): bump Storybook v8 → v9 across all workspaces#111169

Open
paulopmt1 wants to merge 2 commits into
trunkfrom
storybook/v8-to-v9
Open

chore(deps): bump Storybook v8 → v9 across all workspaces#111169
paulopmt1 wants to merge 2 commits into
trunkfrom
storybook/v8-to-v9

Conversation

@paulopmt1
Copy link
Copy Markdown
Contributor

Part of #106728

Proposed Changes

PR 1 of 3 toward Storybook v10. Bumps Storybook from 8.6.x to 9.x atomically across the 13 workspaces that depend on it.

  • storybook: ^8.6.17 → ^9.1.20 (root + client + 11 packages)
  • @storybook/react: ^8.6.14 → ^9.1.20 (root + components)
  • @storybook/react-webpack5: ^8.6.14 → ^9.1.20 (calypso-storybook + grid)
  • @storybook/addon-a11y: ^8.6.14 → ^9.1.20 (domain-search, launchpad, onboarding)
  • @storybook/addon-themes: ^8.6.14 → ^9.1.20 (calypso-storybook)
  • @storybook/addon-docs: ^8.6.14 → ^9.1.20 (calypso-storybook + grid)
  • @storybook/addon-actions/-controls/-toolbars/-viewport: ^8.6.14 → ^9.0.8 — these v9 packages are now empty shims since the functionality moved into Storybook core; the version bump is required to satisfy peer deps but the packages themselves are no-ops. They'll be removed entirely in PR 2.
  • Drop @storybook/test (no v9 release; the fn API is now bundled in storybook core under storybook/test).

Import migrations forced by v9 module reorganization:

  • @storybook/teststorybook/test
  • @storybook/preview-apistorybook/preview-api
  • @storybook/blocks@storybook/addon-docs/blocks
  • @storybook/addon-actions (action) → storybook/actions
  • @storybook/react: StoryStoryFn (the v6 alias was removed)

Fix for packages/components/src/button/index.stories.tsx: v9's StoryObj<typeof meta> now intersects the component's union prop type, which can't be satisfied by stories that only set props from one branch (ButtonProps vs AnchorProps). Typed Story over ButtonProps directly and split off a LinkArgs type for the Link story.

Why are these changes being made?

The Storybook 8 → 10 migration can't be done in isolation because every @storybook/* package declares a storybook: ^X.x peer dep that must align with the installed Storybook core. Yarn CI fails on YN0060 (Invalid peer dependency) warnings (.teamcity/_self/projects/WebApp.kt:435), so partial bumps (like #111139) can't land.

This PR establishes the v9 baseline so subsequent PRs in the stack can move incrementally:

  • PR 2 (stacked off this): remove the now-empty shim addon entries from package.json files and the shared calypso-storybook addons array — purely a cleanup.
  • PR 3 (stacked off PR 2): bump v9 → v10. The delta is smaller and the breaking changes are isolated from this PR's v8→v9 noise.

Each major-jump PR is mechanically uniform across the 13 workspaces, so review focuses on whether the .storybook/main.{ts,js} configs and stories still work — not on file count.

Supersedes #111139 (split-out a11y bump from #106728) — once PR 3 lands, that one can be closed.

Testing Instructions

  1. yarn install should complete with no YN0060 warnings.
  2. yarn typecheck-packages should pass.
  3. yarn typecheck-client shows only pre-existing @automattic/omnibar and @automattic/date-range-picker "Cannot find module" errors (already present on trunk, unrelated).
  4. yarn workspace @automattic/domain-search storybook:start should boot Storybook 9.1.20 successfully — verified locally.

Pre-merge Checklist

  • Has the general commit checklist been followed?
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple, Atomic, and self-hosted Jetpack sites?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes?
  • Have you used memoizing on expensive computations?
  • Have we added the "[Status] String Freeze" label?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label?

@github-actions
Copy link
Copy Markdown

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 111169
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 111169
    

1 similar comment
@github-actions
Copy link
Copy Markdown

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 111169
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 111169
    

@paulopmt1 paulopmt1 force-pushed the storybook/v8-to-v9 branch from bdf1fb9 to af27e38 Compare May 29, 2026 18:45
Atomic upgrade of storybook core and addons from 8.6.x to 9.x because
the storybook peer dep on every consuming addon requires alignment.

In v9 several packages (addon-actions/controls/toolbars/viewport) are
now empty shims since the functionality moved into storybook core; the
version bump is required to satisfy peer deps but the packages are
no-ops. @storybook/test has no v9 release — the `fn` API is now
re-exported from storybook core via `storybook/test`.

Migrate imports that changed paths in v9:
- @storybook/test → storybook/test
- @storybook/preview-api → storybook/preview-api
- @storybook/blocks → @storybook/addon-docs/blocks
- @storybook/addon-actions (action) → storybook/actions
- @storybook/react: Story → StoryFn (v6 alias removed)

Fix Button stories: v9's StoryObj<typeof meta> intersects the
component's union prop type, which can't be satisfied by stories that
only set props from one branch (ButtonProps vs AnchorProps). Type
Story over ButtonProps and split off LinkArgs for the Link story.

PR 1 of 3 toward Storybook v10. PR 2 removes the empty-shim addon
entries; PR 3 bumps v9 → v10.
@paulopmt1 paulopmt1 force-pushed the storybook/v8-to-v9 branch from af27e38 to 3ca69b4 Compare May 29, 2026 19:09
@matticbot
Copy link
Copy Markdown
Contributor

matticbot commented May 29, 2026

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • help-center

To test WordPress.com changes, run install-plugin.sh $pluginSlug storybook/v8-to-v9 on your sandbox.

@paulopmt1 paulopmt1 marked this pull request as ready for review May 29, 2026 19:38
@paulopmt1 paulopmt1 requested review from a team and youknowriad as code owners May 29, 2026 19:38
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 29, 2026
@paulopmt1
Copy link
Copy Markdown
Contributor Author

Next is to fix this issue:

image

Storybook 9 folded addon-controls/actions/toolbars/viewport into core, so
their leftover registrations and devDependencies threw "package no longer
exists" at preview load. Remove them from the shared config and package.json files.

Also wire a configurable sass prelude into the shared sass-loader and pass
the app's `@use 'calypso/assets/stylesheets/shared/_utils.scss'` prelude
(plus the `calypso` alias) from the root Storybook, so shared mixins like
long-content-fade resolve when stories pull in @automattic/search.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@paulopmt1
Copy link
Copy Markdown
Contributor Author

Ok, fixed:

image

@paulopmt1
Copy link
Copy Markdown
Contributor Author

Will deploy this Monday morning as it's EOD for me right now.

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

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants