Skip to content
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

Useless getter in Application class #1235

Closed
1 task done
LJNeon opened this issue Mar 17, 2020 · 1 comment
Closed
1 task done

Useless getter in Application class #1235

LJNeon opened this issue Mar 17, 2020 · 1 comment
Labels
question Question about functionality

Comments

@LJNeon
Copy link

LJNeon commented Mar 17, 2020

Unexpected Behavior

Here there's a getter that simply calls return this;. I can't imagine any use cases for this.

Environment

  • Typedoc version: GitHub Master
@LJNeon LJNeon added the bug Functionality does not match expectation label Mar 17, 2020
@Gerrit0 Gerrit0 added question Question about functionality and removed bug Functionality does not match expectation labels Mar 18, 2020
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 18, 2020

TypeDoc has a "component" architecture, most of the old classes in the project extend the AbstractComponent class.

This class provides a getter - application which is used for any classes in the component hierarchy to access the root level component. Once we get to the Application class though, we don't want to bubble up through the component owners anymore, and just want to return the current object.

Technically, the getter is no longer necessary. Before #845, the AbstractComponent class would return null if the component had no owner and therefore the Application class needed to override the method. Now, there is a check to satisfy strict null checks (with a type assertion that needs to go away eventually).

I want to remove the @Component decorator and the hard to follow component class structure along with it, but this needs to be done in parts to keep the changes small enough that they probably won't break things. (It has already been done to the options + options readers, next up is probably the converters)

@Gerrit0 Gerrit0 closed this as completed Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about functionality
Projects
None yet
Development

No branches or pull requests

2 participants