Skip to content

chore(deps): upgrade Storybook 10.4.6 → 10.5.10, drop hold-back pins - #1945

Merged
misama-ct merged 2 commits into
mainfrom
chore-storybook-10-5-upgrade
Aug 25, 2026
Merged

chore(deps): upgrade Storybook 10.4.6 → 10.5.10, drop hold-back pins#1945
misama-ct merged 2 commits into
mainfrom
chore-storybook-10-5-upgrade

Conversation

@misama-ct

@misama-ct misama-ct commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Storybook was pinned exact at 10.4.6 since #1762. The regression that forced that pin is fixed upstream, so this moves the whole group to ^10.5.10 and removes the hold-back machinery.

The blocker, and why it's gone

Storybook 10.5.0 installed an accessor on HTMLElement.prototype.focus whose getter returned the raw native focus on a second read within the same tick. @zag-js/focus-visible's setupGlobalFocusEvents reads exactly that:

// @zag-js/focus-visible/dist/index.mjs:73
let focus = win.HTMLElement.prototype.focus;

The receiver there is HTMLElement.prototype, not an element, so invoking the native focus threw Illegal invocation — flaking a varying set of browser story files per run.

Note: the old pin note credited react-aria's setupGlobalFocusEvents. The actual caller is Chakra's zag focus-visible.

Fixed upstream in 10.5.8 via storybookjs/storybook#35528 — the getter now short-circuits when the receiver is the prototype:

get() {
  if (this === HTMLElement.prototype) return currentFocus;
  ...
}

