atlassian-labs/storybook-addon-performance

"sideEffects: false" in storybook-addon-performance

Closed this issue · 3 comments

Why "false"? Addon changes Storybook interface at least. We have real troubles with prod build of storybook and tree-shaking. Addon merely missed in prod build due to Webpack shook it.

We forced to fix it by:

import dummy from 'storybook-addon-performance/register'
window.__CHEAT_TREE_SHAKING__ = typeof dummy

But it seems like filthy hack. Strongly requesting for sideEffects: true. Beg you.

🤔

@theKashey what do you think?

  • there is no reason to use sideEffects
    First dev tool don't have to be compact, second - you are using all your code. Nothing to tree shake in real.

  • there are side effects
    Both addon and pannel registers into storybook. And that is a side effect.

  • you can keep sideEffects
    as pointed above - only register contain sideEffect, and you can point on it sideEffects:['dist/register.js']

However, lets not dig it now - it's really not really required.

👉 I would say - just remove any explicit sideEffects