-
-
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
Knobs seem slow to update #10019
Comments
This might be a feature instead of a bug? ^^ It sounds like some debouncing was added in #5811, though I didn’t spend too much time looking through the history. I briefly tried to switch the debouncing to the leading edge, instead of the trailing one, by adding a My colleague @wiese remarks that throttling might be even closer to what’s desired here. We want the leading edge, for immediate response; we need the trailing edge, for eventual consistency; but if, using |
Looked at the reproducer in dev tools. I have a hard time coming up with a scenario where it would have a detrimental effect to instead react immediately and (comparable to what happened so far) only then prevent the same event from hitting downstream over and over - but maybe that is due to our narrow view on a binary input. https://css-tricks.com/the-difference-between-throttling-and-debouncing/ |
As a blunt work around I was looking into ways to disable the debouncing altogether. In the documentation a flag Interestingly, looking at the source code of It may be worth noting that the implementation of |
So far we have no use for debounced values from knobs in storybook - we only use few knobs and the updates seem to be quite performant. We filed storybookjs/storybook#10019 [0] to check with the storybook maintainers if the behavior we witnessed is as expected. While researching we saw that work [1] was put into this area recently so maybe more fine grained controls will be possible with the next release, which we then can use if need arises. [0] storybookjs/storybook#10019 [1] storybookjs/storybook#9447 Change-Id: I3ea30acb60e142dff5c9fbf4fe4cda9a40d4c990
* Update Wikibase from branch 'master' to e26d8240f723293ad450d38bdb0140f417b90096 - Merge "bridge: disable value debounce for knobs in storybook" - bridge: disable value debounce for knobs in storybook So far we have no use for debounced values from knobs in storybook - we only use few knobs and the updates seem to be quite performant. We filed storybookjs/storybook#10019 [0] to check with the storybook maintainers if the behavior we witnessed is as expected. While researching we saw that work [1] was put into this area recently so maybe more fine grained controls will be possible with the next release, which we then can use if need arises. [0] storybookjs/storybook#10019 [1] storybookjs/storybook#9447 Change-Id: I3ea30acb60e142dff5c9fbf4fe4cda9a40d4c990
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook! |
Describe the bug
When using the knobs addon to test a timing-dependent component (a loading bar that should appear/disappear after a certain time), we found that changes to the knobs seem to propagate rather slowly, compared to our previous solution (a plain
<input type="checkbox">
withv-model
).To Reproduce
Steps to reproduce the behavior:
npm install
npm run storybook
If you don’t trust the reproducer, you can also create a story similar to
test.story.js
in your own environment, then repeat step 5 there.The slowness of the knob can also be observed at the official storybook (linked from the addon-knobs readme), though that doesn’t have the direct comparison to the plain input. (Also, that storybook happens to use React whereas my reproducer happens to use Vue.) Similar to step 5 above, adjust some of the knobs (e. g. the “Nice” boolean) and observe how long it takes for the canvas to update.
Expected behavior
Both checkboxes, the plain one and the knob, update the content more or less instantaneously.
Screenshots
GIF:
Code snippets
See reproducer, especially
test.story.js
.System:
Additional context
This appears to affect all knobs equally, at least according to some quick tests on the official storybook (linked from the addon-knobs readme).
The text was updated successfully, but these errors were encountered: