Skip to content

Option to exclude only unused externals #926

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

Closed
rochdev opened this issue Dec 22, 2018 · 6 comments
Closed

Option to exclude only unused externals #926

rochdev opened this issue Dec 22, 2018 · 6 comments

Comments

@rochdev
Copy link

rochdev commented Dec 22, 2018

Right now, when setting the excludeExternals option to true, all externals are excluded, even the ones that are actually used (i.e. subclassed). When setting it to false, all externals are included, regardless of if they are used or not.

There should be an option to exclude only externals that are not actually used. In my opinion this should even be the default, since I think in most cases it's the expected behavior.

@aciccarello
Copy link
Collaborator

This is a good idea but there are some complications. It would need to be coupled with larger improvements to the Internal/External distinction. I've opened #927 to track tasks for larger improvements.

The complicated part of this is knowing how to trim the dependency tree. Additionally, an imported external could import a whole tree of types even if they aren't used directly. So in many cases the externals listed would still be much longer than expected. I think the easiest way to handle large amounts of externals is to make sure that the externals aren't listed in the generated docs but you can still link to them if needed. Other suggestions are welcome too.

@rochdev
Copy link
Author

rochdev commented Dec 28, 2018

Maybe an option to include specific externals then? For my use case it's only a single external that I need to include.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Dec 28, 2018

You might be able to use typedoc-plugin-internal-external to mark that external as internal.

(Not sure this will work, but if it is in an @types package, try declaration merging and adding the @internal marker there)

@rochdev
Copy link
Author

rochdev commented Dec 29, 2018

Thanks for the suggestion @Gerrit0! Unfortunately, I'm using the "file" mode and when converting the external to an internal the classes get mixed up with the real internal ones. I'll try to do some more testing with "modules" mode, but so far only "file" mode gave me the correct result for internals.

@cactysman
Copy link

cactysman commented Nov 10, 2019

Any new insights here?
I'd like TypeDoc to include externals like PathLike that I do use, but exclude those thousands of other declarations I don't use anywhere.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Nov 10, 2019

Unfortunately there is way more work to be done here than anyone has time. I don't think anyone's touched this issue recently. Feel free to give solving it a shot if you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants