From 89151a3a7bf366b8e6bde4c41d286175e7f8238c Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Thu, 19 Nov 2020 21:31:30 +0100 Subject: [PATCH 1/4] docs(MIGRATION): add preset information for addon-backgrounds in 6.1 --- MIGRATION.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index 12b683595016..2d1054c81334 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,6 +1,7 @@

Migration

- [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) @@ -139,6 +140,26 @@ ## From version 6.0.x to 6.1.0 +### Addon-backgrounds preset + +In 6.1 we there is an structural change in addon-backgrounds that ended up introducing an unintentional breaking change. + +The addon needs decorators which come in a preset. The needed preset is ignored if you import the addon like this in `main.js`: +```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: From 9d827e0d7baeda639df5fb9ed1391805044a2dbb Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 3 Dec 2020 20:12:25 +0800 Subject: [PATCH 2/4] Update MIGRATION.md --- MIGRATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index 2d1054c81334..60d5a69f8b35 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -142,7 +142,7 @@ ### Addon-backgrounds preset -In 6.1 we there is an structural change in addon-backgrounds that ended up introducing an unintentional breaking change. +In 6.1 we introduced an unintentional breaking change to `addon-backgrounds`. The addon needs decorators which come in a preset. The needed preset is ignored if you import the addon like this in `main.js`: ```js From 14a54117c91187dd05764a365f136722d045e6d7 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 3 Dec 2020 20:12:36 +0800 Subject: [PATCH 3/4] Update MIGRATION.md --- MIGRATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index 60d5a69f8b35..770b58014a9d 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -144,7 +144,7 @@ In 6.1 we introduced an unintentional breaking change to `addon-backgrounds`. -The addon needs decorators which come in a preset. The needed preset is ignored if you import the addon like this in `main.js`: +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'], From f372d1d3cdd91109750ada9c4d5d182ec23529f9 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Thu, 3 Dec 2020 20:12:43 +0800 Subject: [PATCH 4/4] Update MIGRATION.md --- MIGRATION.md | 1 + 1 file changed, 1 insertion(+) diff --git a/MIGRATION.md b/MIGRATION.md index 770b58014a9d..be8e96647574 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -153,6 +153,7 @@ module.exports = { ``` To fix it, just replace `@storybook/addon-backgrounds/register` with `@storybook/addon-backgrounds`: + ```js module.exports = { stories: ['../**/*.stories.js'],