Skip to content
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

Flow support #10131

Closed
lihanqi opened this issue Mar 16, 2020 · 11 comments
Closed

Flow support #10131

lihanqi opened this issue Mar 16, 2020 · 11 comments

Comments

@lihanqi
Copy link

lihanqi commented Mar 16, 2020

Hi I'm currently working with docs and since our team is using Flow, Im wondering if current addon-docs support Flow props table?

I have seen some issues but its still unclear to me. I saw there is a way to use react-docgen-typescript-loader in webpack loader as follows:

module.exports = {
  webpackFinal: async config => {
    config.module.rules.push({
      test: /\.(ts|tsx)$/,
      use: [
        {
          loader: require.resolve('ts-loader'),
        },
        // Optional
        {
          loader: require.resolve('react-docgen-typescript-loader'),
        },
      ],
    });
    config.resolve.extensions.push('.ts', '.tsx');
    return config;
  },
};

Since react-docgen already support Flow, can we replace require.resolve('react-docgen-typescript-loader') with something similar?

Any help would be appreciate, thanks ahead.

@shilman
Copy link
Member

shilman commented Mar 16, 2020

@lihanqi can you try the recommended 6.0 setup (should work in 5.3 too):

https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-prop-tables-with-typescript

We've consolidated on react-docgen as our typescript solution.

@lihanqi
Copy link
Author

lihanqi commented Mar 17, 2020

@shilman Thanks for the reply!

Currently I'm using 5.3.14. It seems does not support Flow type check, not TypeScript. Is Flow doc parsing natively supported in 6.x?

@shilman
Copy link
Member

shilman commented Mar 17, 2020

@lihanqi i'm pretty sure @patricklafrance got flow working. i'm working on the docgen default configuration this week and will try to get a reference example ready for flow.

@lihanqi
Copy link
Author

lihanqi commented Mar 17, 2020

Sounds awesome! Thanks!

@lihanqi lihanqi closed this as completed Mar 17, 2020
@shilman
Copy link
Member

shilman commented Mar 17, 2020

Keeping this open

@shilman shilman reopened this Mar 17, 2020
@shilman shilman self-assigned this Mar 17, 2020
@raen79
Copy link

raen79 commented Mar 23, 2020

Hey guys, does anyone have even a temporary solution. I would need this feature quite urgently and I can't figure out how to get it working ... :(

@stale
Copy link

stale bot commented Apr 13, 2020

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!

@stale stale bot added the inactive label Apr 13, 2020
@stale
Copy link

stale bot commented May 13, 2020

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed May 13, 2020
@pascalduez
Copy link
Contributor

I'm interested in Flow support as well, shouldn't be too much hassle since react-docgen already parse it pretty well.

I tried with typescript: { reactDocgen: 'react-docgen' } (oh the irony) but doesn't change a thing.

@shilman
Copy link
Member

shilman commented Aug 18, 2020

@pascalduez That setting does change Storybook to use react-docgen under the hood. There are downstream fixes that need to be made to support Flow. Contributions welcome!

@pascalduez
Copy link
Contributor

Thanks @shilman, will try to digg deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants