storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.94k stars 9.21k forks source link

Can't use storyStoreV7 with Flow #17024

Open lyleunderwood opened 2 years ago

lyleunderwood commented 2 years ago

Describe the bug

It seems like storyStoreV7 depends on this babelParse utility that has a hardcoded configuration:

https://github.com/storybookjs/storybook/blob/cf4b3c77bad29c941b91620bcf84aeb79cbb33c9/lib/csf-tools/src/babelParse.ts#L6-L12

Because of this, Flow-specific syntax cannot be supported without getting a parser error from babel. I've confirmed that if I replace typescript with flow in the above code, I no longer get the parser error.

To Reproduce

Run storybook with any story files using flow-specific syntax.

System

Environment Info:

  System:
    OS: Linux 5.4 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
  Binaries:
    Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
    Yarn: 1.22.15 - ~/dev/elastic/scramble-com/node_modules/.bin/yarn
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
  Browsers:
    Chrome: 68.0.3440.75
    Firefox: 95.0
  npmPackages:
    @storybook/addon-actions: 6.4.9 => 6.4.9 
    @storybook/addon-essentials: 6.4.9 => 6.4.9 
    @storybook/addon-knobs: 6.3.1 => 6.3.1 
    @storybook/addon-options: ^5.3.21 => 5.3.21 
    @storybook/addons: 6.4.9 => 6.4.9 
    @storybook/builder-webpack5: 6.4.9 => 6.4.9 
    @storybook/manager-webpack5: 6.4.9 => 6.4.9 
    @storybook/react: 6.4.9 => 6.4.9 
    @storybook/theming: 6.4.9 => 6.4.9 

Additional context N/A

stale[bot] commented 2 years ago

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!

sysofwan commented 2 years ago

Not stale. storyStoreV7 is not respecting babel config, and this is blocking us from migrating.

valscion commented 1 year ago

Looks like https://github.com/storybookjs/storybook/pull/21859 would also fix this issue.

valscion commented 1 year ago

@lyleunderwood can you check if v7.1.0-alpha.9 has fixed this issue? For reference: