You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently begun splitting my project's monolith component into smaller dagger components, using Component dependencies. I expected when pulling out dependencies from the monolith into smaller ones that the code size of the generated monolith component would decrease, but it has actually increased.
Looking through the previously generated code, whenever an object Foo was accessed to create another object the component would call a private method getFoo():
privateBargetBar() {
returnnewBar(getFoo());
}
However now every time Foo is accessed (which has been moved to another component), the precondition check is called inline:
privateBargetBarCreator() {
returnnewBar(Preconditions.checkNotNull(DaggerMonolithComponent.this.otherComponent.foo(), "Cannot return null from a non-@Nullable component method"));
}
This same code block is duplicated hundreds of times in the component leading to longer code generation time and longer compilation time. Can we add a build optimization to generate a private accessor method that does this safety check for each component dependency used?
The text was updated successfully, but these errors were encountered:
I have recently begun splitting my project's monolith component into smaller dagger components, using Component dependencies. I expected when pulling out dependencies from the monolith into smaller ones that the code size of the generated monolith component would decrease, but it has actually increased.
Looking through the previously generated code, whenever an object
Foo
was accessed to create another object the component would call a private methodgetFoo()
:However now every time
Foo
is accessed (which has been moved to another component), the precondition check is called inline:This same code block is duplicated hundreds of times in the component leading to longer code generation time and longer compilation time. Can we add a build optimization to generate a private accessor method that does this safety check for each component dependency used?
The text was updated successfully, but these errors were encountered: