Migration

- [From version 6.0.x to 6.1.0](#from-version-60x-to-610) - [Single story hoisting](#single-story-hoisting) - [React peer dependencies](#react-peer-dependencies) - [6.1 deprecations](#61-deprecations) - [Deprecated DLL flags](#deprecated-dll-flags) - [Deprecated storyFn](#deprecated-storyfn) - [Deprecated onBeforeRender](#deprecated-onbeforerender) - [Deprecated grid parameter](#deprecated-grid-parameter) - [Deprecated package-composition disabled parameter](#deprecated-package-composition-disabled-parameter) - [From version 5.3.x to 6.0.x](#from-version-53x-to-60x) - [Hoisted CSF annotations](#hoisted-csf-annotations) - [Zero config typescript](#zero-config-typescript) - [Correct globs in main.js](#correct-globs-in-mainjs) - [CRA preset removed](#cra-preset-removed) - [Core-JS dependency errors](#core-js-dependency-errors) - [Args passed as first argument to story](#args-passed-as-first-argument-to-story) - [6.0 Docs breaking changes](#60-docs-breaking-changes) - [Remove framework-specific docs presets](#remove-framework-specific-docs-presets) - [Preview/Props renamed](#previewprops-renamed) - [Docs theme separated](#docs-theme-separated) - [DocsPage slots removed](#docspage-slots-removed) - [React prop tables with Typescript](#react-prop-tables-with-typescript) - [ConfigureJSX true by default in React](#configurejsx-true-by-default-in-react) - [User babelrc disabled by default in MDX](#user-babelrc-disabled-by-default-in-mdx) - [Docs description parameter](#docs-description-parameter) - [6.0 Inline stories](#60-inline-stories) - [New addon presets](#new-addon-presets) - [Removed babel-preset-vue from Vue preset](#removed-babel-preset-vue-from-vue-preset) - [Removed Deprecated APIs](#removed-deprecated-apis) - [New setStories event](#new-setstories-event) - [Removed renderCurrentStory event](#removed-rendercurrentstory-event) - [Removed hierarchy separators](#removed-hierarchy-separators) - [No longer pass denormalized parameters to storySort](#no-longer-pass-denormalized-parameters-to-storysort) - [Client API changes](#client-api-changes) - [Removed Legacy Story APIs](#removed-legacy-story-apis) - [Can no longer add decorators/parameters after stories](#can-no-longer-add-decoratorsparameters-after-stories) - [Changed Parameter Handling](#changed-parameter-handling) - [Simplified Render Context](#simplified-render-context) - [Story Store immutable outside of configuration](#story-store-immutable-outside-of-configuration) - [Improved story source handling](#improved-story-source-handling) - [6.0 Addon API changes](#60-addon-api-changes) - [Consistent local addon paths in main.js](#consistent-local-addon-paths-in-mainjs) - [Deprecated setAddon](#deprecated-setaddon) - [Deprecated disabled parameter](#deprecated-disabled-parameter) - [Actions addon uses parameters](#actions-addon-uses-parameters) - [Removed action decorator APIs](#removed-action-decorator-apis) - [Removed withA11y decorator](#removed-witha11y-decorator) - [Essentials addon disables differently](#essentials-addon-disables-differently) - [Backgrounds addon has a new api](#backgrounds-addon-has-a-new-api) - [6.0 Deprecations](#60-deprecations) - [Deprecated addon-info, addon-notes](#deprecated-addon-info-addon-notes) - [Deprecated addon-contexts](#deprecated-addon-contexts) - [Removed addon-centered](#removed-addon-centered) - [Deprecated polymer](#deprecated-polymer) - [Deprecated immutable options parameters](#deprecated-immutable-options-parameters) - [Deprecated addParameters and addDecorator](#deprecated-addparameters-and-adddecorator) - [Deprecated clearDecorators](#deprecated-cleardecorators) - [Deprecated configure](#deprecated-configure) - [Deprecated support for duplicate kinds](#deprecated-support-for-duplicate-kinds) - [From version 5.2.x to 5.3.x](#from-version-52x-to-53x) - [To main.js configuration](#to-mainjs-configuration) - [Using main.js](#using-mainjs) - [Using preview.js](#using-previewjs) - [Using manager.js](#using-managerjs) - [Create React App preset](#create-react-app-preset) - [Description doc block](#description-doc-block) - [React Native Async Storage](#react-native-async-storage) - [Deprecate displayName parameter](#deprecate-displayname-parameter) - [Unified docs preset](#unified-docs-preset) - [Simplified hierarchy separators](#simplified-hierarchy-separators) - [Addon StoryShots Puppeteer uses external puppeteer](#addon-storyshots-puppeteer-uses-external-puppeteer) - [From version 5.1.x to 5.2.x](#from-version-51x-to-52x) - [Source-loader](#source-loader) - [Default viewports](#default-viewports) - [Grid toolbar-feature](#grid-toolbar-feature) - [Docs mode docgen](#docs-mode-docgen) - [storySort option](#storysort-option) - [From version 5.1.x to 5.1.10](#from-version-51x-to-5110) - [babel.config.js support](#babelconfigjs-support) - [From version 5.0.x to 5.1.x](#from-version-50x-to-51x) - [React native server](#react-native-server) - [Angular 7](#angular-7) - [CoreJS 3](#corejs-3) - [From version 5.0.1 to 5.0.2](#from-version-501-to-502) - [Deprecate webpack extend mode](#deprecate-webpack-extend-mode) - [From version 4.1.x to 5.0.x](#from-version-41x-to-50x) - [sortStoriesByKind](#sortstoriesbykind) - [Webpack config simplification](#webpack-config-simplification) - [Theming overhaul](#theming-overhaul) - [Story hierarchy defaults](#story-hierarchy-defaults) - [Options addon deprecated](#options-addon-deprecated) - [Individual story decorators](#individual-story-decorators) - [Addon backgrounds uses parameters](#addon-backgrounds-uses-parameters) - [Addon cssresources name attribute renamed](#addon-cssresources-name-attribute-renamed) - [Addon viewport uses parameters](#addon-viewport-uses-parameters) - [Addon a11y uses parameters, decorator renamed](#addon-a11y-uses-parameters-decorator-renamed) - [Addon centered decorator deprecated](#addon-centered-decorator-deprecated) - [New keyboard shortcuts defaults](#new-keyboard-shortcuts-defaults) - [New URL structure](#new-url-structure) - [Rename of the `--secure` cli parameter to `--https`](#rename-of-the---secure-cli-parameter-to---https) - [Vue integration](#vue-integration) - [From version 4.0.x to 4.1.x](#from-version-40x-to-41x) - [Private addon config](#private-addon-config) - [React 15.x](#react-15x) - [From version 3.4.x to 4.0.x](#from-version-34x-to-40x) - [React 16.3+](#react-163) - [Generic addons](#generic-addons) - [Knobs select ordering](#knobs-select-ordering) - [Knobs URL parameters](#knobs-url-parameters) - [Keyboard shortcuts moved](#keyboard-shortcuts-moved) - [Removed addWithInfo](#removed-addwithinfo) - [Removed RN packager](#removed-rn-packager) - [Removed RN addons](#removed-rn-addons) - [Storyshots Changes](#storyshots-changes) - [Webpack 4](#webpack-4) - [Babel 7](#babel-7) - [Create-react-app](#create-react-app) - [Upgrade CRA1 to babel 7](#upgrade-cra1-to-babel-7) - [Migrate CRA1 while keeping babel 6](#migrate-cra1-while-keeping-babel-6) - [start-storybook opens browser](#start-storybook-opens-browser) - [CLI Rename](#cli-rename) - [Addon story parameters](#addon-story-parameters) - [From version 3.3.x to 3.4.x](#from-version-33x-to-34x) - [From version 3.2.x to 3.3.x](#from-version-32x-to-33x) - [`babel-core` is now a peer dependency #2494](#babel-core-is-now-a-peer-dependency-2494) - [Base webpack config now contains vital plugins #1775](#base-webpack-config-now-contains-vital-plugins-1775) - [Refactored Knobs](#refactored-knobs) - [From version 3.1.x to 3.2.x](#from-version-31x-to-32x) - [Moved TypeScript addons definitions](#moved-typescript-addons-definitions) - [Updated Addons API](#updated-addons-api) - [From version 3.0.x to 3.1.x](#from-version-30x-to-31x) - [Moved TypeScript definitions](#moved-typescript-definitions) - [Deprecated head.html](#deprecated-headhtml) - [From version 2.x.x to 3.x.x](#from-version-2xx-to-3xx) - [Webpack upgrade](#webpack-upgrade) - [Packages renaming](#packages-renaming) - [Deprecated embedded addons](#deprecated-embedded-addons) ## From version 6.0.x to 6.1.0 ### 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: ``` DESIGN SYSTEM [root] - Atoms [group] - Button [component] - Button [story] - Checkbox [component] - Checkbox [story] ``` This will then be visually presented in the sidebar like this: ``` DESIGN SYSTEM [root] - Atoms [group] - Button [story] - Checkbox [story] ``` See [Naming components and hierarchy](https://storybook.js.org/docs/react/writing-stories/naming-components-and-hierarchy#single-story-hoisting) for details. ### React peer dependencies Starting in 6.1, `react` and `react-dom` are required peer dependencies of `@storybook/react`, meaning that if your React project does not have dependencies on them, you need to add them as `devDependencies`. If you don't you'll see errors like this: ``` Error: Cannot find module 'react-dom/package.json' ``` They were also peer dependencies in earlier versions, but due to the package structure they would be installed by Storybook if they were not required by the user's project. For more discussion: https://github.com/storybookjs/storybook/issues/13269 ### 6.1 deprecations #### Deprecated DLL flags Earlier versions of Storybook used Webpack DLLs as a performance crutch. In 6.1, we've removed Storybook's built-in DLLs and have deprecated the command-line parameters `--no-dll` and `--ui-dll`. They will be removed in 7.0. #### Deprecated storyFn Each item in the story store contains a field called `storyFn`, which is a fully decorated story that's applied to the denormalized story parameters. Starting in 6.0 we've stopped using this API internally, and have replaced it with a new field called `unboundStoryFn` which, unlike `storyFn`, must passed a story context, typically produced by `applyLoaders`; Before: ```js const { storyFn } = store.fromId('some--id'); console.log(storyFn()); ``` After: ```js const { unboundStoryFn, applyLoaders } = store.fromId('some--id'); const context = await applyLoaders(); console.log(unboundStoryFn(context)); ``` If you're not using loaders, `storyFn` will work as before. If you are, you'll need to use the new approach. > NOTE: If you're using `@storybook/addon-docs`, this deprecation warning is triggered by the Docs tab in 6.1. It's safe to ignore and we will be providing a proper fix in 6.2. You can track the issue at https://github.com/storybookjs/storybook/issues/13074. #### Deprecated onBeforeRender The `@storybook/addon-docs` previously accepted a `jsx` option called `onBeforeRender`, which was unfortunately named as it was called after the render. We've renamed it `transformSource` and also allowed it to receive the `StoryContext` in case source rendering requires additional information. #### Deprecated grid parameter Previously when using `@storybook/addon-backgrounds` if you wanted to customize the grid, you would define a parameter like this: ```js export const Basic = () =>