-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated Essenty to 2.2.0 and Compose to 1.7.0 #801
Conversation
WalkthroughThe pull request includes updates to the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
520a3aa
to
713126d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/customnavigation/DefaultKittenComponent.kt (1)
24-28
: Migration toretainedInstance
looks goodThe migration from
getOrCreate
toretainedInstance
is implemented correctly, maintaining proper state initialization and lifecycle management. Consider adding a comment explaining the instance retention behavior for future maintainers.private val handler = + // Retained instance survives configuration changes but is destroyed with the component retainedInstance { Handler(initialState = stateKeeper.consume(key = KEY_STATE, strategy = State.serializer()) ?: State()) }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- deps.versions.toml (1 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/DefaultCounterComponent.kt (2 hunks)
- sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/customnavigation/DefaultKittenComponent.kt (2 hunks)
🧰 Additional context used
🔇 Additional comments (7)
sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/customnavigation/DefaultKittenComponent.kt (2)
9-9
: LGTM: Correct import for Essenty 2.2.0The import of
retainedInstance
is the correct replacement for the deprecatedgetOrCreate
method in Essenty 2.2.0.
24-28
: Verify complete migration fromgetOrCreate
Let's ensure all instances of
getOrCreate
have been migrated toretainedInstance
across the codebase.✅ Verification successful
Based on the search results, I can now generate the final response:
Migration from
getOrCreate
toretainedInstance
is correctly scopedThe remaining instances of
getOrCreate
are legitimate as they are:
- Internal framework code in the
decompose
library itself- Test files validating instance retention behavior
- Documentation examples showing both old and new usage
The sample application code has been properly migrated to use
retainedInstance
, as evidenced by its usage in:
- DefaultKittenComponent
- DefaultCardComponent
- DefaultCounterComponent
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usage of getOrCreate method # Expected: No results, indicating complete migration # Search for any remaining getOrCreate usage echo "Checking for remaining getOrCreate usage:" rg "getOrCreate" # Search for new retainedInstance usage to verify migration echo -e "\nVerifying retainedInstance migration:" rg "retainedInstance"Length of output: 22649
sample/shared/shared/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/DefaultCounterComponent.kt (2)
14-14
: LGTM: Import updated for Essenty 2.2.0The new import reflects the updated API in Essenty 2.2.0.
Line range hint
34-39
: LGTM: Successfully migrated toretainedInstance
The migration from
getOrCreate
toretainedInstance
is correct and maintains the same functionality for instance retention and state management.Let's verify this migration pattern is consistently applied across the codebase:
✅ Verification successful
Based on the search results, I can generate the final response as I have enough information to verify the migration pattern.
Migration from
getOrCreate
toretainedInstance
is correctly applied in production codeThe search results show that all remaining uses of
getOrCreate
are in:
- Test files (
*Test.kt
)- Documentation files (
*.md
)- Internal implementation details of the framework
The production code in the sample application has successfully migrated to using
retainedInstance
, as evidenced by its usage in:
DefaultCounterComponent.kt
DefaultKittenComponent.kt
DefaultCardComponent.kt
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the migration from getOrCreate to retainedInstance # Expected: No remaining uses of getOrCreate and consistent use of retainedInstance # Check for any remaining uses of getOrCreate echo "Checking for remaining uses of getOrCreate..." rg "getOrCreate" # Verify the adoption of retainedInstance echo "Verifying adoption of retainedInstance..." rg "retainedInstance"Length of output: 22659
deps.versions.toml (3)
5-8
: Verify compatibility between updated dependencies.Both Essenty and Compose updates look good individually. Since they interact in your component lifecycle management, let's verify their compatibility.
#!/bin/bash # Description: Check for any known compatibility issues between these versions # Look for imports/usage patterns that might indicate version conflicts echo "Checking for potential compatibility issues..." rg -l "import.*essenty.*lifecycle.*import.*compose" || echo "No direct interaction found"
8-8
: Verified: Update to stable Compose version looks good.The upgrade from RC to stable version (1.7.0) is appropriate. This aligns with good practice of using stable releases in production code.
Let's verify this is the latest stable version and check compatibility:
#!/bin/bash # Description: Check latest Compose version and verify compatibility echo "Checking latest Compose version..." curl -s https://repo1.maven.org/maven2/org/jetbrains/compose/compose-gradle-plugin/maven-metadata.xml | grep -oP '<latest>\K[^<]+' echo "Checking Kotlin compatibility..." # Verify Kotlin version compatibility with Compose rg "kotlin.*=.*\"2.0.20\"" -A 5
5-5
: Verified: Update to stable Essenty version looks good.The upgrade from beta to stable version (2.2.0) is a positive change. This version is particularly important as it provides the
retainedInstance
functionality being used in the component changes.Let's verify this is the latest stable version:
✅ Verification successful
Let me generate another verification script to specifically check the Essenty version since the previous output seems to have mixed results from different checks.
This will help us get a clearer picture of the latest available Essenty versions from Maven Central.
Let me try one final verification approach using a different Maven repository API endpoint:
This should list the available versions directly from Maven Central's directory structure.
✅ Essenty version 2.2.0 is the latest stable release
The verification confirms that version 2.2.0 is indeed the latest stable release of Essenty, following the alpha and beta releases in the 2.2.0 series. The upgrade from 2.2.0-beta01 to 2.2.0 in the PR is appropriate and represents the most current stable version available.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check latest Essenty version from Maven Central curl -s https://repo1.maven.org/maven2/com/arkivanov/essenty/lifecycle/maven-metadata.xml | grep -oP '<latest>\K[^<]+'Length of output: 579
Script:
#!/bin/bash # Let's specifically check Essenty versions echo "Checking Essenty versions..." curl -s "https://search.maven.org/solrsearch/select?q=g:com.arkivanov.essenty+AND+a:lifecycle&rows=5&wt=json" | \ jq -r '.response.docs[].v' | sort -V | tail -n 5Length of output: 234
Script:
#!/bin/bash # Check Essenty releases from a different Maven endpoint echo "Checking Essenty releases..." curl -s "https://repo1.maven.org/maven2/com/arkivanov/essenty/lifecycle/" | \ grep -o 'href="[0-9][^"]*/"' | cut -d'"' -f2 | sort -V | tail -n 5Length of output: 275
Summary by CodeRabbit
New Features
Bug Fixes
DefaultCounterComponent
andDefaultKittenComponent
, improving state retention across configuration changes.These updates ensure a more reliable user experience with better state management and the latest features from dependencies.