storybook: Action addons is slow to log events
Issue details
A callback that logs the passed event directly to an action can incur a noticeable delay before logging.
For instance, in cra-kitchen-sink if you change the story to:
storiesOf('Button', module)
.add('with text', () => (
<Button onClick={e => action('clicked')(e,e,e,e,e)}>
{setOptions({ selectedAddonPanel: 'storybook/actions/actions-panel' })}
Hello Button
</Button>
It takes probably 2-3s for the action to be logged in the actions pane, on my iMac.
Notes:
-
It seems to depend on the complexity of your app exactly how slow it is. In the kitchen sink app (a CRA app) you need (say) 5 events to see it clearly. I can’t make it very noticeable in the
official-storybookapp (which is raw react), even with a lot of events. In my actual app it’s noticeable with a single event. -
React <=15.6.1 makes this worse as it passes essentially 2 events by default.
-
The time is actually in the manager side of things; serializing the events is fairly quick.
Please specify which version of Storybook and optionally any affected addons that you’re running
@storybook/react@3.3.2@storybook/addon-actions@3.3.2
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 4
- Comments: 22 (13 by maintainers)
Noticing a major performance issue with actions specifically on non-chrome browsers. In some cases, it freezes the entire window for multiple seconds (when mapping actions to sub-items in a grid). But even root level actions on a simple button cause 1 second of freezing.
I still see this issue. Reducing depth worked.
I’m seeing this issue in react as well.
I think this would be a great improvement to the current workaround!