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 3, 2020
2 parents 129a981 + f372d1d commit 6fa62e7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions MIGRATION.md
Expand Up @@ -3,6 +3,7 @@
- [From version 6.1.x to 6.2.0](#from-version-61x-to-620)
- [New Angular renderer](#new-angular-renderer)
- [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)
- [React peer dependencies](#react-peer-dependencies)
- [6.1 deprecations](#61-deprecations)
Expand Down Expand Up @@ -156,6 +157,27 @@ Please also file an issue if you need to opt out. We plan to remove the legacy r

## 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 6fa62e7

Please sign in to comment.