Skip to content
32 changes: 32 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Migration</h1>

- [From version 10.3.0 to 10.4.0](#from-version-1030-to-1040)
- [React Native: on-device addons moved to `deviceAddons`](#react-native-on-device-addons-moved-to-deviceaddons)
- [From version 10.0.0 to 10.1.0](#from-version-1000-to-1010)
- [API and Component Changes](#api-and-component-changes)
- [Button Component API Changes](#button-component-api-changes)
Expand Down Expand Up @@ -520,6 +522,36 @@
- [Packages renaming](#packages-renaming)
- [Deprecated embedded addons](#deprecated-embedded-addons)

## From version 10.3.0 to 10.4.0
Comment thread
ndelangen marked this conversation as resolved.

### React Native: on-device addons moved to `deviceAddons`

In Storybook 10.4, the React Native on-device Storybook config (`.rnstorybook/main.ts`) uses a dedicated `deviceAddons` key. All entries that used to live under `addons` in your React Native config must now be listed under `deviceAddons` instead.

Listing them under `addons` caused `storybook extract` to fail because Storybook Core evaluates every entry in `addons` as a Node.js preset, which on-device addons are not.

The automigration (`rn-ondevice-addons-to-device-addons`) handles this automatically by renaming the `addons` key to `deviceAddons`. It only acts on React Native main configs (detected by the `.rnstorybook` directory name or by a `framework` field of `@storybook/react-native`), and leaves any paired web `.storybook/main.ts` untouched.

You can also migrate manually:

```ts
// Before (.rnstorybook/main.ts)
export default {
addons: [
'@storybook/addon-ondevice-controls',
'@storybook/addon-ondevice-actions',
],
};

// After (.rnstorybook/main.ts)
export default {
deviceAddons: [
'@storybook/addon-ondevice-controls',
'@storybook/addon-ondevice-actions',
],
};
```

## From version 10.0.0 to 10.1.0

### API and Component Changes
Expand Down
2 changes: 2 additions & 0 deletions code/lib/cli-storybook/src/automigrate/fixes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { removeAddonInteractions } from './remove-addon-interactions.ts';
import { removeDocsAutodocs } from './remove-docs-autodocs.ts';
import { removeEssentials } from './remove-essentials.ts';
import { rendererToFramework } from './renderer-to-framework.ts';
import { rnOndeviceAddonsToDeviceAddons } from './rn-ondevice-addons-to-device-addons.ts';
import { rnstorybookConfig } from './rnstorybook-config.ts';
import { storybookPackageNameConflict } from './storybook-package-name-conflict.ts';
import { upgradeStorybookRelatedDependencies } from './upgrade-storybook-related-dependencies.ts';
Expand All @@ -34,6 +35,7 @@ export const allFixes: Fix[] = [
consolidatedImports,
addonExperimentalTest,
rnstorybookConfig,
rnOndeviceAddonsToDeviceAddons,
migrateAddonConsole,
nextjsToNextjsVite,
removeAddonInteractions,
Expand Down
Loading
Loading