-
-
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
Addon actions: fix slow logging #3133
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3133 +/- ##
==========================================
+ Coverage 36.74% 37.05% +0.31%
==========================================
Files 459 463 +4
Lines 10144 10219 +75
Branches 906 923 +17
==========================================
+ Hits 3727 3787 +60
- Misses 5884 5905 +21
+ Partials 533 527 -6
Continue to review full report at Codecov.
|
Can we make it configurable? I think there might be situations where people may need deeper nesting |
Yes, it possible to make it configurable. Should I implement this by listening on the channel for options set by the |
I think exporting a configuration function from actions addon would be more explicit |
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! |
Sorry, no code update yet, I was only bringing this branch up to date. |
addons/actions/src/lib/retrocycle.js
Outdated
@@ -2,7 +2,6 @@ import reviver from './reviver'; | |||
import { muteProperty } from './util'; | |||
import { CYCLIC_KEY } from './'; | |||
|
|||
// eslint-disable-next-line no-control-regex |
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.
Looks like it's still needed
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.
Yeah, my ide reported it wasn't, will put it back.
addons/actions/src/index.js
Outdated
// addons, panels and events get unique names using a prefix | ||
export const ADDON_ID = 'storybook/actions'; | ||
export const PANEL_ID = `${ADDON_ID}/actions-panel`; | ||
export const EVENT_ID = `${ADDON_ID}/action-event`; | ||
|
||
export * from './preview'; |
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.
Yeah, unfortunately this export *
syntax doesn't play well with transform-runtime
babel/babel#2877
Can you please add an example with deeply nested object and different |
It seems the performance gain still relies on setting a fixed The decision I made there seems a bit arbitrary, but when I remove that part logging something like window will hang again. I'm not sure yet what would be a better way to prevent this. Perhaps it's also the amount of properties/entries per object and not only the depth which causes the lag. |
I assume it's ready |
Addon actions: fix slow logging
All non plain objects will be serialized to a depth of 2.
Events are not treated differently anymore traversing is also cut off at the depth of 2.
All plain objects are still serialized until a depth of 10 (could probably be increased)
Properties starting with double underscore
__
and the storybook'sSTORYBOOK_
vars are not serialized and ignored.fixes #2590