Skip to content

Compose/Internals context - help migration on ComposeContextWrapper#2295

Merged
arnaudgiuliani merged 2 commits into4.2.0from
fix_compose_context_internals
Nov 3, 2025
Merged

Compose/Internals context - help migration on ComposeContextWrapper#2295
arnaudgiuliani merged 2 commits into4.2.0from
fix_compose_context_internals

Conversation

@arnaudgiuliani
Copy link
Copy Markdown
Member

@arnaudgiuliani arnaudgiuliani commented Oct 21, 2025

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

@arnaudgiuliani arnaudgiuliani added this to the 4.2.0 milestone Oct 21, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LocalKoinScope to LocalKoinScopeContext and LocalKoinApplication to LocalKoinApplicationContext throughout the codebase
  • Added deprecated stubs for LocalKoinScope and LocalKoinApplication with ERROR-level deprecation and migration guidance
  • Enhanced documentation in ComposeContextWrapper to 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.

@arnaudgiuliani
Copy link
Copy Markdown
Member Author

@Nek-12 here is a proposal to help around this API

@arnaudgiuliani arnaudgiuliani changed the title Start drafting proposal to help migration on ComposeContextWrapper Compose/Internals context - help migration on ComposeContextWrapper Oct 21, 2025
…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]>
@arnaudgiuliani arnaudgiuliani force-pushed the fix_compose_context_internals branch from 73ff081 to 0c1e17b Compare October 21, 2025 10:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@arnaudgiuliani arnaudgiuliani added type:team status:wait_feedback Need more details or follow-up labels Oct 22, 2025
@arnaudgiuliani arnaudgiuliani marked this pull request as ready for review October 28, 2025 13:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@arnaudgiuliani
Copy link
Copy Markdown
Member Author

This API will be proposed in 4.2.0-alpha1

@arnaudgiuliani arnaudgiuliani merged commit b8d39fb into 4.2.0 Nov 3, 2025
4 checks passed
@arnaudgiuliani arnaudgiuliani deleted the fix_compose_context_internals branch November 5, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:wait_feedback Need more details or follow-up type:team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants