-
Notifications
You must be signed in to change notification settings - Fork 28
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
Stale __docgenInfo generated due to cache #28
Comments
This is the same problem as this issue but the cache was introduced after this bug was seen. So i'm not sure it's the caching that is going wrong. If you comment out the caching code the problem can still be seen Me and @ndelangen tried debugging this to no avail. If you place a console log here you can see that the docs get generated correctly, it just doesn't trigger webpack to reload. If you can find a solution I will happily merge it! |
I think the problem is at this line, here In my own project, if I comment out cache-related code in the plugin, no stale __docgenInfo will be generated. I can provide a re-production repo later. This cache makes it worse because the cache is written to disk, so even user restart webpack they may still get stale __docgenInfo. |
You if you could to ids a reproduction repo that would be great. You could also try out 0.6.3 before I added the caching |
But yeah I could see how this would make the problem worse. Is there a way to get the original source value? That would make the cache better |
reproduce demo: https://github.com/shinima/temp-react-docgen-typescript-plugin-issue28 steps to reproduce and debug are listed in readme |
There are cases that the user edits some An option to disable the cache can be a workaround. I don't known there is a better way to handle this. |
Thanks for the library, it's very helpful when developing a React component library doc site.
react-docgen-typescript-plugin/src/plugin.ts
Lines 99 to 109 in abe4c74
webpackModule._source._value
seems to be the output of the ts-loader. So when user only edits the comments in a TS interface,webpackModule._source._value
will keep same as before ( because the whole interface code is stripped by ts-loader) . In this case, the produced__docgenInfo
will be incorrect, and the doc page which consumes__docgenInfo
will display wrong interface comments.The text was updated successfully, but these errors were encountered: