Skip to content

Update metro to v0.12.0#413

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

Update metro to v0.12.0#413
renovate[bot] wants to merge 1 commit intomainfrom
renovate/metro

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 25, 2026

This PR contains the following updates:

Package Change Age Confidence
dev.zacsweers.metro 0.11.40.12.0 age confidence
dev.zacsweers.metro:metrox-viewmodel-compose 0.11.40.12.0 age confidence
dev.zacsweers.metro:metrox-android 0.11.40.12.0 age confidence

Release Notes

ZacSweers/metro (dev.zacsweers.metro)

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: Enabled.

Rebasing: Whenever PR is behind base branch, 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 added the libs label Mar 25, 2026
@renovate renovate bot enabled auto-merge March 25, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants