From 64a870981f3fdd6d07286b33a42b7f3f0751c80c Mon Sep 17 00:00:00 2001 From: Yann Braga Date: Fri, 5 Jan 2024 08:02:09 -0300 Subject: [PATCH] Addon docs: Remove deprecated parameters --- MIGRATION.md | 15 ++++++ code/addons/docs/docs/docspage.md | 2 +- code/lib/csf-tools/src/enrichCsf.test.ts | 8 +-- code/ui/blocks/src/blocks/Source.tsx | 32 +----------- code/ui/blocks/src/blocks/Story.tsx | 29 +---------- .../internal/InternalSource.stories.tsx | 19 ------- .../src/examples/SourceParameters.stories.tsx | 50 ------------------- 7 files changed, 24 insertions(+), 131 deletions(-) diff --git a/MIGRATION.md b/MIGRATION.md index 6d6dd3e98024..259b2e6c89fc 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -37,6 +37,7 @@ - ["Framework" TypeScript types](#framework-typescript-types) - [`navigateToSettingsPage` method from Storybook's manager-api](#navigatetosettingspage-method-from-storybooks-manager-api) - [storyIndexers](#storyindexers) + - [Deprecated docs parameters](#deprecated-docs-parameters) - [From version 7.5.0 to 7.6.0](#from-version-750-to-760) - [CommonJS with Vite is deprecated](#commonjs-with-vite-is-deprecated) - [Using implicit actions during rendering is deprecated](#using-implicit-actions-during-rendering-is-deprecated) @@ -656,6 +657,20 @@ export const Component = () => { The Storybook's main.js configuration property `storyIndexers` is now removed in favor of `experimental_indexers`. [More info](#storyindexers-is-replaced-with-experimental_indexers). +#### Deprecated docs parameters + +The following story and meta parameters are now removed: + +```ts +parameters.docs.iframeHeight // becomes docs.story.iframeHeight +parameters.docs.inlineStories // becomes docs.story.inline +parameters.jsx.transformSource // becomes parameters.docs.source.transform +parameters.docs.transformSource // becomes parameters.docs.source.transform +parameters.docs.source.transformSource // becomes parameters.docs.source.transform +``` + +More info [here](#autodocs-changes) and [here](#source-block). + ## From version 7.5.0 to 7.6.0 #### CommonJS with Vite is deprecated diff --git a/code/addons/docs/docs/docspage.md b/code/addons/docs/docs/docspage.md index 8a8da1fc773a..3fef9898f955 100644 --- a/code/addons/docs/docs/docspage.md +++ b/code/addons/docs/docs/docspage.md @@ -154,7 +154,7 @@ addParameters({ }); ``` -With that function, anyone using the docs addon for `@storybook/vue` can make their stories render inline, either globally with the `inlineStories` docs parameter, or on a per-story-basis using the `inline` prop on the `` doc block. If you come up with an elegant and flexible implementation for the `prepareForInline` function for your own framework, let us know! We'd love to make it the default configuration, to make inline stories more accessible for a larger variety of frameworks! +With that function, anyone using the docs addon for `@storybook/vue` can make their stories render inline, either globally with the `docs.story.inline` parameter, or on a per-story-basis using the `inline` prop on the `` doc block. If you come up with an elegant and flexible implementation for the `prepareForInline` function for your own framework, let us know! We'd love to make it the default configuration, to make inline stories more accessible for a larger variety of frameworks! ## Show/Hide code diff --git a/code/lib/csf-tools/src/enrichCsf.test.ts b/code/lib/csf-tools/src/enrichCsf.test.ts index d9871e935226..562cacd8c04b 100644 --- a/code/lib/csf-tools/src/enrichCsf.test.ts +++ b/code/lib/csf-tools/src/enrichCsf.test.ts @@ -641,7 +641,7 @@ describe('enrichCsf', () => { title: 'Button', parameters: { foo: 'bar', - docs: { inlineStories: true } + docs: { story: { inline: true } } } } export const Basic = () => React.createElement(Button); @@ -652,7 +652,7 @@ describe('enrichCsf', () => { title: 'Button', parameters: { foo: 'bar', - docs: { inlineStories: true } + docs: { story: { inline: true } } } } export const Basic = () =>