Skip to content

Commit

Permalink
Addon-a11y: Remove deprecated withA11y decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Oct 18, 2022
1 parent 4aad906 commit f432a9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
13 changes: 9 additions & 4 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
- [Icons API changed](#icons-api-changed)
- ['config' preset entry replaced with 'previewAnnotations'](#config-preset-entry-replaced-with-previewannotations)
- [Dropped support for Angular 12 and below](#dropped-support-for-angular-12-and-below)
- [Removed deprecated grid parameter](#removed-deprecated-grid-parameter)
- [Removed deprecated addon-docs blocks.js entry](#removed-deprecated-addon-docs-blocksjs-entry)
- [Addon-backgrounds: Removed deprecated grid parameter](#addon-backgrounds-removed-deprecated-grid-parameter)
- [Addon-docs: Removed deprecated blocks.js entry](#addon-docs-removed-deprecated-blocksjs-entry)
- [Addon-a11y: Removed deprecated withA11y decorator](#addon-a11y-removed-deprecated-witha11y-decorator)
- [Docs Changes](#docs-changes)
- [Standalone docs files](#standalone-docs-files)
- [Referencing stories in docs files](#referencing-stories-in-docs-files)
Expand Down Expand Up @@ -586,14 +587,18 @@ for Angular 12 and below.

In order to use Storybook 7.0, you need to upgrade to at least Angular 13.

#### Removed deprecated grid parameter
#### Addon-backgrounds: Removed deprecated grid parameter

Starting in 7.0 the `grid.cellSize` parameter should now be `backgrounds.grid.cellSize`. This was [deprecated in SB 6.1](#deprecated-grid-parameter).

#### Removed deprecated addon-docs blocks.js entry
#### Addon-docs: Removed deprecated blocks.js entry

Removed `@storybook/addon-docs/blocks` entry. Import directly from `@storybook/addon-docs` instead. This was [deprecated in SB 6.3](#deprecated-scoped-blocks-imports).

#### Addon-a11y: Removed deprecated withA11y decorator

We removed the deprecated `withA11y` decorator. This was [deprecated in 6.0](#removed-witha11y-decorator)

### Docs Changes

The information hierarchy of docs in Storybook has changed in 7.0. The main difference is that each docs is listed in the sidebar as a separate entry, rather than attached to individual stories.
Expand Down
19 changes: 0 additions & 19 deletions code/addons/a11y/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
/// <reference types="webpack-env" />

import type { AnyFramework, DecoratorFunction } from '@storybook/csf';
import deprecate from 'util-deprecate';
import { dedent } from 'ts-dedent';

export { PARAM_KEY } from './constants';
export * from './params';

if (module && module.hot && module.hot.decline) {
module.hot.decline();
}

export const withA11y: DecoratorFunction<AnyFramework> = deprecate(
(storyFn, storyContext) => {
return storyFn(storyContext);
},
dedent`
withA11y(options) is deprecated, please configure addon-a11y using the addParameter api:
addParameters({
a11y: options,
});
More at: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#removed-witha11y-decorator
`
);

0 comments on commit f432a9c

Please sign in to comment.