-
-
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
Fixed knobs-addon performance issues #1039
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1039 +/- ##
==========================================
+ Coverage 12.74% 12.89% +0.15%
==========================================
Files 199 199
Lines 4472 4489 +17
Branches 711 714 +3
==========================================
+ Hits 570 579 +9
- Misses 3272 3278 +6
- Partials 630 632 +2
Continue to review full report at Codecov.
|
@Gongreg do you need help rebasing? |
+1 lgtm, looks like it would definitely help for props that trigger big dom changes. thanks for the PR @Gongreg ! |
@ndelangen Just like we talked in slack, if you could rebase it would be cool :) |
I will rebase this for you. |
…ability to pass debounce option when adding decorator
rebased ! |
I'm in favor of fixing the lint issues: Actually scratch that, they're already existing so don't worry about it. Let's get this in the next alpha? |
Issue: #809 Add throttling/batching of updates for addon-knobs.
Fixing performance issues
Added timestamps to setKnobs event.
If user is typing, his typing shouldn't be interrupted by randomly happening setKnobs action. Now setKnobs will actually do something only after user finishes typing.
Example
Added ability to pass debounce option when adding decorator
As #92 said we needed an option to add debouncing to knob changes.
I added an option to pass options when adding decorator to story.
Example
Difference between these two updates
The first update timestamps solves issues that happen when developing locally, since sometimes setKnobs happened after user has already started typing and it reverted the typing.
The debounce is useful if you are using knobs over the air, in device or in separate server, it simply doesn't send so many requests.
Of course you can use both at the same time:
Things to note
How to test
See examples above.