Skip to content
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

[Storybook] Addon API changes #95

Merged
merged 4 commits into from
Oct 16, 2017
Merged

[Storybook] Addon API changes #95

merged 4 commits into from
Oct 16, 2017

Conversation

cjies
Copy link
Contributor

@cjies cjies commented Oct 14, 2017

The info addon have some API changes, .addWithInfo() will be deprecated soon and changed to withInfo() HOF.

Why it changed?

Avoid to overwrite origin .add() API, and the .addWithXXX() pattern is just allow one addon per story. In the new withX() primitives, we can compose multiple addons in a story.

Links:
storybook migration guide
storybookjs/storybook#1147 (comment)

Implement

  • Move the containers <DebugBox> and <FlexRow> to utils/ folder.
  • Fix prop changes of our custom propsTable addon.
  • Switch .addWithInfo() API to .add('xxx', withInfo('info')(<component>)).

Lets webpack can resolve the modules in storybook/ package.
Refactor to `withPropsTable()` HOF to avoid the overwrite of `.add()` in the future. storybookjs/storybook#1147
Addon injection is deprecated and slate for removal in v4.0, use the `withInfo()()()` currying function to replace `addWithInfo` API.
@zhusee2
Copy link
Contributor

zhusee2 commented Oct 16, 2017

Let's split the todo to another issue, and merge this early.

@cjies cjies merged commit 7373573 into develop Oct 16, 2017
@cjies cjies deleted the CJ/storybook_changes branch October 18, 2017 05:45
@zhusee2 zhusee2 mentioned this pull request Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants