Hi, I'm sorry for troubling you for the second time, I'm really excited with your plugin 😇
When I commented 'react-select' import #1, all my stories have been compiled and run well. But the was no propTypes table, although I left the comments for every prop, as Storybook Addon Info described.
After debugging I found the reason if this absence.
In your example of plugin usage, the tsconfig.json file defines the module type option as
"module": "commonjs".
In our project, we use ES6 modules, so our tsconfig.json contains this line:
"module": "esnext".
As a result, the Info Addon doesn't recognize the docgen object of the passed component function: the isNotEmpty method of makeTableComponent module returns undefined. This is because Webpack references all variables in our component with WEBPACK_IMPORTEDMODULE_{number}{variableName} thing.
In comparison, the check for __docgenInfo in your example works as expected:
I see that the react-docgen-typescript also uses commonjs modules in its tsconfig.json. Maybe this is react-docgen-typescript issue, not your. Or maybe there is a known solution for my case and I didn't found it.
I'm not familiar with Webpack internal process, so for the moment, I don't know how to solve this issue.
Hi, I'm sorry for troubling you for the second time, I'm really excited with your plugin 😇
When I commented 'react-select' import #1, all my stories have been compiled and run well. But the was no propTypes table, although I left the comments for every prop, as Storybook Addon Info described.
After debugging I found the reason if this absence.
In your example of plugin usage, the
tsconfig.json
file defines the module type option as"module": "commonjs"
.In our project, we use ES6 modules, so our
tsconfig.json
contains this line:"module": "esnext"
. As a result, the Info Addon doesn't recognize the docgen object of the passed component function: theisNotEmpty
method ofmakeTableComponent
module returnsundefined
. This is because Webpack references all variables in our component with WEBPACK_IMPORTEDMODULE_{number}{variableName} thing.In comparison, the check for __docgenInfo in your example works as expected:
I see that the react-docgen-typescript also uses
commonjs
modules in itstsconfig.json
. Maybe this is react-docgen-typescript issue, not your. Or maybe there is a known solution for my case and I didn't found it. I'm not familiar with Webpack internal process, so for the moment, I don't know how to solve this issue.