feat(storybook): support Storybook 11 - #381
Merged
Merged
Conversation
Verified against storybook@11.0.0-alpha.0 following the addon migration guide (https://storybook.js.org/docs/11/addons/addon-migration-guide). Every internal the package relies on still exists, and the Vitest suite passes end to end on 11. - Declare the `storybook` peer range (8 through 11, including the 11 pre-releases) as the guide recommends. - Resolve viewports from the Storybook 9+ `viewport.options` parameter and the `{ value, isRotated }` global, keeping the legacy `viewports` and `defaultViewport` shapes. Storybook 10 removed `defaultViewport`, so modes with viewports silently kept the default size on current configs. - Add an `e2e-storybook-next` CI job that runs the Vitest suite against the newest Storybook 11 pre-release. The Test Runner suite is left out: Storybook 11's config loader calls `module.register()`, which Jest refuses, so `@storybook/test-runner` cannot load its config yet. - Bump `@storybook/test-runner` to 0.24.5 (first release declaring 11 support) and align Playwright on 1.63.0 so a single `playwright-core` is resolved. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jsfez
approved these changes
Sep 12, 2026
pull Bot
pushed a commit
to Jimimaku/docs.argos-ci.com
that referenced
this pull request
Sep 13, 2026
Companion to argos-ci/argos-javascript#381, which makes @argos-ci/storybook resolve viewports from the Storybook 9+ `viewport.options` parameter and the `{ value, isRotated }` global. - Story modes guide: viewports and backgrounds are built into Storybook 9+ and configured through `options` maps, and a mode selects a background by key. A hint keeps the Storybook 8 format (`viewports`, `values`, color as value) for readers still on 8. - SDK reference: a Compatibility section (Storybook 8 through 11, Vitest 4 or 5, Node.js 22) and a Viewports section describing how a mode's or a story's `viewport` global is resolved. - Storybook Quickstart: the Vitest addon requires Storybook 9 or later. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Makes
@argos-ci/storybookcompatible with Storybook 11, checked point by point against the addon migration guide and the 10 → 11 migration notes.Storybook 11 is only available as
11.0.0-alpha.0(nexttag) today. The package has no manager or preview code, so most of the guide does not apply (nodefinePreviewAddon,setConfiglayout options,TABaddon type,useThemeParameters, icons, or index parsing). What did apply is below.Changes
storybookas a peer dependency. It now declares^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0-0. 8 is included because the Test Runner flow has no runtime dependency on thestorybookpackage and the docs list Storybook 8+ for it; the Vitest flow needs 9+ (@storybook/addon-vitestandstorybook/preview-apionly exist from 9).^11.0.0-0keeps the 11 pre-releases in range, as@storybook/test-runnerdoes.viewport.viewportstoviewport.optionsand turned theviewportglobal into{ value, isRotated }; Storybook 10 removeddefaultViewport.getViewportonly understood the legacy shapes, so an Argos mode such as{ viewport: "ipad" }silently kept the default size on a current config. It now readsoptionsfirst and falls back toviewports, accepts string, number and{ value, isRotated }globals, and honors rotation (including the legacydefaultOrientation: "landscape"). Unit tests added. The fixture preview moved tooptions, and the mode screenshots' metadata confirms the sizes (mobile 428×926, tablet 768×1024).e2e-storybook-nextjob: upgrades the package to the newest Storybook 11 pre-release (>=11.0.0-0 <12.0.0-0ranges, sominimumReleaseAgestill applies) and runs the Vitest suite under its own build name, mirroring the Vitest 4 compat job. Backed by ane2e-nextscript and Turborepo task.@storybook/test-runner0.24.4 → 0.24.5, the first release declaring^11.0.0-0. When its Jest dependencies are re-resolved (aspnpm updid locally), Jest 30.5 pulls in@parcel/watcher, whose install script pnpm 11 refuses (ERR_PNPM_IGNORED_BUILDS) and fails the install; it is denied inallowBuildsso neither the workspace nor the Storybook 11 job trips on it. Playwright 1.62.1 → 1.63.0 across the three packages so the workspace and the test runner resolve oneplaywright-core(otherwisetscfails on two incompatiblePagetypes).Verification
storybook buildEvery internal the package touches still exists in 11:
addons.hasChannel/setChannel,storybook/internal/channels,ComposedStoryFn, the__STORYBOOK_PREVIEW__and__STORYBOOK_ADDONS_PREVIEWglobals,channel.last, theglobalsUpdatedpayload'sinitialGlobals, andcontext.storyin the Vitest addon.The Test Runner failure on 11 is not ours: Storybook 11's
importModule(used byserverRequireto load.storybook/test-runner.ts) now callsmodule.register(), which jest-runtime 30 rejects ("module.register() is not supported in Jest") before any Argos code loads. No upstream issue exists yet. The new CI job therefore covers the Vitest flow only, with a comment saying why.Review notes
globals.viewport(for example{ value: "mobile1" }) is now screenshotted at that size instead of the default. This matches what Storybook renders and how the legacydefaultViewportwas already honored, but it can move baselines for users who relied on the global being ignored.🤖 Generated with Claude Code