Skip to content
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.0.0, Compose to 1.6.10, kotlinx-serialization to 1.6.3, AGP to 8.2.0 #718

Merged
merged 1 commit into from
Jun 2, 2024

Conversation

arkivanov
Copy link
Owner

@arkivanov arkivanov commented Jun 1, 2024

Closes #717

Summary by CodeRabbit

  • New Features

    • Introduced stack animations, page scrolling animations, and predictive back animations in Compose-based applications.
    • Added search functionality to the app.
  • Updates

    • Updated Kotlin version to 2.0.0.
    • Updated various dependencies for better performance and compatibility.
  • Bug Fixes

    • Improved error handling in gradlew and gradlew.bat scripts.
  • Enhancements

    • Enhanced code with suppression directives to handle warnings.
    • Improved platform-specific implementations for web history controller.
  • Chores

    • Updated .gitignore to include the .kotlin directory.
    • Removed outdated suppression directives in multiple Kotlin files.
    • Added org.jetbrains.kotlin.plugin.compose plugin across various build files for better Compose support.

Copy link

coderabbitai bot commented Jun 1, 2024

Walkthrough

This update focuses on enhancing the Kotlin and Compose dependencies across various modules, introducing new animation interfaces for Compose, and refining the build configuration. Key changes include updating Kotlin to version 2.0.0, Compose to 1.6.10, and removing deprecated suppression directives. Additionally, the .gitignore file now includes the .kotlin directory, and several Gradle configurations and scripts have been optimized for better performance and compatibility.

Changes

Files/Groups Change Summary
.gitignore Included .kotlin directory.
build.gradle.kts, extensions-compose/build.gradle.kts, sample/app-android/build.gradle.kts, sample/app-desktop/build.gradle.kts, sample/app-js-compose/build.gradle.kts, sample/shared/compose/build.gradle.kts, sample/shared/dynamic-features/compose-api/build.gradle.kts, sample/shared/dynamic-features/feature1Impl/build.gradle.kts, sample/shared/dynamic-features/feature2Impl/build.gradle.kts Added org.jetbrains.kotlin.plugin.compose plugin.
decompose/api/android/decompose.api, decompose/api/jvm/decompose.api Removed UtilsKt class, modified ErrorHandlersKt class.
decompose/src/commonMain/kotlin/com/arkivanov/decompose/Lock.kt Added @Suppress annotation for "LEAKED_IN_PLACE_LAMBDA" and "WRONG_INVOCATION_KIND".
decompose/src/jsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt, decompose/src/wasmJsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt, decompose/src/webMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt Marked history property and setOnPopStateListener function as actual override.
deps.versions.toml Updated versions for Kotlin, Compose, Essenty, and other dependencies.
gradle.properties Removed android.experimental.lint.version line.
gradle/wrapper/gradle-wrapper.properties Updated distributionUrl to gradle-8.2-all.zip, added networkTimeout=10000 and validateDistributionUrl=true.
gradlew, gradlew.bat Enhanced JVM options handling and error messages.
sample/shared/compose/src/commonMain/kotlin/.../CardsContent.kt, .../CardContent.kt, .../CountersContent.kt, .../CounterContent.kt Removed @file:Suppress directive for "OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE".
sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/pages/PagesContent.kt Replaced Icons.Default with Icons.AutoMirrored.Default for ArrowBack and ArrowForward icons.
settings.gradle.kts Updated gradle-setup-plugin version.

Assessment against linked issues

Objective (Issue) Addressed Explanation
Update Kotlin dependency to 2.0.0 (#717)
Update Compose to 1.6.10 (#717)

Poem

In the land of code, where updates flow,
Kotlin and Compose now brightly glow.
With plugins new and versions high,
Our codebase soars, it can touch the sky.
🎵 A rabbit's cheer, for changes clear,
Our project thrives, with updates near. 🎵


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6154b18 and e5ce8ef.

Files ignored due to path filters (2)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
  • kotlin-js-store/yarn.lock is excluded by !**/*.lock
Files selected for processing (24)
  • .gitignore (1 hunks)
  • build.gradle.kts (2 hunks)
  • decompose/api/android/decompose.api (1 hunks)
  • decompose/api/decompose.klib.api (1 hunks)
  • decompose/api/jvm/decompose.api (1 hunks)
  • decompose/src/commonMain/kotlin/com/arkivanov/decompose/Lock.kt (1 hunks)
  • decompose/src/jsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1 hunks)
  • decompose/src/wasmJsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1 hunks)
  • decompose/src/webMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1 hunks)
  • deps.versions.toml (2 hunks)
  • extensions-compose/api/extensions-compose.klib.api (1 hunks)
  • extensions-compose/build.gradle.kts (1 hunks)
  • gradle.properties (1 hunks)
  • gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • gradlew (4 hunks)
  • gradlew.bat (3 hunks)
  • sample/app-android/build.gradle.kts (1 hunks)
  • sample/app-desktop/build.gradle.kts (1 hunks)
  • sample/app-js-compose/build.gradle.kts (2 hunks)
  • sample/shared/compose/build.gradle.kts (1 hunks)
  • sample/shared/dynamic-features/compose-api/build.gradle.kts (1 hunks)
  • sample/shared/dynamic-features/feature1Impl/build.gradle.kts (2 hunks)
  • sample/shared/dynamic-features/feature2Impl/build.gradle.kts (2 hunks)
  • settings.gradle.kts (1 hunks)
Files not summarized due to errors (1)
  • decompose/api/decompose.klib.api: Error: Message exceeds token limit
Files skipped from review due to trivial changes (12)
  • .gitignore
  • decompose/api/android/decompose.api
  • decompose/src/commonMain/kotlin/com/arkivanov/decompose/Lock.kt
  • decompose/src/wasmJsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt
  • gradle.properties
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew.bat
  • sample/app-android/build.gradle.kts
  • sample/app-desktop/build.gradle.kts
  • sample/app-js-compose/build.gradle.kts
  • sample/shared/compose/build.gradle.kts
  • settings.gradle.kts
Additional comments not posted (37)
decompose/src/webMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1)

3-8: The changes correctly apply Kotlin's override conventions to the properties and methods of DefaultWebHistoryControllerWindow.

sample/shared/dynamic-features/compose-api/build.gradle.kts (1)

9-9: The addition of the org.jetbrains.kotlin.plugin.compose plugin aligns with the project's update to Compose version 1.6.10.

decompose/src/jsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1)

5-7: The use of actual override keywords correctly specifies that these members are platform-specific implementations overriding those in a common module.

extensions-compose/build.gradle.kts (1)

14-14: The addition of the org.jetbrains.kotlin.plugin.compose plugin aligns with the project's update to Compose version 1.6.10.

sample/shared/dynamic-features/feature1Impl/build.gradle.kts (1)

11-11: The addition of the org.jetbrains.kotlin.plugin.compose plugin and the configuration changes in the composeCompiler and tasks are well-aligned with the project's goals. Ensure that the task dependencies are correctly configured to avoid build issues.

Also applies to: 59-70

sample/shared/dynamic-features/feature2Impl/build.gradle.kts (1)

11-11: The addition of the org.jetbrains.kotlin.plugin.compose plugin and the configuration changes in the composeCompiler and tasks are well-aligned with the project's goals. Ensure that the task dependencies are correctly configured to avoid build issues.

Also applies to: 59-70

build.gradle.kts (2)

22-22: Added classpath dependencies for Kotlin Compose and serialization plugins.


50-50: Enabled Kotlin/Native library format in binary compatibility settings.

deps.versions.toml (1)

4-14: Updated versions for Kotlin, Compose, kotlinx-serialization, and other dependencies.

Also applies to: 39-39

gradlew (1)

58-58: Enhanced error handling, set default JVM options, and improved script robustness.

Also applies to: 83-87, 134-140, 147-156, 201-209

decompose/api/jvm/decompose.api (1)

Line range hint 1-209: API declarations in decompose/api/jvm/decompose.api appear well-defined and consistent.

Verification successful

The issue found in the project's issue tracker is a feature request for enhancing the API to support shared element transitions between screens. This does not indicate any problems with the current API changes.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the integration of API changes with the rest of the project.

# Test: Check for any issues related to the API in the project's issue tracker.
gh issue list --search "decompose/api"

Length of output: 225

extensions-compose/api/extensions-compose.klib.api (7)

9-11: Introduced StackAnimation interface with a complex function signature.

Ensure that the types and parameters used here are consistent with the rest of the codebase and that they integrate well with existing functionalities.


12-14: Introduced StackAnimator interface with a function that seems to handle direction and animation logic.

This addition should enhance the flexibility of animation handling in the stack. Verify that the implementation details align with the overall animation strategy of the application.


15-23: Added PredictiveBackAnimatable interface for handling predictive back animations.

This is a significant addition for improving user experience by predicting back animations. It's important to ensure that this interface is implemented correctly across different platforms supported by the library.


24-26: Introduced StackAnimationProvider interface.

This interface seems to serve as a factory for StackAnimation objects, which could be crucial for managing different animation strategies dynamically.


27-36: Added Direction enum with entries for different animation directions.

This enum will help in clearly defining the direction of animations and should be used consistently throughout the animation handling code.


37-37: Added a function to combine two StackAnimator instances.

This function will likely be useful for creating composite animations. Ensure that the combination logic is defined clearly and works as expected.


79-94: Introduced PagesScrollAnimation with variants Custom, Default, and Disabled.

These additions provide configurable options for scroll animations in pages, which can enhance the visual experience. Make sure to document the differences and use cases for each variant to aid developers in choosing the right one for their needs.

decompose/api/decompose.klib.api (19)

8-8: The library unique name is correctly specified, ensuring proper identification within the Kotlin ecosystem.


14-14: The constructor for MutableValue is correctly defined without parameters, which is standard for Kotlin abstract classes.


20-20: The constructor for Value is also correctly defined without parameters, maintaining consistency with Kotlin's abstract class conventions.


23-23: The ComponentContextFactory interface correctly defines a single abstract method, adhering to Kotlin's functional interface requirements.


26-26: The Cancellation interface's cancel method is essential for managing lifecycle events in reactive programming, ensuring resources are properly released.


30-30: The constructor for PagesNavigation.Event is defined with default parameters, which enhances flexibility in event handling by allowing partial customizations.


38-38: The PagesNavigator interface's navigate method is crucial for managing navigation events, and it's defined to accept both a transformer and a completion handler, which is a robust design choice.
[APROVED]


42-42: The constructor for SlotNavigation.Event includes optional parameters, providing flexibility in how events are handled within slot navigations.


50-50: The SlotNavigator interface's navigate method is well-defined, allowing for custom navigation logic, which is vital for a navigation framework.


54-54: The constructor for StackNavigation.Event is designed with optional parameters, facilitating customization in stack navigation handling.


62-62: The StackNavigator interface's navigate method is appropriately defined to handle list transformations, which is essential for managing navigation stacks.


99-99: The constructor for SimpleNavigation is defined without parameters, which is typical for Kotlin classes intended for simple navigation scenarios.


104-104: The constructor for ChildPages is defined with parameters to initialize the state, which is crucial for maintaining the integrity of navigation states.


118-118: The constructor for ChildSlot includes an optional parameter, allowing for the initialization of the slot with an existing child, which is a flexible design choice.


128-128: The constructor for ChildStack is defined with parameters to initialize both the active child and the back stack, which is essential for managing complex navigation scenarios.


144-144: The constructor for SimpleChildNavState is defined with parameters to initialize both the configuration and the status, ensuring that the navigation state is correctly set up from the start.


157-157: The constructor for Pages is defined without parameters, simplifying the creation of new pages instances when no initial state is provided.


171-171: The constructor for DefaultComponentContext is defined with a mandatory Lifecycle parameter, ensuring that every component context is bound to a lifecycle, which is a critical aspect of managing component states.


289-289: The constructor for DefaultWebHistoryController is defined without parameters, which is appropriate for classes that manage web history in a standardized way without needing initial configuration.

Copy link

@coderabbitai coderabbitai bot left a 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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e5ce8ef and 67ad3ef.

Files ignored due to path filters (2)
  • gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
  • kotlin-js-store/yarn.lock is excluded by !**/*.lock
Files selected for processing (29)
  • .gitignore (1 hunks)
  • build.gradle.kts (3 hunks)
  • decompose/api/android/decompose.api (1 hunks)
  • decompose/api/decompose.klib.api (1 hunks)
  • decompose/api/jvm/decompose.api (1 hunks)
  • decompose/src/commonMain/kotlin/com/arkivanov/decompose/Lock.kt (1 hunks)
  • decompose/src/jsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1 hunks)
  • decompose/src/wasmJsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1 hunks)
  • decompose/src/webMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt (1 hunks)
  • deps.versions.toml (2 hunks)
  • extensions-compose/api/extensions-compose.klib.api (1 hunks)
  • extensions-compose/build.gradle.kts (1 hunks)
  • gradle.properties (1 hunks)
  • gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • gradlew (4 hunks)
  • gradlew.bat (3 hunks)
  • sample/app-android/build.gradle.kts (1 hunks)
  • sample/app-desktop/build.gradle.kts (1 hunks)
  • sample/app-js-compose/build.gradle.kts (2 hunks)
  • sample/shared/compose/build.gradle.kts (1 hunks)
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/CardsContent.kt (1 hunks)
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/card/CardContent.kt (1 hunks)
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/CountersContent.kt (1 hunks)
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/CounterContent.kt (1 hunks)
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/pages/PagesContent.kt (4 hunks)
  • sample/shared/dynamic-features/compose-api/build.gradle.kts (1 hunks)
  • sample/shared/dynamic-features/feature1Impl/build.gradle.kts (2 hunks)
  • sample/shared/dynamic-features/feature2Impl/build.gradle.kts (2 hunks)
  • settings.gradle.kts (1 hunks)
Files not summarized due to errors (1)
  • decompose/api/decompose.klib.api: Error: Message exceeds token limit
Files skipped from review due to trivial changes (6)
  • decompose/src/webMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/CardsContent.kt
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/cards/card/CardContent.kt
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/CountersContent.kt
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/counters/counter/CounterContent.kt
  • sample/shared/compose/src/commonMain/kotlin/com/arkivanov/sample/shared/pages/PagesContent.kt
Files skipped from review as they are similar to previous changes (21)
  • .gitignore
  • build.gradle.kts
  • decompose/api/android/decompose.api
  • decompose/api/jvm/decompose.api
  • decompose/src/commonMain/kotlin/com/arkivanov/decompose/Lock.kt
  • decompose/src/jsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt
  • decompose/src/wasmJsMain/kotlin/com/arkivanov/decompose/router/stack/webhistory/DefaultWebHistoryControllerWindow.kt
  • deps.versions.toml
  • extensions-compose/build.gradle.kts
  • gradle.properties
  • gradle/wrapper/gradle-wrapper.properties
  • gradlew
  • gradlew.bat
  • sample/app-android/build.gradle.kts
  • sample/app-desktop/build.gradle.kts
  • sample/app-js-compose/build.gradle.kts
  • sample/shared/compose/build.gradle.kts
  • sample/shared/dynamic-features/compose-api/build.gradle.kts
  • sample/shared/dynamic-features/feature1Impl/build.gradle.kts
  • sample/shared/dynamic-features/feature2Impl/build.gradle.kts
  • settings.gradle.kts
Additional comments not posted (17)
extensions-compose/api/extensions-compose.klib.api (11)

9-11: Introduced StackAnimation interface with a function that takes multiple parameters including a ChildStack, Modifier, and a Function3 for handling child creation. This setup allows for custom animations based on the child stack changes.


12-14: Introduced StackAnimator interface with a function that supports directional animations and cancellation. This provides a flexible base for implementing various stack-based animations.


15-22: Added PredictiveBackAnimatable interface with methods for animation control and properties for enter and exit modifiers. This is crucial for implementing animations that predict user actions like back navigation.


24-26: Introduced StackAnimationProvider interface to abstract the provision of StackAnimation instances. This design supports dependency injection and makes the animation system more modular.


27-36: Defined Direction enum with entries like ENTER_BACK and EXIT_FRONT. This clear distinction in navigation directions will aid in implementing context-specific animations.


37-45: Added various functions to extend StackAnimator and handle child stacks. These additions enhance the flexibility and reusability of stack animations within the framework.


46-50: Enhanced subscription and gesture handling capabilities for Compose UI components. These functions facilitate the integration of state and gesture responses into the Compose lifecycle.


51-53: Introduced functions for predictive back animations on different platforms (Android, Material). This cross-platform support is essential for maintaining consistent user experience across devices.


