Skip to content

Commit

Permalink
Merge pull request #13180 from storybookjs/docs/addon-backgrounds-61-…
Browse files Browse the repository at this point in the history
…migration

docs(MIGRATION): add preset information for addon-backgrounds in 6.1
  • Loading branch information
shilman committed Dec 4, 2020
1 parent 5c312fd commit c752fad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions MIGRATION.md
@@ -1,6 +1,7 @@
<h1>Migration</h1>

- [From version 6.0.x to 6.1.0](#from-version-60x-to-610)
- [Addon-backgrounds preset](#addon-backgrounds-preset)
- [Single story hoisting](#single-story-hoisting)
- [6.1 deprecations](#61-deprecations)
- [Deprecated DLL flags](#deprecated-dll-flags)
Expand Down Expand Up @@ -139,6 +140,27 @@

## From version 6.0.x to 6.1.0

### Addon-backgrounds preset

In 6.1 we introduced an unintentional breaking change to `addon-backgrounds`.

The addon uses decorators which are set up automatically by a preset. The required preset is ignored if you register the addon in `main.js` withe the the `/register` entry point. This used to be valid in `v6.0.x` and earlier:
```js
module.exports = {
stories: ['../**/*.stories.js'],
addons: ['@storybook/addon-backgrounds/register'],
};
```

To fix it, just replace `@storybook/addon-backgrounds/register` with `@storybook/addon-backgrounds`:

```js
module.exports = {
stories: ['../**/*.stories.js'],
addons: ['@storybook/addon-backgrounds'],
};
```

### Single story hoisting

Stories which have **no siblings** (i.e. the component has only one story) and which name **exactly matches** the component name will now be hoisted up to replace their parent component in the sidebar. This means you can have a hierarchy like this:
Expand Down

0 comments on commit c752fad

Please sign in to comment.