Skip to content

fix(deps): update metro to v0.13.0#579

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/metro
Open

fix(deps): update metro to v0.13.0#579
renovate[bot] wants to merge 1 commit intomainfrom
renovate/metro

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Mar 16, 2026

This PR contains the following updates:

Package Change Age Confidence
dev.zacsweers.metro 0.11.40.13.0 age confidence
dev.zacsweers.metro:gradle-plugin 0.11.40.13.0 age confidence

Release Notes

ZacSweers/metro (dev.zacsweers.metro)

v0.13.0

Compare Source

2026-04-04

New
Circuit codegen

Metro now includes experimental built-in support for Circuit, a Compose-first architecture for building kotlin apps. See the docs for more details.

In the long term, this will eventually move out to a separate plugin that can gracefully participate with Metro's code gen APIs. This is initially implemented within Metro to ease development.

generateContributionProviders

This release introduces a new generateContributionProviders API (Kotlin 2.3.20+) to optimize behavior with contributed APIs.

Up to now, Metro's aggregation APIs (i.e. @Contributes* binding annotations) have worked similar to Anvil, where the ultimately just generate @Binds declarations as simple shorthands for the consuming graphs. This comes with the caveat that the injected class must be publicly visible if it's used outside of that module.

Now, if you enable the new generateContributionProviders feature, Metro will instead generate top-level @Provides declarations that mirror the injected class's inputs but only return its bound type. This means the annotated class can remain internal, which both helps encapsulation and incremental compilation.

interface Base

@​ContributesBinding(AppScope::class)
@​Inject
internal class Impl : Base

// Works across modules!
@​DependencyGraph(AppScope::class)
interface AppGraph {
  val base: Base
}

The tradeoff is that Impl is no longer available directly on the graph. If you had any explicit code usages of Impl, you would have to remove those too in favor of purely the bound type.

[MEEP-1776] @DefaultBinding

This release introduces a new @DefaultBinding annotation that allows for setting a default binding on supertypes of contributed classes. This is useful for common base classes with generics that would otherwise require repetitive (or error-prone) explicit binding<T>() declarations in subtypes.

@&#8203;DefaultBinding<BaseFactory<*>>
interface BaseFactory<T : BaseFactory<T>>

@&#8203;ContributesIntoSet(AppScope::class) // now implicitly contributed as BaseFactory<*>
@&#8203;Inject
class HomeFactory(...) : BaseFactory<HomeFactory>
Enhancements
  • [IR] Use more unique diagnostic names in IR diagnostics (previously just used METRO_ERROR for a general catch-all in a lot of places).
Fixes
  • [IR] Consider Anvil's rank parameter when processing contributed binding containers.
  • [IR] When reporting qualifier mismatches, if a qualifier is absent on one declaration then the message will now say "absent" rather than the vague "null".
Changes
  • Support Kotlin 2.4.0-Beta1
  • Removed @Assisted.value. See the docs on why in case you missed this! TL;DR, Metro matches by parameter names going forward.
  • Remove deprecated compiler options and Gradle extension properties.
    • chunkFieldInits
    • transformProvidersToPrivate
    • publicProviderSeverity (use publicScopedProviderSeverity)
    • assistedIdentifierSeverity
    • generateThrowsAnnotation
Contributors

Special thanks to the following contributors for contributing to this release!

Consider sponsoring Metro's development

v0.12.1

Compare Source

2026-03-30

Enhancements
  • Support top-level FIR gen (contribution hints, function inject, etc) in Kotlin/JS on 2.3.21+ and 2.4.0-Beta2+.
  • Support generic (top-level) function injection.
Fixes
  • [FIR] Make allSessions lookup lazy to avoid lockups in the IDE.
  • [IR] Exclude generated data class copy functions from @Includes accessor candidates.
  • [IR] Exclude destructuring component functions from @Includes accessor candidates.
Changes
  • Update shaded androidx.tracing to 2.0.0-alpha04.
  • Update shaded Wire dependency to 6.2.0.
  • Test Kotlin 2.4.0-Beta1.
Contributors

Special thanks to the following contributors for contributing to this release!

v0.12.0

Compare Source

2026-03-24

New
[MEEP-2014] Implicit class (map) keys

MapKey.implicitClassKey is a new API to allow for class-based map keys to have their class parameters inferred on classes and @Binds declarations.

This means that instead of redeclaring the annotated class in the key, for example @ViewModelKey, you can now omit it and it will be inferred.

@&#8203;ViewModelKey // <-- implicitly HomeViewModel::class
@&#8203;ContributesIntoMap(AppScope::class)
class HomeViewModel : ViewModel()

