-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated decorators and loaders #9951
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { withA11Y } from '../index'; | ||
import { withA11y } from '../index'; | ||
|
||
export const decorators = [withA11Y]; | ||
export const decorators = [withA11y]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. made me giggle that the preset was using the deprecated version... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
import { makeDecorator, StoryContext, StoryGetter } from '@storybook/addons'; | ||
import deprecate from 'util-deprecate'; | ||
|
||
// This decorator is kept purely so we produce a decorator that is compatible with both | ||
// `addDecorator(withBackgrounds(...))` and `addDecorator(withBackgrounds)` | ||
export const withBackgrounds = deprecate( | ||
makeDecorator({ | ||
name: 'withBackgrounds', | ||
parameterName: 'backgrounds', | ||
wrapper: (getStory: StoryGetter, context: StoryContext) => { | ||
return getStory(context); | ||
}, | ||
}), | ||
`Note that withBackgrounds(options) has been replaced by addParameters({ backgrounds: options}) | ||
Read more about it in the migration guide: https://github.com/storybookjs/storybook/blob/master/MIGRATION.md` | ||
); | ||
|
||
if (module && module.hot && module.hot.decline) { | ||
module.hot.decline(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,3 @@ | ||
import { window } from 'global'; | ||
import deprecate from 'util-deprecate'; | ||
|
||
import ReactCentered from './react'; | ||
import VueCentered from './vue'; | ||
|
||
// TODO: REMOVE this entire file in V6.0.0 | ||
|
||
const Centered = deprecate( | ||
() => (window.STORYBOOK_ENV === 'vue' ? VueCentered : ReactCentered), | ||
` | ||
Using "import centered from '@storybook/addon-centered'" is deprecated. | ||
Please use either: | ||
"import centered from '@storybook/addon-centered/react'" | ||
or | ||
"import centered from '@storybook/addon-centered/vue'" | ||
` | ||
)(); | ||
|
||
export default Centered; | ||
|
||
if (module && module.hot && module.hot.decline) { | ||
module.hot.decline(); | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a parameter called
layout
and it and 1 of it's possible values iscenter
.This automatically centers the component.
It also supports
fullscreen
andpadded
.I think we could drop addon-centered entirely in 6.0.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's please move it to the deprecated addons repo, pretty please 🙏
We can merge this first and follow up separately: #10118