Comments (17)
Dagger 2.0 has been released, and the names are, for @component Foo you get
DaggerFoo, and for @component Bar.Blah (nested) you get DaggerBar_Blah as
the implementation types for components.
On Mon, 13 Apr 2015 at 10:41 TJ (Thomas J.) Biddle [email protected]
wrote:
@cgruber https://github.com/cgruber Also - quick clarification. This
will also fix the issue regarding the prefixes having changed from the
2.0-SNAPSHOT? They used to be Dagger_xxxx And now it's just Daggerxxxx from
what I'm hearingβ
Reply to this email directly or view it on GitHub
#58 (comment).
from dagger.
Yeah, that needs to be fixed. We are actually tracking a bug internally for this.
from dagger.
+1 on the AutoValue style naming convention.
from dagger.
Hey, while we're all chatting about itβ¦
Dagger_MyComponent
or DaggerMyComponent
(or something else)
MyClass$$Factory
or MyClass_Factory
or MyClass__Factory
(or something else)
from dagger.
I'm pretty in favor of underscores. At slight checkstyle risk for the
overzealous, it avoids confusion about regular $ use.
from dagger.
For generated code that needs to be explicitly referenced, I definitely prefer underscores. For generated code that's not referenced directly I'd leave it or keep it relatively clear that it's generated.
from dagger.
I actually prefer underscores even for generated unreferenced code because
eclipse has serious problems with $. Given that all generated code is
viewable, people will step into code that will erroneously show errors.
Underscores seem to not invoke this bad editor behavior.
On Sat, Nov 8, 2014, 04:20 Jake Wharton [email protected] wrote:
For generated code that needs to be explicitly referenced, I definitely
prefer underscores. For generated code that's not referenced directly I'd
leave it or keep it relatively clear that it's generated.β
Reply to this email directly or view it on GitHub
#58 (comment).
from dagger.
Kotlin has problems with $
as well. Kill kill kill it.
from dagger.
+1
This issue stops me from migration to Kotlin
from dagger.
+1
I'm a kotlin developer. This issues stops me from migrating to dagger. :)
from dagger.
I am using Dagger 2 with Kotlin without any problems:
Components and Modules in Java, injecting like this (Android):
public class App extends Application {
private DIGraph mDIGraph;
/**
* Returns application object from context
* @param context to get application object
* @return application object
*/
public static App get(Context context) {
return (App) context.getApplicationContext();
}
@Override public void onCreate() {
super.onCreate();
mDIGraph = Dagger_DIGraph.builder()
// creating modules
.build();
}
@NonNull public DIGraph getDIGraph() {
return mDIGraph;
}
}
class SomeFragment : Fragment {
var someVar: SomeType? = null
[Inject] set
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
App.get(getActivity()).getDIGraph().inject(this)
// we can work with injected someVar
}
}
from dagger.
+1
from dagger.
π
from dagger.
+1
from dagger.
+1
from dagger.
Dagger does Dagger_OuterClass_Foo for components. It will ultimately reject $$ for generated types, but this may not happen in time for 2.0. I'm marking this as a 2.1 issue.
from dagger.
Fixed in #150
from dagger.
Related Issues (20)
- error when ksp.useKSP2=true HOT 2
- Suppress annotation on @Inject is not honored on the Factory HOT 1
- [KSP2] Dagger and Hilt incompatibility with KSP2 HOT 4
- [KSP2] NullPointerException: null cannot be cast to non-null type androidx.room.compiler.processing.XType HOT 1
- App crashing with NPE for some classes when Lazy Class Key is used HOT 7
- OutOfMemoryError with Maven HOT 1
- DaggerAppComponent not creating in the version 2.51.1 HOT 3
- java.lang.ClassNotFoundException: dagger.spi.shaded.androidx.room.compiler.processing.javac.JavacBasicAnnotationProcessor. Hilt 2.49+ HOT 1
- how to manually generate module HOT 1
- Explain how to add dagger jar files manually to the android project HOT 2
- Annotate interface with default Bind implementation HOT 2
- Transitive vulnerability from symbol-processing-api HOT 1
- java.lang.IllegalArgumentException: CreationExtras must have a value by `SAVED_STATE_REGISTRY_OWNER_KEY` HOT 4
- Update of different dependency: Error "package javax.annotation.processing is not visible" HOT 4
- Compile time error with KSP with Generics HOT 4
- java.lang.IllegalArgumentException: Multiple entries with same key HOT 4
- Execution failed for task ':app:kaptDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction > java.lang.reflect.InvocationTargetException (no error message) HOT 2
- Stackoverflow when exposing parents of Subcomponents HOT 7
- Hilt not working with android testFixtures? HOT 2
- Hilt 2.44.2 - Class not found when use @AndroidEntryPoint at WidgetReceiver HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dagger.