mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 19:11:08 +08:00
Add migration instructions for isToolshown rename
This commit is contained in:
parent
99f3070c36
commit
aad962bb1a
16
MIGRATION.md
16
MIGRATION.md
@ -2,6 +2,7 @@
|
||||
|
||||
- [From version 6.4.x to 6.5.0](#from-version-64x-to-650)
|
||||
- [React18 new root API](#react18-new-root-api)
|
||||
- [Renamed isToolshown to showToolbar](#renamed-istoolshown-to-showtoolbar)
|
||||
- [Deprecated register.js](#deprecated-registerjs)
|
||||
- [Dropped support for addon-actions addDecorators](#dropped-support-for-addon-actions-adddecorators)
|
||||
- [Vite builder renamed](#vite-builder-renamed)
|
||||
@ -213,6 +214,21 @@ module.exports = {
|
||||
};
|
||||
```
|
||||
|
||||
### Renamed isToolshown to showToolbar
|
||||
|
||||
Storybook's [manager API](docs/addons/addons-api.md) has deprecated the `isToolshown` option (to show/hide the toolbar) and renamed it to `showToolbar` for consistency with other similar UI options.
|
||||
|
||||
Example:
|
||||
|
||||
```js
|
||||
// .storybook/manager.js
|
||||
import { addons } from '@storybook/addons';
|
||||
|
||||
addons.setConfig({
|
||||
showToolbar: false,
|
||||
});
|
||||
```
|
||||
|
||||
### Deprecated register.js
|
||||
|
||||
In ancient versions of Storybook, addons were registered by referring to `addon-name/register.js`. This is going away in SB7.0. Instead you should just add `addon-name` to the `addons` array in `.storybook/main.js`.
|
||||
|
@ -18,11 +18,11 @@ addons.setConfig({
|
||||
collapsedRoots: ['other'],
|
||||
},
|
||||
toolbar: {
|
||||
title: { hidden: false, },
|
||||
zoom: { hidden: false, },
|
||||
eject: { hidden: false, },
|
||||
copy: { hidden: false, },
|
||||
fullscreen: { hidden: false, },
|
||||
title: { hidden: false },
|
||||
zoom: { hidden: false },
|
||||
eject: { hidden: false },
|
||||
copy: { hidden: false },
|
||||
fullscreen: { hidden: false },
|
||||
},
|
||||
});
|
||||
```
|
||||
```
|
||||
|
@ -3,6 +3,8 @@ import pick from 'lodash/pick';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
import { themes } from '@storybook/theming';
|
||||
import type { ThemeVars } from '@storybook/theming';
|
||||
import { once } from '@storybook/client-logger';
|
||||
import dedent from 'ts-dedent';
|
||||
|
||||
import merge from '../lib/merge';
|
||||
import type { State, ModuleFn } from '../index';
|
||||
@ -25,7 +27,10 @@ export interface Layout {
|
||||
showNav: boolean;
|
||||
showTabs: boolean;
|
||||
showToolbar: boolean;
|
||||
isToolshown?: boolean; // deprecated
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
isToolshown?: boolean;
|
||||
}
|
||||
|
||||
export interface UI {
|
||||
@ -222,6 +227,11 @@ export const init: ModuleFn = ({ store, provider, singleStory }) => {
|
||||
const { theme, selectedPanel, ...options } = provider.getConfig();
|
||||
|
||||
if (options?.layout?.isToolshown !== undefined) {
|
||||
once.warn(dedent`
|
||||
The "isToolshown" option is deprecated. Please use "showToolbar" instead.
|
||||
|
||||
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#renamed-istoolshown-to-showtoolbar
|
||||
`);
|
||||
options.layout.showToolbar = options.layout.isToolshown;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user