You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[FIR] Add a diagnostic warning that @Module.subcomponents is ignored by Metro (when Dagger interop is enabled).
[FIR] Add a diagnostic error for annotating @AssistedInject types with @Contributes* annotations, as they are not compatible.
Enhancements
[FIR] Resolve copied typerefs (if necessary) in FIR code gen. This appears to help avoid some IDE FIR issues.
[FIR] Make renderAnnotationArgument() more lenient.
[FIR] Handle FirNamedArgumentExpression in renderAnnotationArgument().
[FIR/tracing] Tracing now also covers the FIR phase. Each FIR session and each IR module fragment writes its own .perfetto-trace file. All files from a single compilation share an id prefix and use the naming <id>-<phase>-<moduleName>.perfetto-trace (e.g. 260505-133503-fir-commonMain.perfetto-trace, 260505-133503-ir-main.perfetto-trace).
[FIR/IR] Pure binding contributions (@ContributesBinding/@ContributesIntoSet/@ContributesIntoMap without @ContributesTo) are now routed through as binding containers instead of being merged into graphs as supertypes. This avoids one synthetic supertype per contributing class on the merged graph. This is the default behavior now. If you have any issues, you can temporarily disable via metro.compilerOptions.disable("binding-contributions-as-containers") to restore the supertype-merge behavior.
[IR] Make SwitchingProvider.invoke() faster by hoisting the id field into a local before the when, allowing the JVM backend to lower it to tableswitch (O(1)) instead of a chain of integer compares.
[IR] Empty Set multibindings accessed through a provider now emit SetFactory.empty() (a singleton) rather than allocating a builder and an empty backing set on every graph init.
[IR] Improve validation trace locations for providers generated by generateContributionProviders.
[IR] Annotate generated provider factory classes' mirror functions with @ComptimeOnly.
[IR] Mark generated @Binds getters as OPEN rather than leaving them ABSTRACT.
[IR] Make a number of compiler internals lazier, cached, or faster. Improves top-line compiler IR performance traces ~5–15%.
[IR] Do not process platform type supertypes.
[IR] Compare IrTypeKey instances structurally instead of by rendered strings.
[IR/graph] Pre-size internal hash collections to avoid resizing during validation.
[IR/graph] Faster compilation for modules with many @Binds/@ContributesBinding declarations by batching incremental-compilation lookup tracking per graph rather than per-callable.
[IR/graph] Small additional compile-time win from using cheaper short-lived working sets during binding-graph population.
[IR/graph] Significantly faster binding-graph validation on projects with deep or wide dependency graphs (the graph seal drops ~60% in benchmarks).
[IR/graph] When populating bindings from roots, track a processedKeys set so duplicate queue entries don't re-walk dependency lists. This avoids unnecessary extra iterations when doing an initial reachability walk.
[IR/graph] Merge two annotation walks in supertype collecting into a single pass with a per-annotation-class meta-annotation cache, so @Qualifier/@Scope-style annotations appearing across many supertypes are meta-walked once instead of N times.
[IR] Add (advanced use only) support for chunking supertype merging in graphs. This is only for extraordinarily large graphs that may contribute more supertypes than fit in a JVM class. See performance docs
[IR/reports] Improve readability of Kotlin IR dumps in reporting.
[IR/tracing] Add a lot more tracing spans for more granular tracing.
[IR/tracing] Don't delete previous traces on new compilations. Now traces are just added to the designated directory each compilation when enabled.
[IR/runtime] For multibound maps/sets with exactly one element, Metro now generates optimized IR that uses optimized SingletonSet/SingletonMap implementations at runtime and skips the unnecessary throwaway builder allocation. Note that, when using interop, the generated code for Dagger's internal set/map factories still generates the necessary builder intermediary.
[runtime/internal] Some runtime internal APIs now use @JvmStatic/@JsStatic or value classes where possible. Should be no difference to consumers.
Fixes
[IR] Fix Map<K, () -> V> multibindings on Kotlin/JS. Provider does not extend () -> T on JS, so when such a map was consumed via Provider<Map<K, () -> V>> the values were Metro Provider instances and weren't callable as JS functions, surfacing at runtime as TypeError: ... is not a function. Metro now uses a JS-only runtime MapFunctionFactory for these cases that stores correct () -> V lambdas.
[IR] Fix member injection Invalid type arg error when class has more generic type parameters than its parent.
[IR] Avoid generating nested @GraphExtension impl class file names that exceed the 255-byte per-segment filesystem limit. Deeply chained extensions now fall back to a stable hashed simple name once their projected basename would cross the threshold, and a warning is emitted at chain depths of 10+.
[IR/circuit] Fix Kotlin/Wasm call_ref precise-type mismatches in generated Circuit factories. Some platforms silently tolerated these IR-level type ambiguities, but Kotlin/Wasm rejects them at load-time.
Insert implicit casts when a generated Presenter.Factory/Ui.Factory dispatches its screen: Screen parameter to an underlying assisted factory or @Inject @​Composable function that expects a more specific Screen subtype.
Use the substituted return type when invoking the backing Provider<T> for non-wrapped injected dependencies. Without this, the IR call's type was the unsubstituted T.
[IR/circuit] Propagate qualifier annotations from @CircuitInject declarations to the generated factory classes.
Changes
Metro now uses... Metro! The Metro compiler now uses proper DI internally, bootstrapping itself. This isn't really anything library consumers have to think about, I just think it's neat.
Metro now runs IC integration tests on all major platforms it targets.
Test Kotlin 2.4.0-RC builds.
Test Kotlin 2.4.20 dev builds.
Test Android Studio Panda 4 Patch 1 (2025.3.4.7).
Test Android Studio Quail 1 Canary 4 (2026.1.1.4).
Update shaded Wire version to 6.3.0.
Contributors
Special thanks to the following contributors for contributing to this release!
📱 Scan the QR code below to install the build (arm64 only) for this PR.
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/mS5HMM
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.24%. Comparing base (0c3c9f4) to head (5bdee13). ⚠️ Report is 11 commits behind head on develop.
This file contains hidden or 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
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 PR contains the following updates:
1.0.0→1.1.11.0.0→1.1.11.0.0→1.1.1Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
ZacSweers/metro (dev.zacsweers.metro)
v1.1.1Compare Source
2026-05-14
Changes
Consider sponsoring Metro's development
v1.1.0Compare Source
2026-05-13
This release is identical to 1.0.1 but removes support for Kotlin
2.2.20and2.2.21.Consider sponsoring Metro's development
v1.0.1Compare Source
2026-05-13
New
@Module.subcomponentsis ignored by Metro (when Dagger interop is enabled).@AssistedInjecttypes with@Contributes*annotations, as they are not compatible.Enhancements
renderAnnotationArgument()more lenient.FirNamedArgumentExpressioninrenderAnnotationArgument()..perfetto-tracefile. All files from a single compilation share an id prefix and use the naming<id>-<phase>-<moduleName>.perfetto-trace(e.g.260505-133503-fir-commonMain.perfetto-trace,260505-133503-ir-main.perfetto-trace).@ContributesBinding/@ContributesIntoSet/@ContributesIntoMapwithout@ContributesTo) are now routed through as binding containers instead of being merged into graphs as supertypes. This avoids one synthetic supertype per contributing class on the merged graph. This is the default behavior now. If you have any issues, you can temporarily disable viametro.compilerOptions.disable("binding-contributions-as-containers")to restore the supertype-merge behavior.SwitchingProvider.invoke()faster by hoisting theidfield into a local before thewhen, allowing the JVM backend to lower it totableswitch(O(1)) instead of a chain of integer compares.Setmultibindings accessed through a provider now emitSetFactory.empty()(a singleton) rather than allocating a builder and an empty backing set on every graph init.generateContributionProviders.@ComptimeOnly.@Bindsgetters asOPENrather than leaving themABSTRACT.IrTypeKeyinstances structurally instead of by rendered strings.@Binds/@ContributesBindingdeclarations by batching incremental-compilation lookup tracking per graph rather than per-callable.processedKeysset so duplicate queue entries don't re-walk dependency lists. This avoids unnecessary extra iterations when doing an initial reachability walk.@Qualifier/@Scope-style annotations appearing across many supertypes are meta-walked once instead of N times.SingletonSet/SingletonMapimplementations at runtime and skips the unnecessary throwaway builder allocation. Note that, when using interop, the generated code for Dagger's internal set/map factories still generates the necessary builder intermediary.@JvmStatic/@JsStaticor value classes where possible. Should be no difference to consumers.Fixes
Map<K, () -> V>multibindings on Kotlin/JS.Providerdoes not extend() -> Ton JS, so when such a map was consumed viaProvider<Map<K, () -> V>>the values were MetroProviderinstances and weren't callable as JS functions, surfacing at runtime asTypeError: ... is not a function. Metro now uses a JS-only runtimeMapFunctionFactoryfor these cases that stores correct() -> Vlambdas.Invalid type argerror when class has more generic type parameters than its parent.@GraphExtensionimpl class file names that exceed the 255-byte per-segment filesystem limit. Deeply chained extensions now fall back to a stable hashed simple name once their projected basename would cross the threshold, and a warning is emitted at chain depths of 10+.call_refprecise-type mismatches in generated Circuit factories. Some platforms silently tolerated these IR-level type ambiguities, but Kotlin/Wasm rejects them at load-time.Presenter.Factory/Ui.Factorydispatches itsscreen: Screenparameter to an underlying assisted factory or@Inject @​Composablefunction that expects a more specificScreensubtype.Provider<T>for non-wrapped injected dependencies. Without this, the IR call's type was the unsubstitutedT.@CircuitInjectdeclarations to the generated factory classes.Changes
2.4.0-RCbuilds.2.4.20dev builds.2025.3.4.7).2026.1.1.4).6.3.0.Contributors
Special thanks to the following contributors for contributing to this release!
Consider sponsoring Metro's development
Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.