-
Notifications
You must be signed in to change notification settings - Fork 79
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
Prototype support for kotlin-inject #1197
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thinking it might be better to leave the parent component to the class itself // Write a merged circuit component that extends from it
// The argument is the scope key
// Primary constructor params are just copied to the generated impl and passed up
@MergeCircuitComponent(AppScope::class)
abstract class AppScopeCircuitComponent(@Component val parent: AppComponent) : CircuitComponent |
ZacSweers
force-pushed
the
z/improvedCodeGen
branch
from
February 12, 2024 19:25
8bc0e98
to
5e5970a
Compare
I'm not sure this has wheels until evant/kotlin-inject#351 is available. I'm also not able to figure out a way to get past this hurdle of deferring generation until kotlin-inject runs 🤔. I suspect there may be a problem with both plugins deferring. |
Closing for now, can revisit if there are upstream changes that unlock this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds code gen support for @evant's https://github.com/evant/kotlin-inject
Adapting from @joshafeinberg's prior prototyping in https://github.com/joshafeinberg/CircuitKotlinInject
This works by introducing an
@MergeCircuitComponent
annotation that can be used on a scoped "circuit component" interface that code gen then processes and generates a kotlin-inject-compatible component impl for, aggregating bound UI and presenter factories within the module.Pros: multiplatform!
Cons: aggregating processor, no cross-module hinting like anvil and hilt do
Example
Everything else works the same before as far as using
@CircuitInject
.TODO