54-56: Added animation functions like fade, scale, and slide which utilize FiniteAnimationSpec. These functions provide basic but essential animations that can be easily configured and applied.


57-58: The stackAnimator function with a FiniteAnimationSpec parameter allows for detailed configuration of animations, enhancing the visual dynamics of the application.


79-94: Defined PagesScrollAnimation with variants Custom, Default, and Disabled. This setup allows developers to choose the appropriate scrolling animation behavior or disable it entirely.

decompose/api/decompose.klib.api (6)

246-248: The introduction of ExperimentalDecomposeApi annotation is noted. Ensure that it is used judiciously to avoid exposing unstable API elements in production.


249-251: The introduction of FaultyDecomposeApi annotation is noted. This should be used to mark APIs that are known to have issues. Ensure that these APIs are either fixed or documented clearly.


252-254: The introduction of InternalDecomposeApi annotation is noted. Ensure that it is used to protect internal APIs from being used externally.


8-8: Ensure the library unique name is correctly specified and aligns with the project's naming conventions.

Verification successful

The library unique name com.arkivanov.decompose:decompose is consistently used across the project files, including build scripts and documentation.

  • tools/check-publication/build.gradle.kts
  • decompose/api/decompose.klib.api
  • docs/getting-started/installation.md
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the library name consistency across the project.
# Test: Search for the library name in project files. Expect: Consistent naming.

rg --type kotlin "com.arkivanov.decompose:decompose"

Length of output: 166



Script:

#!/bin/bash
# Description: Verify the library name consistency across the project.
# Test: Search for the library name in all project files. Expect: Consistent naming.

rg "com.arkivanov.decompose:decompose"

Length of output: 660


287-293: The implementation of DefaultWebHistoryController should be reviewed to ensure it aligns with the new routing and navigation requirements.


243-245: Review the error handling strategy for onDecomposeError.

Verification successful

The onDecomposeError function is used consistently across different platform-specific implementations to handle errors when the main thread check fails. The function is defined in ErrorHandlers.kt and defaults to printing the error via ::printError.

Locations to Review:

  • decompose/src/jvmMain/kotlin/com/arkivanov/decompose/mainthread/CheckMainThread.kt
  • decompose/src/darwinMain/kotlin/com/arkivanov/decompose/mainthread/CheckMainThread.kt
  • decompose/src/androidMain/kotlin/com/arkivanov/decompose/mainthread/CheckMainThread.kt
  • decompose/src/commonMain/kotlin/com/arkivanov/decompose/errorhandler/ErrorHandlers.kt

The error handling strategy appears to be consistent and appropriate across the different platforms.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the usage of `onDecomposeError` across the project to ensure it's being used appropriately.
# Test: Search for the usage of `onDecomposeError`. Expect: Proper error handling.

rg --type kotlin "onDecomposeError"

Length of output: 1182



Script:

#!/bin/bash
# Extract the relevant code snippets where `onDecomposeError` is used to verify the error handling strategy.

# Extract usage in JVM main thread check
echo "JVM Main Thread Check:"
rg --type kotlin -A 5 -B 5 "onDecomposeError" decompose/src/jvmMain/kotlin/com/arkivanov/decompose/mainthread/CheckMainThread.kt

# Extract usage in Darwin main thread check
echo "Darwin Main Thread Check:"
rg --type kotlin -A 5 -B 5 "onDecomposeError" decompose/src/darwinMain/kotlin/com/arkivanov/decompose/mainthread/CheckMainThread.kt

# Extract usage in Android main thread check
echo "Android Main Thread Check:"
rg --type kotlin -A 5 -B 5 "onDecomposeError" decompose/src/androidMain/kotlin/com/arkivanov/decompose/mainthread/CheckMainThread.kt

# Extract the definition of `onDecomposeError` in ErrorHandlers.kt
echo "ErrorHandlers.kt Definition:"
rg --type kotlin -A 5 -B 5 "onDecomposeError" decompose/src/commonMain/kotlin/com/arkivanov/decompose/errorhandler/ErrorHandlers.kt

Length of output: 2079

@arkivanov arkivanov merged commit 165ddfe into master Jun 2, 2024
2 checks passed
@arkivanov arkivanov deleted the kotlin-2 branch June 2, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update dependencies
1 participant