strothj / react-docgen-typescript-loader

Webpack loader to generate docgen information from Typescript React components.
Other
360 stars 47 forks source link

Perform source code transform in a Webpack loader #3

Closed strothj closed 6 years ago

strothj commented 6 years ago

I've started work on a Webpack loader which is able to tap into the original source code and amends it with code generated using the abstract syntax tree functions from the TypeScript compiler.

Looking good so far. This will probably resolve both the issues with multiline text strings and the different module types.

It should be usable as a Webpack plugin or loader (Webpack plugin will simply inject the loader).

Goals for this loader:


First version of the loader is available here (remove plugin version first): https://github.com/strothj/react-docgen-typescript-webpack-plugin/tree/feature/add-loader

tsiq-swyx commented 6 years ago

jason, you are amazing. my skill level is not yet there to be able to help out but i hope to learn a lot from the code you are doing here. thank you.

ainalain commented 6 years ago

@strothj this is good news! Thank you for your help.

strothj commented 6 years ago

Hello,

I have a build available for a loader version of this project. You can view the details here: https://github.com/strothj/react-docgen-typescript-webpack-plugin/tree/feature/add-loader

If you would like to try this, make sure to remove the plugin version. I'm currently investing why the initial load time is so long but once its going it seems to work nicely.

I'm curious to know if this resolves all the problems from before.

ainalain commented 6 years ago

@strothj Thank you very much! New loader works perfectly! You've done an amazing work.

17

ainalain commented 6 years ago

@strothj didn't you try to customize the PropTypes table? The @types are outdated: there isn't TableComponent property in Options interface there, so it's incompatible with the Addon v3.

update: This can be fixed easily in @types index.d.ts. Sorry for troubling you. 18

strothj commented 6 years ago

Released