Compose/Internals context - help migration on ComposeContextWrapper#2295
Compose/Internals context - help migration on ComposeContextWrapper#2295arnaudgiuliani merged 2 commits into4.2.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a breaking change in version 4.1.1 by renaming internal composition locals and providing deprecated API stubs to help with migration to ComposeContextWrapper<Scope>. The changes introduce LocalKoinScopeContext and LocalKoinApplicationContext as replacements for the previous public APIs while maintaining backward compatibility through deprecation warnings.
Key Changes:
- Renamed
LocalKoinScopetoLocalKoinScopeContextandLocalKoinApplicationtoLocalKoinApplicationContextthroughout the codebase - Added deprecated stubs for
LocalKoinScopeandLocalKoinApplicationwith ERROR-level deprecation and migration guidance - Enhanced documentation in
ComposeContextWrapperto explain its purpose and usage
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| KoinScope.kt | Updated to use LocalKoinScopeContext instead of LocalKoinScope |
| KoinApplication.kt | Introduced new internal composition locals with deprecation stubs for old APIs, updated all usages to new names |
| ComposeContextWrapper.kt | Added comprehensive documentation and improved error message |
| KoinAndroidScope.kt | Updated to use LocalKoinScopeContext instead of LocalKoinScope |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt
Outdated
Show resolved
Hide resolved
projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt
Outdated
Show resolved
Hide resolved
projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt
Outdated
Show resolved
Hide resolved
projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/ComposeContextWrapper.kt
Outdated
Show resolved
Hide resolved
|
@Nek-12 here is a proposal to help around this API |
…ope> Update projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt Co-authored-by: Copilot <[email protected]> Update projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt Co-authored-by: Copilot <[email protected]> Update projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/ComposeContextWrapper.kt Co-authored-by: Copilot <[email protected]> Update projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt Co-authored-by: Copilot <[email protected]>
73ff081 to
0c1e17b
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt
Show resolved
Hide resolved
projects/compose/koin-compose/src/commonMain/kotlin/org/koin/compose/KoinApplication.kt
Show resolved
Hide resolved
|
This API will be proposed in |
PR to propose API internals change, to recover from 4.1.1 breaking.
Also help to migrate to ComposeContextWrapper
Added a "UnboundKoinScope" composable function proposal to help interact with Scope without binding it to local Composable.
Fix #2269