-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Improve documentation to better understand how to use kotlin-inject #389
Comments
Thanks for the feedback!
Admittedly sorta yeah. Or more specifically I do feel it's written from the perspective of someone how understands base dagger well (not hilt) and wants to get running with something similar. Sounds like a good idea to make the main docs more beginner-friendly and maybe move some things to a 'dagger' vs 'kotlin-inject' page or something.
There's work being done here! Have you taken a look at https://github.com/evant/kotlin-inject/blob/main/docs/multiplatform.md? The release that includes an annotation to make it more friendly hasn't been released yet (it's only in a SNAPSHOT version) but I'm open to feedback on how to improve anything there. Would also recommend looking at our sample repo with actual projects set up. Hope this helps! |
I would mirror the OP's comment; when I integrated it into a fresh KMP project the provided documentation was a bit out of date and inaccurate (I had issues getting the component autogenerated), so I needed a few workarounds by checking other sample projects. (Alas I forgot exactly the steps I did at the time, otherwise I would have listed them here) Would be good to have a documentation starting from KMP by default (and build.gradle.kts in Kotlin) as I imagine most new users of this library will be KMP projects. As far as the feedback in improvements is concerned: I am not an experienced library publisher, but I would say:
|
Sorry for the inactivity.
@evant A "versus" page may not be the best but a migration page from dagger/hilt/koin/kodein-di to kotlin-inject is probably something that could be useful. When going through the docs again, I felt the information was going back and forth because code snippets and explanation which can be improved. Assuming that a user has no background in DI, it's probably good to start with a basic "What is a binding" and "binding vs providers" introduction and show the minimal code to achieve that.
Yes i did indeed, but with ksp being slightly unstable for kmp, I did not have time to experiment with it, since my college project deadline is tight.
That's interesting. I see that it is at the bottom part of the readme documentation. I was overwhelmed looking at the current material that I didn't scroll down to realise there was a link to a sample repo. Possibly migrate a beginner-friendly guide to a website or github pages or github wiki so that the actual git readme is less cluttered and focus on linking to the important bits.
@oblakr24 I am not a very experienced library publisher myself so I cannot comment on this but it is something for the creators to take an executive decision of. But a roadmap of implemented features and planned features is good to gauge if the library fits the needs. These are just some suggestions and I would like to talk more regarding documentation and improving the library. |
@evant one more suggestion: the multiplatform docs and the front readme of the project could be clarified as to which platforms they support. They currently mention only Android and iOS but desktop also works, and wasm I did not try yet. In fact I would recommend to put KMP support front and center in the main readme, as this is what will undoubtedly more distinguish this project from other Android-only frameworks. |
Hi, For example, one aspect I would have appreciated is understanding the equivalent of Dagger’s Since many developers exploring kotlin-inject are likely transitioning from Dagger/Hilt, having structured guidance on these differences could make onboarding much smoother. |
This issue may be subjective and not well-phrased, but I'll try my best areas that are confusing that we can perhaps work on to improve.
composeApp/
and a business logic moduleshared/
but it is not clear what dependencies should be added in each for kotlin-inject to work properly (more on that below).I am building a Compose multiplatform application where
composeApp/
module has a ViewModel where I wish to inject a repository. The repository and its dependencies live inshared/
module but I am unable to do so. The create function is an unresolved reference inComponent::class.create().repository
which is confusing.Here is a reproduction:
Again, I thought this is how you do it (since that's how Dagger Hilt did it) but I can't test if it works since the create function,
Component::class.create()
does not exist.The text was updated successfully, but these errors were encountered: