-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Conversation
`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)
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 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
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. |
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.
Tested and approved
Ready to merge IMHO |
withKnobs
the decorator is still the base API. (This now works forVue).
The new API is called
wrapperKnobs
and will eventually be merged intowithKnobs
(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 sureaddonKnobs
really says what it is though), which is a higher-order-component (HOC) wrapper API.Medium term plan is as follows:
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)
Transition
withKnobs
to be a wrapper (iewithKnobs = wrapperKnobs
).