-
-
Notifications
You must be signed in to change notification settings - Fork 32
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 Kotlin to 2.1.0 and other deps #147
Conversation
WalkthroughThis pull request encompasses a series of dependency and configuration updates across multiple files in the project. The changes primarily involve version upgrades for various dependencies in 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 (
|
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
🧹 Nitpick comments (2)
mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/StoreExt.kt (1)
Line range hint
56-68
: Consider alternative approaches to extendStateFlow
Implementing
StateFlow
directly and opting into an experimental API might affect the stability of your library. Instead of subclassingStateFlow
, consider wrapping an existingStateFlow
instance. This approach can help avoid experimental APIs and ensure better compatibility.Here's a possible refactor:
private fun <State : Any> Store<*, State, *>.asStateFlow(): StateFlow<State> { val flow = MutableStateFlow(state) val disposable = states(observer { flow.value = it }) return flow.also { it.onCompletion { disposable.dispose() } } }You can then use
asStateFlow()
wherever aStateFlow<State>
is needed.sample/coroutines/app-android/src/main/java/com/arkivanov/mvikotlin/sample/coroutines/app/details/DetailsFragment.kt (1)
Line range hint
30-34
: Consider migrating to newer Bundler APIs instead of suppressing deprecationWhile suppressing the deprecation warning works, consider migrating to the newer
getBundleExtra
orgetParcelable(String, Class<T>)
APIs introduced in Android 13 (API 33). This would provide better type safety and future compatibility.- @Suppress("DEPRECATION") - val args = - requireArguments() - .apply { classLoader = Arguments::class.java.classLoader } - .getParcelable<Arguments>(KEY_ARGUMENTS) as Arguments + val args = requireArguments().getParcelable(KEY_ARGUMENTS, Arguments::class.java) + ?: throw IllegalArgumentException("Missing arguments")
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
gradle/wrapper/gradle-wrapper.jar
is excluded by!**/*.jar
kotlin-js-store/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (8)
deps.versions.toml
(2 hunks)gradle/wrapper/gradle-wrapper.properties
(1 hunks)gradlew
(2 hunks)mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/StoreExt.kt
(2 hunks)mvikotlin-timetravel-client/plugin-idea/src/main/java/com/arkivanov/mvikotlin/plugin/idea/timetravel/TimeTravelToolWindowListener.kt
(1 hunks)sample/coroutines/app-android/src/main/java/com/arkivanov/mvikotlin/sample/coroutines/app/details/DetailsFragment.kt
(1 hunks)sample/reaktive/app-android/src/main/java/com/arkivanov/mvikotlin/sample/reaktive/app/details/DetailsFragment.kt
(1 hunks)settings.gradle.kts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- gradlew
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build on Linux
- GitHub Check: Build on macOS
🔇 Additional comments (10)
mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/StoreExt.kt (1)
8-8
: Verify the necessity of opting intoExperimentalForInheritanceCoroutinesApi
The import and usage of
ExperimentalForInheritanceCoroutinesApi
suggest that you're opting into an experimental API. Given the update to Kotlin 2.1.0 and Coroutines 1.9.0, please verify if this API is still marked as experimental in the newer versions. If it has become stable, you may no longer need to opt-in.You can run the following script to check if
ExperimentalForInheritanceCoroutinesApi
is still required:✅ Verification successful
The
ExperimentalForInheritanceCoroutinesApi
opt-in is still necessaryThis API is still marked as experimental in Coroutines 1.9.0 and is properly used in the codebase with the
@OptIn
annotation for theStoreStateFlow
implementation.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if 'ExperimentalForInheritanceCoroutinesApi' is still necessary. # Search for 'ExperimentalForInheritanceCoroutinesApi' in the kotlinx.coroutines library gh api https://api.github.com/repos/Kotlin/kotlinx.coroutines/contents/kotlinx-coroutines-core/common/src | jq -r '.[].download_url' | xargs -I {} curl -s {} | grep -q "ExperimentalForInheritanceCoroutinesApi" && echo "ExperimentalForInheritanceCoroutinesApi is still in use" || echo "ExperimentalForInheritanceCoroutinesApi is no longer necessary"Length of output: 334
Script:
#!/bin/bash # Search for usage of ExperimentalForInheritanceCoroutinesApi in the codebase rg "ExperimentalForInheritanceCoroutinesApi" -B 2 -A 2 # Also check if there are any @OptIn or @RequiresOptIn annotations related to this rg "@OptIn.*ExperimentalForInheritanceCoroutinesApi" -B 1 -A 1Length of output: 2114
mvikotlin-timetravel-client/plugin-idea/src/main/java/com/arkivanov/mvikotlin/plugin/idea/timetravel/TimeTravelToolWindowListener.kt (1)
17-17
:⚠️ Potential issueUpdate the overridden method to the new API
The
stateChanged()
method is deprecated. To maintain compatibility with the latest IntelliJ Platform SDK, you should override the updated method provided byToolWindowManagerListener
.Apply this diff to update the method:
- @Deprecated(message = "") - override fun stateChanged() { + override fun toolWindowShown(toolWindow: ToolWindow) { if (TimeTravelToolWindowFactory.TOOL_WINDOW_ID in toolWindowManager.toolWindowIds) { ensureLifecycleRegistry().resume() } else { lifecycleRegistry?.destroy() lifecycleRegistry = null } }Please verify the correct replacement method in the
ToolWindowManagerListener
interface.You can run the following script to check for the updated methods:
sample/reaktive/app-android/src/main/java/com/arkivanov/mvikotlin/sample/reaktive/app/details/DetailsFragment.kt (1)
28-31
: 🛠️ Refactor suggestionReplace deprecated
getParcelable
methodInstead of suppressing the deprecation warning, update the code to use the non-deprecated
getParcelable
method. This ensures forward compatibility with newer Android SDK versions.Apply this diff to update the method:
- @Suppress("DEPRECATION") val args = requireArguments() .apply { classLoader = Arguments::class.java.classLoader } - .getParcelable<Arguments>(KEY_ARGUMENTS) as Arguments + .getParcelable(KEY_ARGUMENTS, Arguments::class.java) as ArgumentsLikely invalid or redundant comment.
gradle/wrapper/gradle-wrapper.properties (2)
3-3
: Verify Gradle 8.11.1 compatibility with Android Gradle Plugin 8.7.3The Gradle version upgrade is significant. While this version should be compatible with AGP 8.7.3, it's recommended to verify against the AGP to Gradle compatibility matrix.
5-5
: Good security practice: Distribution URL validation enabledAdding
validateDistributionUrl=true
improves security by verifying the integrity of downloaded Gradle distributions.settings.gradle.kts (1)
18-18
: Verify gradle-setup-plugin compatibility with Kotlin 2.1.0The plugin version has been updated to a specific commit (4cef58cc3b). Please ensure this version is compatible with Kotlin 2.1.0 and other updated dependencies.
deps.versions.toml (4)
59-62
: Formatting improvements in AndroidX dependenciesThe spacing and alignment improvements in AndroidX dependencies enhance readability.
7-7
: Verify Kotlin 2.1.0 and Coroutines 1.9.0 compatibilityThe update to Kotlin 2.1.0 and Coroutines 1.9.0 is significant. Please verify:
- Compatibility between these versions
- Any breaking changes in Kotlin 2.1.0 that might affect the codebase
Also applies to: 9-9
✅ Verification successful
Kotlin 2.1.0 and Coroutines 1.9.0 update is safe to proceed
The codebase's usage of Kotlin and Coroutines features has been analyzed, and no compatibility issues were found. The update is safe as:
- All used language features are supported in Kotlin 2.1.0
- Coroutines usage follows standard patterns compatible with 1.9.0
- Test coverage is in place for coroutines functionality
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for potential compatibility issues in Kotlin code echo "Searching for potential compatibility issues..." rg -l 'sealed interface|fun interface|companion object' \ --type kotlin \ --glob '!build' \ --glob '!.gradle'Length of output: 3018
Script:
#!/bin/bash # Search for coroutines usage patterns echo "Searching for coroutines usage patterns..." rg -l 'Flow<|suspend fun|CoroutineScope|launch|async|withContext|runBlocking' \ --type kotlin \ --glob '!build' \ --glob '!.gradle' # Check build configuration for coroutines dependencies echo -e "\nChecking build configuration..." rg "kotlinx-coroutines" -A 2Length of output: 3854
12-13
: Check Essenty 2.4.0 and Reaktive 2.3.0 release notesSignificant version updates for both libraries. Please review their release notes for any breaking changes or new features that could benefit the project.
✅ Verification successful
Safe version updates with new features
The updates are safe to proceed with:
- Essenty 2.4.0: Primarily updates Kotlin (2.1.0) and coroutines (1.9.0) dependencies
- Reaktive 2.3.0: Adds new
retryWhen
operator and optimizesValueCallback
as a fun interfaceNo breaking changes in either update. The new Reaktive features could benefit error handling in the project.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for usage patterns that might be affected by the updates echo "Checking Essenty usage patterns..." ast-grep --pattern 'import com.arkivanov.essenty.$$$' echo "Checking Reaktive usage patterns..." ast-grep --pattern 'import com.badoo.reaktive.$$$'Length of output: 49703
Script:
#!/bin/bash # Fetch release notes for both libraries echo "Fetching Essenty 2.4.0 release notes..." gh release view 2.4.0 --repo arkivanov/Essenty || true echo -e "\nFetching Reaktive 2.3.0 release notes..." gh release view 2.3.0 --repo badoo/Reaktive || trueLength of output: 1129
17-17
: Significant AGP update (8.2.0 -> 8.7.3)The Android Gradle Plugin update is substantial. Please ensure:
- All Android-specific configurations are compatible
- Build performance impact is evaluated
- New AGP features are leveraged where beneficial
Kotlin: 2.1.0
Essenty: 2.4.0
Coroutines: 1.9.0
Reaktive: 2.3.0
AGP: 8.7.3
Gradle: 8.11.1
Summary by CodeRabbit
Dependency Updates
Gradle Configuration
Code Maintenance