anvil icon indicating copy to clipboard operation
anvil copied to clipboard

Insight on the kotlin 2.0 situation (activity in feature branch)

Open ursusursus opened this issue 1 year ago • 6 comments

Hi, me & many other patiently track this repo about updates on the kotlin 2.0 blocker for quite some time now.

I'm not pressuring anyone as this is free & opensource work, which I respect, but it would be helpful to have some insight from the team about the situation.

I read in the zac sweer's blog post that the hooks anvil needs were unexpectedly removed in the 2.0 compiler, but then I noticed some activity in feature branch https://github.com/square/anvil/commits/joel.kotlin-2.0.21/

So, what is the situation? Did kotlin team put some hooks back in for us & therefore will anvil be able to support kotlin 2.0?

ursusursus avatar Nov 27 '24 23:11 ursusursus

We are actively working on sharing a roadmap wrt Kotlin 2.0 and K2 for Anvil. It's interrupted by US Thanksgiving holidays right now, but expect something soon.

steve-the-edwards avatar Nov 28 '24 14:11 steve-the-edwards

The roadmap is now available here

JoelWilcox avatar Dec 09 '24 21:12 JoelWilcox

So does the breaking of the dependency on dagger basically mean that Anvil is it's own separate DI library? Right now it's a mechanism for assembling dagger components dynamically.

From what i can tell by reading the roadmap, that will no longer be the case as part of the K2 work.

Or am i misreading something?

mattinger avatar Feb 05 '25 20:02 mattinger

So does the breaking of the dependency on dagger basically mean that Anvil is it's own separate DI library?

That's correct, when we get to that stage then Anvil will be independent of Dagger, although it will likely still share the same API initially.

From what i can tell by reading the roadmap, that will no longer be the case as part of the K2 work.

Or am i misreading something?

One clarification here is that they are sequential efforts. The work to get K2 supported in Anvil is happening currently but will not affect Anvil's relationship to Dagger. Once K2 support is finished, then the team will start on implementing its own Component generation and breaking the library dependency on Dagger. Let me know if that makes sense! Also happy to adjust the roadmap wording if you feel like it could be clearer about this :).

JoelWilcox avatar Feb 12 '25 01:02 JoelWilcox

Makes sense I'm curious if there's any rough timeframe for the k2 support? If the answer is no that's fine just looking to have any if possible when it might come.

mattinger avatar Feb 13 '25 16:02 mattinger

There's no specific target date at the moment since we're at a pretty early phase in the implementation. The best estimate I could give is that it's likely at least a few months away still.

JoelWilcox avatar Feb 14 '25 03:02 JoelWilcox