Repository navigation
Conversation
Move the Actions panel from @storybook/addon-ondevice-actions into @storybook/react-native, registered from start() when features.ondeviceActions is set, following the ondeviceBackgrounds precedent. It reuses the storybook/actions addon id, so a leftover package entry in deviceAddons is replaced rather than duplicated, and a development warning suggests removing it.
🦋 Changeset detectedLatest commit: cd8eb0f 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 |
The built-in Actions panel now registers unless features.ondeviceActions is false. @storybook/addon-ondevice-actions becomes a compatibility stub whose register is a no-op that warns once in development, so configs that still list it get exactly one panel from @storybook/react-native. Its duplicated source, tests and jest setup are removed. Docs, templates, the stories skill and MIGRATION.md no longer install or list the package.
# Conflicts: # packages/ondevice-actions/package.json # packages/react-native/package.json # pnpm-lock.yaml
This branch has not been deployed
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.
What
The on-device Actions panel is now built into
@storybook/react-nativeand enabled by default.@storybook/addon-ondevice-actionsbecomes a deprecated compatibility stub. This follows the backgrounds work in #848.To opt out:
@storybook/react-nativeActionLoggercomponent and container,actionStore) lives insrc/actions/.registerActionsAddon()is inactions/register.tsx.start()registers it whenglobalThis.FEATURES?.ondeviceActions !== false, right aftersetChanneland the backgrounds registration.Features.ondeviceActionsis documented as on by default (@default true; setfalseto disable).fast-deep-equalis added to dependencies. It is the only extra dependency.actionStoretests moved from the addon package.feature.test.ts:start()registers by default, and with other features set, but not whenondeviceActions: false.register.test.tsx: runs against the realstorybook/manager-api. Calling the stub'sregisterregisters nothing; after the built-in registers andloadAddonsruns, there is exactly one Actions panel; and the dev warning fires once.@storybook/iconswas added to the jest transform patterns so the real manager-api loads. The olderstart()test mocks gainedregister: jest.fn().@storybook/addon-ondevice-actions(stub)register()(andregister.js) registers nothing and does not touch the built-in addon. In__DEV__it logs oneconsole.warnsaying the addon is built into@storybook/react-nativeand that the package can be removed fromdeviceAddonsand uninstalled. The exported API (register) is unchanged.@storybook/react-native(^11.0.0-next.1) is now the only peer dependency.tscstill emitsdist/index.js, which is whatregister.jsrequires.Because the stub never registers, the earlier "package and flag together" override path, its warning and its test are gone.
Examples
examples/expo-example/.rnstorybookno longer lists the package or sets the flag, so it uses the built-in panel by default.storybook.requires.tsis regenerated..rnstorybook-nofactories, expo-router-example, expo-new-wrapper-example and repack-example still list@storybook/addon-ondevice-actions, so the stub path stays exercised.Docs and changesets
MIGRATION.md(10 → 11) has a new "Actions is built into@storybook/react-native" section, and the package is removed from its v11 dependency example.configuration/actions.md(now: on by default, how to turn it off, migration),addons/index.md,manual-setup.md,cli-configuration.mdandconfiguration/index.mdare updated.template/cli/main.tsand the writing-stories skill no longer install or list the package.majorfor both@storybook/react-nativeand@storybook/addon-ondevice-actions. They are in the same fixed group, and this matches how other v11 breaking changes were recorded (e.g.require-device-addons).Testing
pnpm build,pnpm test,pnpm lint,pnpm format:checkandcheck:typesall pass, for both@storybook/react-nativeand the stub.On device, I tested expo-example on an iOS 26.4 simulator with the story
ActionExample/Actions/Basic. In both runs I pressed the button twice before first opening the panel, then closed it, pressed once more and reopened it..rnstorybook, package not listed):onPressentries.EXPO_PUBLIC_NO_FACTORIES=true,.rnstorybook-nofactories, which imports@storybook/addon-ondevice-actions/register):onPressentries.Screenshots (local):
~/pr-evidence/builtin-actions/default-2-reopened.pngand~/pr-evidence/builtin-actions/stub-2-reopened.png.Android: dev build on an Android 15 (API 35) emulator
expo-example dev build (
expo prebuild+gradlew app:assembleDebug, arm64) on a temporary Pixel 9 AVD (google_apisarm64 image), with Metro on 8081 and the channel server on 7007. I used the sameActionExample/Actions/Basicflow, and countedstorybook/actions/action-eventmessages with a websocket listener on the channel server..rnstorybook): pressed twice with the panel closed, then opened it. There's one Actions tab (the tabs are Actions, Backgrounds, Notes, Controls), and every press was listed. I closed the panel, pressed once, reopened it and selected Actions: all entries were still there, including the new one..rnstorybook-nofactories): pressed twice, opened the panel (2 entries), closed it, pressed once and reopened it (3 entries). There's one Actions tab. Metro logged theaddon-ondevice-actions is deprecatedwarning exactly once.next: the panel reopens on its first tab, not the last tab used.Screenshots (local,
~/Developer/test-evidence/android-959/):01-default-first-open.png,02-default-reopen-after-closed-presses.png,03-default-close-fire-reopen.png04-nofactories-first-open.png,05-nofactories-close-fire-reopen.pngmetro-*.log,ws-*.log