Repository navigation
feat: update to Storybook 11 - #931
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 872ab39 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
1 of 9 tasks
1 of 3 tasks
ndelangen
approved these changes
Oct 20, 2026
dannyhw
force-pushed
the
chore/storybook-v11
branch
from
October 21, 2026 18:44
4ad50b0 to
872ab39
Compare
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.
Summary
Updates every Storybook dependency to
11.0.0-alpha.6(the currentnexton npm) and ports@storybook/react-nativeto the Storybook 11 API changes.Dependencies
pnpm update-storybook-deps --version ^11.0.0-alpha.6to updatestorybook,@storybook/reactand@storybook/react-native-web-viteacross packages and examples.@storybook/mcpand@storybook/addon-react-native-serverare skipped by the script's ignore list.storybookpeer range (and@storybook/reactfor the notes addon) to^11.0.0-alpha.6. The script doesn't touch peers.Story sorting:
storySortin preview →storySortsin mainStorybook 11 no longer reads
parameters.options.storySortfrom preview. Sorting is configured with astorySortsarray in main instead, where each sorter only orders the stories the sorters before it consider equal. This PR matches that: previewstorySortis no longer read, with no fallback or warning, same as core. Users can runnpx storybook automigrate story-sort-to-main --config-dir .rnstorybook, which I checked works on an RN config.main.storySortsis supported as an array or as a preset function.sortIndexEntrieshelper shared byprepareStories(device) andbuildIndex(Metro / channel server / MCP). Core doesn't exportcombineStorySorts, so this calls core'ssortStoriesV7once per sorter, as stable sorts from last to first, which gives the same order.storySortsintostorybook.requiresand passes it tostart()/updateView(). Objects and arrays are written as JSON and functions as source text, so comparators can't reference anything outside their own body. Other options considered: plain values only, bundlingmain, sorting at generate time, or asking the channel server for the index. Each breaks offline use, stories added during a session, or core's comparator support.presets.apply('storySorts')) aren't collected. On-device addons don't go through core presets.MIGRATION.mdnow usestorySortsin main.CSF factories types
Meta's second type parameter instorybook/internal/csfchanged from the meta annotations to a union of meta arg keys.RNPreview/RNMeta/RNStorynow mirror Storybook 11'sReactPreview/ReactMeta/ReactStoryand use the newMetaInput,MetaTypes,StoryArgsandTypedMetaArgKeyshelpers. They also gainmeta.type<T>().Controls
InputType.defaultValueis now typednever, socontrolArgTypes.tscasts the localArgTypetoInputTypewhen callingincludeConditionalArg.Testing
pnpm build,pnpm check:types,pnpm format:check, eslint on the changed files, andpnpm --filter expo-example check(which type-checks the factory stories) all pass.pnpm testpasses. New coverage:sortStories.test.ts: the chaining is checked against core's own comparators, captured fromsortStoriesV7, combined with a copy of core'scombineStorySortson random story sets.storySorts.test.ts:start()/updateView()sort the device index, including stories added on update, and ignore previewstorySort.tests/scripts/generate.test.ts: the emittedstorySortsis evaluated and round-trips objects, nested orders, quoted strings, arrow / named / multi-line functions and preset functions. The typed.tsoutput passes astricttype check, and nothing is emitted withoutstorySorts.tests/scripts/buildIndex.test.ts: array, preset function, and no sorters with previewstorySortignored.