For classes, the implicit type is the annotated class. For @Binds declarations, the receiver or single parameter are the implicit type.

You may still specify an explicit type. The compiler will warn you if you specify a redundant one. If you need to suppress this diagnostic temporarily to ease migration, you can add -Xwarning-level=MAP_KEY_REDUNDANT_IMPLICIT_CLASS_KEY:disabled to your compiler arguments.

The compiler will also error if you attempt to do this on @Provides declarations, as those cannot be inferred.

Metro's first-party class-based map keys (like @ClassKey, @ViewModelKey, etc.) now support this. Custom map keys can opt-in to this by setting MapKey.implicitClassKey to true. See its doc for more details.

@&#8203;MapKey(implicitClassKey = true)
annotation class ViewModelKey(val value: KClass<out ViewModel> = Nothing::class)
Misc
  • [metrox-viewmodel] Add mingwX64 target.
Enhancements
  • [FIR] Add diagnostic to ensure map key annotations support FUNCTION targets if they have a @Target annotation.
  • [FIR] Improve annotation argument matching to only use fully resolved names or none at all. This helps avoid situations in the past with interop where an argument at the same index and type but different name could incorrectly be used.
Fixes
  • [IR] Fix IllegalArgumentException thrown when there are multiple top-level functions with the same name but only one is annotated with @Inject.
  • [IR] Only store a given binding container's own provider factories in metro metadata. This resolves a bug where we could end up duplicate-processing upstream providers in dynamic factories.
  • [IR] Fix a severity conversion compat function call for Kotlin 2.3.20+.
  • [IR] Ensure stable sort of output SuspiciousUnusedMultibinding locations.
  • [IR] Don't skip dynamic keys inherited from parent graphs when working with dynamic graphs.
  • [IR] Propagate @OptionalBinding annotations to generated static factory creators if present.
  • [IR] Preserve nullability when remapping parameters with generic layers.
  • [Runtime] IntoSet and IntoMap no longer have a Target of AnnotationTarget.CLASS
Changes
  • The Metro compiler now requires JVM 21+. Note that the runtime JVM artifacts still target 11 unless otherwise documented.
  • The Metro Gradle plugin now requires JVM 21+.
  • The Metro Gradle plugin now requires Gradle 9+. Note that if you do not use Kotlin Gradle DSL, it may work on older versions but YMMV.
  • The Metro Gradle plugin now targets Kotlin 2.2.
  • @Assisted.value is formally deprecated now. See the docs on why in case you missed this! TL;DR, Metro matches by parameter names going forward.
  • Metro's main branch now builds with Kotlin 2.3.20 but still targets Kotlin 2.2 for its runtime artifacts and supports 2.2.20 all to 2.4.0 dev builds in its compiler.
  • Remove deprecated macosX64, tvosX64, and watchosX64 targets.
  • Update Kotlin 2.4 compat support from 2.4.0-dev-539 to 2.4.0-dev-2124. This should support the upcoming IntelliJ 2026.1 release as well as the upcoming Kotlin 2.4.0-Beta1.
  • Test IntelliJ 2026.1 RC.
  • Update shaded Wire dependency to 6.1.0.
Contributors

Special thanks to the following contributors for contributing to this release!


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/metro branch from 48e5470 to 8cc29c8 Compare March 17, 2026 10:18
@renovate renovate bot changed the title fix(deps): update metro to v0.11.3 fix(deps): update metro to v0.11.4 Mar 17, 2026
@renovate renovate bot force-pushed the renovate/metro branch from 8cc29c8 to d6a09b2 Compare March 20, 2026 07:13
@renovate renovate bot changed the title fix(deps): update metro to v0.11.4 fix(deps): update metro to v0.11.4 - autoclosed Mar 20, 2026
@renovate renovate bot closed this Mar 20, 2026
@renovate renovate bot deleted the renovate/metro branch March 20, 2026 14:27
@renovate renovate bot changed the title fix(deps): update metro to v0.11.4 - autoclosed fix(deps): update metro to v0.12.0 Mar 25, 2026
@renovate renovate bot reopened this Mar 25, 2026
@renovate renovate bot force-pushed the renovate/metro branch 3 times, most recently from 378cf40 to c901660 Compare March 30, 2026 21:32
@renovate renovate bot changed the title fix(deps): update metro to v0.12.0 fix(deps): update metro to v0.12.1 Mar 30, 2026
@renovate renovate bot force-pushed the renovate/metro branch from c901660 to d813595 Compare April 5, 2026 04:40
@renovate renovate bot changed the title fix(deps): update metro to v0.12.1 fix(deps): update metro to v0.13.0 Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants