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

Revert knobs API to previous API. #1527

Merged
merged 3 commits into from
Jul 27, 2017
Merged

Revert knobs API to previous API. #1527

merged 3 commits into from
Jul 27, 2017

Conversation

tmeasday
Copy link
Member

@tmeasday tmeasday commented Jul 27, 2017

withKnobs the decorator is still the base API. (This now works for
Vue).

The new API is called wrapperKnobs and will eventually be merged into
withKnobs (c.f. medium term addons plan, to be posted)

Counter proposal to #1524

The basic idea is to leave the knobs API unchanged for now. withKnobs is still a decorator.

We now export wrapperKnobs (I'm open to changing this name, I'm not sure addonKnobs really says what it is though), which is a higher-order-component (HOC) wrapper API.

Medium term plan is as follows:

  1. Allow "wrapper" HOC functions to be used as decorators (this require core changes, maybe in 3.3) (see Allow decorator API to accept HOC-style wrappers #1528)

  2. Transition withKnobs to be a wrapper (ie withKnobs = wrapperKnobs).

`withKnobs` the decorator is still the base API. (This now works for
Vue).

The new API is called `wrapperKnobs` and will eventually be merged into
`withKnob` (c.f. medium term addons plan, to be posted)
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this. However, can we just NOT export wrapperKnobs for now since this is about not changing the API prematurely?

I'd like to implement the withX HOC proposal (or something like it) together and release it in 3.3.

Proposal: https://gist.github.com/shilman/792dc25550daa9c2bf37238f4ef7a398

@tmeasday
Copy link
Member Author

I'm OK with removing it, although I suspect others may be keen to use knobs per-story? I'll remove it but we can revert if people object strongly.

Copy link
Member

@ndelangen ndelangen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and approved

@ndelangen
Copy link
Member

Ready to merge IMHO

@ndelangen ndelangen added this to the v3.2.0 milestone Jul 27, 2017
@shilman shilman merged commit dcb3e1f into release/3.2 Jul 27, 2017
@shilman shilman deleted the simplifyKnobsAPI branch July 27, 2017 07:09
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.

None yet

3 participants