Confirmed by bisecting the published tarballs: the guard is absent in 10.5.0–10.5.7 and present from 10.5.8 onward. Latest is 10.5.10 (published 2026-08-20, so it clears the repo's 24h minimumReleaseAge gate).

Changes

  • catalogs.toolingstorybook, eslint-plugin-storybook, @storybook/addon-a11y, @storybook/addon-docs, @storybook/addon-vitest, @storybook/react-vite move from exact pins to ^10.5.10, restoring the pre-pin caret convention.
  • overrides — dropped all four transitive hold-backs (@storybook/react, @storybook/react-dom-shim, @storybook/builder-vite, @storybook/csf-plugin). They're genuinely unnecessary now: the copies pulled by the @github-ui / @vueless addons resolve to 10.5.10 on their own. The lockfile now carries exactly one version of every Storybook package and shrinks by ~160 net lines.
  • No leftover commentary. The removed pins are simply gone — storybook: ^10.5.10 is an ordinary caret range like every other catalog entry and carries no explanation. The history lives in the commit messages and this PR. (See docs(claude): add an Implementation Comments rule #1946, which makes that a standing rule; the second commit here is the cleanup.)

The only 10.4 → 10.5 migration note is the ExternalDocs deprecation, which this repo doesn't use.

Verification

Since the original bug was flaky, a single green run isn't proof — so this was run repeatedly, including with retries disabled.

Check Result
pnpm test (full suite) 252 files, 3252 passed
pnpm test:storybook ×4 100 files, 1225 passed each
pnpm vitest run --project=storybook --retry=0 ×2 1225 passed — confirms no flake hidden behind the config's retry: 1
pnpm test:storybook:dev 100 files, 1225 passed
pnpm typecheck:strict pass
pnpm lint 0 errors (2 pre-existing react-hooks warnings, unrelated)
pnpm build / pnpm build:storybook both succeed
minimumReleaseAgeExclude appended? no — supply-chain gate intact
pnpm peers check no Storybook peer issues

Eight consecutive green browser-story runs, two with retries fully disabled. No Illegal invocation anywhere.

The second commit is comment-only; pnpm install --frozen-lockfile passes unchanged on it, so resolution is identical and the results above still hold.

Notes for reviewers

  • No changeset — devDependency-only tooling change, no consumer-visible effect (per docs/changeset-conventions.md: skip "tooling or CI changes that don't affect consumers").
  • The setProjectAnnotations info notice in test output is pre-existing — it's in @storybook/addon-vitest@10.4.6 too, not introduced here. Storybook has auto-applied preview annotations since 10.3, so packages/nimbus/.storybook/vitest.setup.ts could drop that call as separate optional cleanup.
  • @github-ui/storybook-addon-performance-panel (1.1.4 → 1.2.0) and chromatic (18.2.0 → 18.5.0) have newer releases but resolved at their existing versions. Deliberately left alone — outside this upgrade's scope; Renovate's storybook group will pick them up.
  • Worth a manual full-snapshot Chromatic run on this PR, since the story runtime changed. See docs/chromatic-ci.md.

🤖 Generated with Claude Code

The Storybook group was pinned exact at 10.4.6 (PR #1762) because 10.5.0
installed an accessor on HTMLElement.prototype.focus whose getter returned
the raw native focus on a second read within the same tick.
@zag-js/focus-visible's setupGlobalFocusEvents reads exactly that:

    let focus = win.HTMLElement.prototype.focus;   // dist/index.mjs:73

The receiver there is HTMLElement.prototype, not an element, so invoking
the native focus threw "Illegal invocation" and flaked a varying set of
browser story files per run. (The old pin note credited react-aria; the
actual caller is Chakra's zag focus-visible.)

Fixed upstream in 10.5.8 via storybookjs/storybook#35528 — the getter now
short-circuits when the receiver is the prototype:

    get() {
      if (this === HTMLElement.prototype) return currentFocus;
      ...
    }

Verified by bisecting the published tarballs: the guard is absent in
10.5.0-10.5.7 and present from 10.5.8 onward.

Changes:
- catalogs.tooling: storybook, eslint-plugin-storybook, @storybook/addon-a11y,
  @storybook/addon-docs, @storybook/addon-vitest and @storybook/react-vite
  move from exact pins to ^10.5.10, restoring the pre-pin caret convention.
- overrides: dropped the four transitive hold-backs (@storybook/react,
  @storybook/react-dom-shim, @storybook/builder-vite, @storybook/csf-plugin).
  They are no longer needed — the copies pulled by the @github-ui and
  @vueless addons resolve to 10.5.10 on their own. The lockfile now carries
  exactly one version of every Storybook package and shrinks by ~160 lines.

The only 10.4 -> 10.5 migration note is the ExternalDocs deprecation, which
this repo does not use.

Verification:
- pnpm test: 252 files, 3252 tests passed
- pnpm test:storybook: 4 consecutive runs, 100 files / 1225 tests each
- pnpm vitest run --project=storybook --retry=0: 2 runs green, confirming no
  flake was hidden behind the config's retry: 1
- pnpm test:storybook:dev: 100 files, 1225 tests passed
- pnpm typecheck:strict, pnpm lint (0 errors), pnpm build,
  pnpm build:storybook: all pass
- no minimumReleaseAgeExclude block appended; no Storybook peer issues

No changeset: devDependency-only tooling change with no consumer-visible
effect.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@misama-ct
misama-ct requested a review from a team as a code owner August 25, 2026 07:47
@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 83a75f2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Aug 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nimbus-documentation Ready Ready Preview Aug 25, 2026 8:21am
nimbus-storybook Ready Ready Preview Aug 25, 2026 8:21am

Request Review

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

Last updated: 2026-08-25 08:21:33 UTC

Package Format Current Baseline Delta Status
@commercetools/nimbus dist 18993.4 KB 18993.4 KB +0.0% ✅ ok
@commercetools/nimbus-icons dist 4787.6 KB 4787.6 KB +0.0% ✅ ok
@commercetools/nimbus-tokens dist 408.9 KB 408.9 KB +0.0% ✅ ok

Baseline source: comment-chain

@chromatic-com

chromatic-com Bot commented Aug 25, 2026

Copy link
Copy Markdown

Tip

All tests passed and all changes approved!

🟢 UI Tests: 347 tests unchanged
🟢 UI Review: No changes
Storybook icon Storybook Publish: 1226 stories published

Removing the pins and overrides in the previous commit left 12 lines of
comment describing them: 9 in `overrides` where the four @storybook/* entries
had been, and 3 above the catalog entries pointing back at those. Both
described a workaround the file no longer contains.

`storybook: ^10.5.10` is an ordinary caret range like every other entry in
the catalog and needs no explanation. The regression, the upstream fix and
the reasoning stay in the previous commit message and in the PR.

Comment-only: `pnpm install --frozen-lockfile` passes unchanged, so
resolution is identical and the verification on the previous commit still
holds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@misama-ct
misama-ct merged commit d152cf6 into main Aug 25, 2026
13 checks passed
@misama-ct
misama-ct deleted the chore-storybook-10-5-upgrade branch August 25, 2026 08:35
@github-actions github-actions Bot added the bundle-sizes Housekeeping for merged PRs - allows the fetch sizes script to find the latest bundle check comment. label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bundle-sizes Housekeeping for merged PRs - allows the fetch sizes script to find the latest bundle check comment.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant