Skip to content

Releases: InsertKoinIO/koin-annotations

2.3.2-Beta1

26 Nov 08:27

Choose a tag to compare

2.3.2-Beta1 Pre-release
Pre-release

Full Changelog: 2.3.1...2.3.2-Beta1

2.3.1

07 Nov 10:37
1d4c1af

Choose a tag to compare

What's Changed

Full Changelog: 2.3.0...2.3.1

2.3.0

20 Oct 13:39

Choose a tag to compare

Added

  • Added comprehensive Annotations inventory documentation (docs/reference/koin-annotations/annotations-inventory.md)

Updated

  • Updated Kotlin to version 2.2.20
  • Updated KSP (Kotlin Symbol Processing) to version 2.2.20-2.0.4
  • Updated version in gradle.properties to 2.3.0

Changed

  • Simplified build configuration across multiple modules (koin-annotations, koin-jsr330, koin-ksp-compiler)
  • Updated example projects (example-cmp, examples) to use latest dependency versions
  • Cleaned up build.gradle.kts files by removing redundant configurations

Contributors: @arnaudgiuliani

Full Changelog: 2.2.0...2.3.0

2.2.0

07 Oct 15:01

Choose a tag to compare

What's Changed

Commits: 49e9bd4706a5f6

This major release introduces powerful new features for application configuration, JSR-330 compatibility, advanced scoping, and significant performance improvements. Perfect for teams migrating from other DI frameworks and building large-scale applications.

🎯 Major New Features

🏗️ Application Configuration System

New @KoinApplication and @configuration annotations for enterprise-grade application management

  • @KoinApplication: Bootstrap entry point annotation that generates both startKoin() and koinApplication() functions
  • @configuration: Organize modules into environments, flavors, and feature sets
  • Multi-environment support: Easily switch between development, production, test configurations
  • Generated bootstrap functions: Support custom lambda configuration blocks

@KoinApplication(configurations = ["default", "production"])
class ProductionApp

// Generates: MyApp().startKoin { /* custom config */ }

🎯 Scope Archetype Annotations

Predefined scope annotations for common patterns - no more manual scope declarations

Android Scope Archetypes:

  • @ActivityScope: Activity-scoped components
  • @ActivityRetainedScope: Survives configuration changes
  • @FragmentScope: Fragment-scoped components

Cross-Platform Scope Archetypes:

  • @ViewModelScope: KMP-compatible ViewModel scoping for Android, iOS, Desktop, Web

@ActivityScope
class LocationService(val context: Context)

@ViewModelScope // Works across all KMP targets!
class SharedRepository(val api: ApiService)

⚖️ JSR-330 Compatibility Layer

New koin-jsr330 module for seamless framework migration

Perfect for teams migrating from Hilt, Dagger, Guice, or other JSR-330 frameworks:

  • @singleton (jakarta.inject.Singleton) - equivalent to @single
  • @nAmed (jakarta.inject.Named) - JSR-330 standard qualifiers
  • @Inject (jakarta.inject.Inject) - constructor injection marking
  • @qualifier & @scope - meta-annotations for custom annotations
  • Mixed usage: Use JSR-330 and Koin annotations in the same project

// JSR-330 style - familiar to Dagger/Hilt developers
@singleton
@nAmed("primary")
class DatabaseService @Inject constructor(val config: DbConfig)

⚡ Performance & Reliability Improvements

🚄 Major Performance Optimizations

  • O(n*m) → O(1) module lookup: Cached package mappings for instant module resolution
  • Optimized property association: O(n) complexity instead of O(n*m)
  • Streamlined definition processing: Reduced memory allocation during compilation
  • External definition caching: Hierarchical package matching for fast lookups
  • Metadata scanning optimizations: Index-based scanning with batch processing

🛡️ Enhanced Compile Safety

  • Reworked configuration checking: More robust validation at compile time
  • Improved error handling: Better diagnostics for invalid symbol detection
  • Module path scanning: Enhanced accuracy for cross-module dependencies
  • Tag management improvements: Cleaner metadata generation and verification

🔧 Developer Experience Improvements

📚 Comprehensive Documentation

  • Complete annotation reference: All annotations now documented with examples
  • Framework migration guides: Specific guidance for Hilt/Dagger migration
  • KMP compatibility notes: Clear multi-platform usage guidance
  • Performance optimization tips: Best practices for large codebases

🧪 Enhanced Testing & Validation

  • Expanded test coverage: All new features thoroughly tested
  • Cross-platform validation: KMP compatibility verified across targets
  • Performance benchmarks: Validated performance improvements in large codebases

🎁 Additional Enhancements

🔄 Improved Component Scanning

  • Enhanced @componentscan: Better handling of package hierarchies
  • Cross-module scanning: Improved Gradle module traversal
  • Glob pattern support: Advanced package filtering capabilities

🏷️ Better Module Management

  • Module includes optimization: Faster module dependency resolution
  • External module association: Improved handling of external definitions
  • Configuration-based loading: Smart module loading based on active configurations

Full Changelog: 2.1.1-RC1...2.2.0

2.2.0-RC4

02 Oct 07:17

Choose a tag to compare

Full Changelog: 2.2.0-RC1...2.2.0-RC4

Major Changes:

JSR-330 Compatibility Improvements

  • Fixed compatibility with javax.inject.Singleton annotations
  • Added support for constructor injection with @Inject
  • Removed direct linking to JSR-330 classes to avoid compilation dependencies
  • Enhanced @qualifier annotation handling

Configuration & Module Handling

  • Fixed configuration consolidation checks for modules (no longer checks entire module chain)
  • Added option to disable exported definitions via KOIN_EXPORT_DEFINITIONS argument
  • Fixed module includes to properly track object class metadata
  • Skip checks for empty modules/orphan definitions (delegated to attached module verification)

Bug Fixes

  • Fixed qualifier inner data generation in KspExt.kt:1f2003d
  • Fixed default metadata generation in BuilderProcessor.kt:f7b16c0
  • Fixed scope archetype handling for functions in FunctionScanner.kt:29948b1
  • Updated whitelisted types for safety checks in TypeWhiteList.kt:237e9a7

Code Quality

  • Various test cleanups and improvements
  • Removed unnecessary comments

The changes primarily focus on improving JSR-330 annotation compatibility, fixing module configuration issues, and enhancing the overall robustness of the annotation processing system.

Contributors: @arnaudgiuliani

2.2.0-RC1

02 Sep 15:59

Choose a tag to compare

What's Changed

Commits: 49e9bd4706a5f6

This major release introduces powerful new features for application configuration, JSR-330 compatibility, advanced scoping, and significant performance improvements. Perfect for teams migrating from other DI frameworks and building large-scale applications.

New Features

Application Configuration System

New @KoinApplication and @configuration annotations for enterprise-grade application management

  • @KoinApplication: Bootstrap entry point annotation that generates both startKoin() and koinApplication() functions
  • @configuration: Organize modules into environments, flavors, and feature sets
  • Multi-environment support: Easily switch between development, production, test configurations
  • Generated bootstrap functions: Support custom lambda configuration blocks

@KoinApplication(configurations = ["default", "production"])
class ProductionApp

// Generates: MyApp().startKoin { /* custom config */ }

Scope Archetype Annotations

Predefined scope annotations for common patterns - no more manual scope declarations

Android Scope Archetypes:

  • @ActivityScope: Activity-scoped components
  • @ActivityRetainedScope: Survives configuration changes
  • @FragmentScope: Fragment-scoped components

Cross-Platform Scope Archetypes:

  • @ViewModelScope: KMP-compatible ViewModel scoping for Android, iOS, Desktop, Web

@ActivityScope
class LocationService(val context: Context)

@ViewModelScope // Works across all KMP targets!
class SharedRepository(val api: ApiService)

JSR-330 Compatibility Layer

New koin-jsr330 module for seamless framework migration

Perfect for teams migrating from Hilt, Dagger, Guice, or other JSR-330 frameworks:

  • @singleton (jakarta.inject.Singleton) - equivalent to @single
  • @nAmed (jakarta.inject.Named) - JSR-330 standard qualifiers
  • @Inject (jakarta.inject.Inject) - constructor injection marking
  • @qualifier & @scope - meta-annotations for custom annotations
  • Mixed usage: Use JSR-330 and Koin annotations in the same project

// JSR-330 style - familiar to Dagger/Hilt developers
@singleton
@nAmed("primary")
class DatabaseService @Inject constructor(val config: DbConfig)

Custom KSP Path Generation

You can now benefit from generating Koin code into the desired package, by using the KSP_GENERATION_PACKAGE KSP option, to specify teh target package.
See https://insert-koin.io/docs/reference/koin-annotations/options#koin_generation_package for more info.

Performance & Reliability Improvements

Major Performance Optimizations

  • O(n*m) → O(1) module lookup: Cached package mappings for instant module resolution
  • Optimized property association: O(n) complexity instead of O(n*m)
  • Streamlined definition processing: Reduced memory allocation during compilation
  • External definition caching: Hierarchical package matching for fast lookups
  • Metadata scanning optimizations: Index-based scanning with batch processing

Enhanced Compile Safety

  • Reworked configuration checking: More robust validation at compile time
  • Improved error handling: Better diagnostics for invalid symbol detection
  • Module path scanning: Enhanced accuracy for cross-module dependencies
  • Tag management improvements: Cleaner metadata generation and verification

Developer Experience Improvements

Comprehensive Documentation

  • Complete annotation reference: All annotations now documented with examples
  • Framework migration guides: Specific guidance for Hilt/Dagger migration
  • KMP compatibility notes: Clear multi-platform usage guidance
  • Performance optimization tips: Best practices for large codebases

Enhanced Testing & Validation

  • Expanded test coverage: All new features thoroughly tested
  • Cross-platform validation: KMP compatibility verified across targets
  • Performance benchmarks: Validated performance improvements in large codebases

Additional Enhancements

Improved Component Scanning

  • Enhanced @componentscan: Better handling of package hierarchies
  • Cross-module scanning: Improved Gradle module traversal
  • Glob pattern support: Advanced package filtering capabilities

Better Module Management

  • Module includes optimization: Faster module dependency resolution
  • External module association: Improved handling of external definitions
  • Configuration-based loading: Smart module loading based on active configurations

Updating your project & Migration

For New Projects:

  • Use @KoinApplication + @configuration for organized application structure
  • Leverage scope archetypes (@ViewModelScope, @ActivityScope) for common patterns
  • Consider JSR-330 annotations if team has Dagger/Hilt experience

For Existing Projects:

  • Zero breaking changes: All existing code continues to work
  • Gradual adoption: Add new features incrementally
  • Performance gains: Automatic performance improvements without code changes

For Framework Migration:

  • Hilt/Dagger users: Start with koin-jsr330 module for familiar annotations
  • Enterprise teams: Use @configuration for environment-specific modules
  • KMP projects: Leverage @ViewModelScope for shared business logic

Full Changelog: 2.1.1-RC1...2.2.0-RC1

2.2.0-Beta5

26 Aug 10:42

Choose a tag to compare

Full Changelog: 2.2.0-Beta4...2.2.0-Beta5

  • Fix KoinApplication extension generation with right visibility - by @arnaudgiuliani

2.2.0-Beta4

25 Aug 14:56

Choose a tag to compare

Full Changelog: 2.2.0-Beta3...2.2.0-Beta4

2.2.0-Beta3

25 Aug 12:27
29a5d00

Choose a tag to compare

Commits: 49e9bd4706a5f6 (@arnaudgiuliani)

This major release introduces powerful new features for application configuration, JSR-330 compatibility, advanced scoping, and significant performance improvements. Perfect for teams migrating from other DI frameworks and building large-scale applications.

Major New Features

Application Configuration System

New @KoinApplication and @configuration annotations for enterprise-grade application management

  • @KoinApplication: Bootstrap entry point annotation that generates both startKoin() and koinApplication() functions
  • @configuration: Organize modules into environments, flavors, and feature sets
  • Multi-environment support: Easily switch between development, production, test configurations
  • Generated bootstrap functions: Support custom lambda configuration blocks

@KoinApplication(configurations = ["default", "production"])
class ProductionApp

// Generates: MyApp().startKoin { /* custom config */ }

Scope Archetype Annotations

Predefined scope annotations for common patterns - no more manual scope declarations

Android Scope Archetypes:

  • @ActivityScope: Activity-scoped components
  • @ActivityRetainedScope: Survives configuration changes
  • @FragmentScope: Fragment-scoped components

Cross-Platform Scope Archetypes:

  • @ViewModelScope: KMP-compatible ViewModel scoping for Android, iOS, Desktop, Web

@ActivityScope
class LocationService(val context: Context)

@ViewModelScope // Works across all KMP targets!
class SharedRepository(val api: ApiService)

JSR-330 Compatibility Layer

New koin-jsr330 module for seamless framework migration

Perfect for teams migrating from Hilt, Dagger, Guice, or other JSR-330 frameworks:

  • @singleton (jakarta.inject.Singleton) - equivalent to @single
  • @nAmed (jakarta.inject.Named) - JSR-330 standard qualifiers
  • @Inject (jakarta.inject.Inject) - constructor injection marking
  • @qualifier & @scope - meta-annotations for custom annotations
  • Mixed usage: Use JSR-330 and Koin annotations in the same project

// JSR-330 style - familiar to Dagger/Hilt developers
@singleton
@nAmed("primary")
class DatabaseService @Inject constructor(val config: DbConfig)

Performance & Reliability Improvements

Major Performance Optimizations

  • O(n*m) → O(1) module lookup: Cached package mappings for instant module resolution
  • Optimized property association: O(n) complexity instead of O(n*m)
  • Streamlined definition processing: Reduced memory allocation during compilation
  • External definition caching: Hierarchical package matching for fast lookups
  • Metadata scanning optimizations: Index-based scanning with batch processing

Enhanced Compile Safety

  • Reworked configuration checking: More robust validation at compile time
  • Improved error handling: Better diagnostics for invalid symbol detection
  • Module path scanning: Enhanced accuracy for cross-module dependencies
  • Tag management improvements: Cleaner metadata generation and verification

Developer Experience Improvements

Comprehensive Documentation

  • Complete annotation reference: All annotations now documented with examples
  • Framework migration guides: Specific guidance for Hilt/Dagger migration
  • KMP compatibility notes: Clear multi-platform usage guidance
  • Performance optimization tips: Best practices for large codebases

Enhanced Testing & Validation

  • Expanded test coverage: All new features thoroughly tested
  • Cross-platform validation: KMP compatibility verified across targets
  • Performance benchmarks: Validated performance improvements in large codebases

Additional Enhancements

Improved Component Scanning

  • Enhanced @componentscan: Better handling of package hierarchies
  • Cross-module scanning: Improved Gradle module traversal
  • Glob pattern support: Advanced package filtering capabilities

Better Module Management

  • Module includes optimization: Faster module dependency resolution
  • External module association: Improved handling of external definitions
  • Configuration-based loading: Smart module loading based on active configurations

🚀 Migration & Adoption

For New Projects:

  • Use @KoinApplication + @configuration for organized application structure
  • Leverage scope archetypes (@ViewModelScope, @ActivityScope) for common patterns
  • Consider JSR-330 annotations if team has Dagger/Hilt experience

For Existing Projects:

  • Zero breaking changes: All existing code continues to work
  • Gradual adoption: Add new features incrementally
  • Performance gains: Automatic performance improvements without code changes

For Framework Migration:

  • Hilt/Dagger users: Start with koin-jsr330 module for familiar annotations
  • Enterprise teams: Use @configuration for environment-specific modules
  • KMP projects: Leverage @ViewModelScope for shared business logic

📊 Performance Impact !


Special Thanks

This release represents months of architectural improvements, performance optimization, and developer experience enhancements. Perfect for teams building production applications with Koin!

Full Changelog: 49e9bd4...706a5f6


Ready to scale your Koin applications to the next level? This release provides the foundation for enterprise-grade dependency injection with unmatched performance and flexibility. 🚀

2.1.1-RC1

22 Jul 14:02

Choose a tag to compare

What's Changed

Full Changelog: 2.1.0...2.1.1-RC1