From c9552b6c6028b0067937762e3a7be087dfc06a38 Mon Sep 17 00:00:00 2001 From: Mayank <9084735+mayank99@users.noreply.github.com> Date: Mon, 12 Jul 2021 14:56:09 -0400 Subject: [PATCH 1/2] Update MIGRATION.md --- MIGRATION.md | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index ad2102dca7fa..dc612a152b4a 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -212,34 +212,13 @@ To do so, it relies on helpers added in the latest minor versions of `lit-html`/ According to the package manager you are using, it can be handled automatically when updating Storybook or can require to manually update the versions and regenerate the lockfile. -### 6.3 deprecations - -#### Deprecated addon-knobs - -We are replacing `@storybook/addon-knobs` with `@storybook/addon-controls`. - -- [Rationale & discussion](https://github.com/storybookjs/storybook/discussions/15060) -- [Migration notes](https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#how-do-i-migrate-from-addon-knobs) - -#### Deprecated scoped blocks imports - -In 6.3, we changed doc block imports from `@storybook/addon-docs/blocks` to `@storybook/addon-docs`. This makes it possible for bundlers to automatically choose the ESM or CJS version of the library depending on the context. - -To update your code, you should be able to global replace `@storybook/addon-docs/blocks` with `@storybook/addon-docs`. Example: - -```js -// before -import { Meta, Story } from '@storybook/addon-docs/blocks'; - -// after -import { Meta, Story } from '@storybook/addon-docs'; -``` - -#### Deprecated `argType.defaultValue` +### No longer inferring default values of args Previously, unset `args` were set to the `argType.defaultValue` if set or inferred from the component's prop types (etc.). In 6.3 we no longer infer default values and instead set arg values to `undefined` when unset, allowing the framework to supply the default value. -If you were using `argType.defaultValue` to fix issues with the above inference, it should no longer be necessary, you can remove that code. If you were using it to set a default value for an arg, there is a simpler way; simply set a value for the arg at the component level: +If you were using `argType.defaultValue` to fix issues with the above inference, it should no longer be necessary, you can remove that code. + +If you were using `argType.defaultValue` or relying on inference to set a default value for an arg, you should now set a value for the arg at the component level: ```js export default { @@ -263,6 +242,29 @@ export default { }; ``` +### 6.3 deprecations + +#### Deprecated addon-knobs + +We are replacing `@storybook/addon-knobs` with `@storybook/addon-controls`. + +- [Rationale & discussion](https://github.com/storybookjs/storybook/discussions/15060) +- [Migration notes](https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#how-do-i-migrate-from-addon-knobs) + +#### Deprecated scoped blocks imports + +In 6.3, we changed doc block imports from `@storybook/addon-docs/blocks` to `@storybook/addon-docs`. This makes it possible for bundlers to automatically choose the ESM or CJS version of the library depending on the context. + +To update your code, you should be able to global replace `@storybook/addon-docs/blocks` with `@storybook/addon-docs`. Example: + +```js +// before +import { Meta, Story } from '@storybook/addon-docs/blocks'; + +// after +import { Meta, Story } from '@storybook/addon-docs'; +``` + #### Deprecated layout URL params Several URL params to control the manager layout have been deprecated and will be removed in 7.0: From 75bf6ec05a976aeb081be665f40a28a88a7f2752 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Tue, 13 Jul 2021 10:09:15 +0800 Subject: [PATCH 2/2] Fix TOC --- MIGRATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index dc612a152b4a..9426f71bf721 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -4,10 +4,10 @@ - [Webpack 5 manager build](#webpack-5-manager-build) - [Angular 12 upgrade](#angular-12-upgrade) - [Lit support](#lit-support) + - [No longer inferring default values of args](#no-longer-inferring-default-values-of-args) - [6.3 deprecations](#63-deprecations) - [Deprecated addon-knobs](#deprecated-addon-knobs) - [Deprecated scoped blocks imports](#deprecated-scoped-blocks-imports) - - [Deprecated `argType.defaultValue`](#deprecated-argtypedefaultvalue) - [Deprecated layout URL params](#deprecated-layout-url-params) - [From version 6.1.x to 6.2.0](#from-version-61x-to-620) - [MDX pattern tweaked](#mdx-pattern-tweaked)