GithubHelp home page GithubHelp logo

Comments (6)

strothj avatar strothj commented on June 12, 2024 1

The TypeScript library itself has the concept of a project and it's associated loaded files. There was actually a recent pull request which was merged that sped up the parsing by reusing the existing project. I'm not sure if the reason for the limitation is in this loader or the parsing project this wraps.

react-docgen-typescript has a class which is responsible for extracting types. A first step would be to see if this behavior can be reproduced in that library under Styleguidest.

As far as parsing types goes, we actually don't do any of that in this project. We take the output from that project and inject the output in a way that Storybook can use.

from react-docgen-typescript-loader.

donifer avatar donifer commented on June 12, 2024

Same question here :)

from react-docgen-typescript-loader.

einaralex avatar einaralex commented on June 12, 2024

@strothj How would I go about extending the loader to accept an extended interface ?
I've tried a couple of different things to get this to work with the latest version, extending an interface or doing React.FC<Props & WidgetBodyProps > only returns the props of Props to the props-table.
I'm reusing props between a couple of form components and would love to be able to use this package for our component library.
Importing the reusable interface to the story doesn't seem to work either.

from react-docgen-typescript-loader.

SuZhou-Joe avatar SuZhou-Joe commented on June 12, 2024

Please help here. Run into the same problem that extended props defined can not be detected either in story.jsx nor after compiled.

from react-docgen-typescript-loader.

paibamboo avatar paibamboo commented on June 12, 2024

This is a bit tricky because the loader is executed once for each file seen by webpack, and at that time we have no information of some other extended interfaces imported from other files. Here's my rough idea, since loader can be asynchronous, we could wait until we iterate through every files so that we have all information before calling generateDocgenCodeBlock(). Another idea is we can gather information during loader execution, and in after compile hooks we can do something with that information.

from react-docgen-typescript-loader.

nextglabs avatar nextglabs commented on June 12, 2024

Any workarounds for this?

from react-docgen-typescript-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.