-
Notifications
You must be signed in to change notification settings - Fork 712
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
Warnings caused by renaming reflections not included in the documentation #1166
Comments
What would you expect to happen when you export local variables under a different name? There was a lot of consideration for how to handle this, starting under the misc notes in #801. It sounds like this module should potentially not be included in your documentation at all. If you change the top comment to:
The module will be excluded from your documentation, removing these errors. |
I scanned the notes #801 and was amazed on how much consideration was put into this PR. |
By reflects do you mean copies the documentation? |
Yes |
I btw also tried to get rid of the warning by adding the following header
but it still shows the warnings. |
That's weird, my best guess is that the module name plugin is messing with it... I can't reproduce locally. Thoughts on a new flag |
I'm not sure I really understand what is going on yet and created a simple test case: size.ts:
test.ts:
and run Could you help me understanding what is different to my original use case? |
The difference in your original documentation is that the eventually targeted symbol is not included in your documentation. Your generated docs don't include documentation for lodash functions. In your reproduction, the re-exported symbol is exported. (It's a bit more complicated than this, and it looks like we do have a bug, as you will see if you rename |
Still not sure I fully understand. If I just change
I again see the warning and the only difference is where I import from. |
Sorry, my first attempt at responding to this was bad, edit should have clarified a bit... but still doesn't capture everything. The problem is when TypeDoc determines if a symbol should be included in the documentation. This happens at two times.
The first case is the problem here. With: import _size from 'lodash/size';
export {
_size as size,
}; TypeDoc tries to create a reference called Then, once the whole project has been converted, we look back at all of the references and notice that there is a reference from This might actually be fixable if we can determine at conversion time if the referenced symbol will not be included in the documentation. I'll look into it. Thanks for the questions! Its helped me think through this a bit more thoroughly. |
This isn't quite ideal. Determining this and not creating a reference for external dependencies is fine, but with /**
* Some documentation that refers to _a
*/
const _a = 1
export { _a as a } |
I wanted to add some background information on my practical use cases to eventually come up with a solution. I currently have about 100 similar warnings from modules that abstract some 3rd partly libraries and would really like to get rid of them. Typically the modules export some local bindings and re-export some imported ones. I see the following options:
|
@Gerrit0 I have also been running into this problem when trying to update our document generation to typedoc The codebase that I am working on is https://github.com/0xProject/0x-mesh, and the specific package that is giving me issues is here: https://github.com/0xProject/0x-mesh/tree/master/packages/browser. When I try to generate docs with
The documentation that is created for these identifiers is:
Ideally, the documentation for the |
Well that explains it. You aren't including that other package in your documentation since declaration files are excluded by default, so it is expected that it wouldn't know what to do with these symbols. Try: npx typedoc --includeDeclarations --excludeExternals src/index.ts ./node_modules/@0x/mesh-browser-lite
|
I see. Thank you for the quick feedback. I can now see that what I am talking about is a completely separate issue from this issue thread. I actually tried that; however, typedoc seemed to have a really hard
time (as in it would take longer than 30 minutes to generate them — I gave up on Friday night after 30 minutes so it could have conceivably terminated) creating docs when I used that option (even if I deleted the
WebAssembly binary in lib). Having said this, I will try again tomorrow
morning and let you know how it goes (in another issue if appropriate).
|
This seems to work for me
|
In 0.20, this warning is completely gone - TypeDoc will remove dangling references. |
Expected Behavior
No warnings
Actual Behavior
When running the version 0.16.2 of typedoc I get the following warnings:
Steps to reproduce the bug
npx typedoc --out doc/ src/ods/lodash.ts
src/ods/lodash.ts:
Environment
The text was updated successfully, but these errors were encountered: