arkivanov / MVIKotlin

Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel)
https://arkivanov.github.io/MVIKotlin
Apache License 2.0
847 stars 32 forks source link

Promoted DSL APIs to stable #135

Closed arkivanov closed 6 months ago

arkivanov commented 6 months ago

Closes #96.

Summary by CodeRabbit

coderabbitai[bot] commented 6 months ago

Walkthrough

The recent updates primarily involve the removal of the @ExperimentalMviKotlinApi annotation across various components in the mvikotlin-extensions-coroutines and mvikotlin-extensions-reaktive modules. This change signifies a stabilization of features previously considered experimental, affecting both the core libraries and associated tests.

Changes

File Path Change Summary
.../extensions/coroutines/*.kt and .../extensions/reaktive/*.kt Removed @ExperimentalMviKotlinApi from various classes and functions.
.../extensions/coroutines/*Test.kt and .../extensions/reaktive/*Test.kt Removed @OptIn(ExperimentalMviKotlinApi::class) from test classes.
sample/.../shared/details/store/DetailsStoreFactory.kt Removed @file:OptIn(ExperimentalMviKotlinApi::class) and associated imports.

🐰✨ A hop, a skip, a code base flip, No more tags of "experimental" on our trip. Stabilize, harmonize, under open skies, Code rabbits cheer as old caution flies! 🎉🐇


Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 5073f2f34efc94a0737809234f66a49e6e36b5bb and 2a9c81abc6743a688e867f07216e886d8f83473b.
Files selected for processing (14) * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineBootstrapperDsl.kt (3 hunks) * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineBootstrapperScope.kt (2 hunks) * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutorDsl.kt (5 hunks) * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutorScope.kt (2 hunks) * mvikotlin-extensions-coroutines/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineBootstrapperDslTest.kt (2 hunks) * mvikotlin-extensions-coroutines/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutorDslTest.kt (2 hunks) * mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveBootstrapperDsl.kt (2 hunks) * mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveBootstrapperScope.kt (2 hunks) * mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveExecutorDsl.kt (4 hunks) * mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveExecutorScope.kt (2 hunks) * mvikotlin-extensions-reaktive/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveBootstrapperDslTest.kt (1 hunks) * mvikotlin-extensions-reaktive/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveExecutorDslTest.kt (2 hunks) * sample/coroutines/shared/src/commonMain/kotlin/com/arkivanov/mvikotlin/sample/coroutines/shared/details/store/DetailsStoreFactory.kt (1 hunks) * sample/reaktive/shared/src/commonMain/kotlin/com/arkivanov/mvikotlin/sample/reaktive/shared/details/store/DetailsStoreFactory.kt (1 hunks)
Files skipped from review due to trivial changes (12) * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineBootstrapperDsl.kt * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineBootstrapperScope.kt * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutorDsl.kt * mvikotlin-extensions-coroutines/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutorScope.kt * mvikotlin-extensions-coroutines/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineBootstrapperDslTest.kt * mvikotlin-extensions-coroutines/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/coroutines/CoroutineExecutorDslTest.kt * mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveBootstrapperDsl.kt * mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveBootstrapperScope.kt * mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveExecutorScope.kt * mvikotlin-extensions-reaktive/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveBootstrapperDslTest.kt * mvikotlin-extensions-reaktive/src/commonTest/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveExecutorDslTest.kt * sample/reaktive/shared/src/commonMain/kotlin/com/arkivanov/mvikotlin/sample/reaktive/shared/details/store/DetailsStoreFactory.kt
Additional comments not posted (22)
sample/coroutines/shared/src/commonMain/kotlin/com/arkivanov/mvikotlin/sample/coroutines/shared/details/store/DetailsStoreFactory.kt (14)
`1-1`: Package declaration is appropriate and follows Kotlin conventions. --- Line range hint `3-12`: Imports are correctly organized and relevant to the functionality of the `DetailsStoreFactory`. --- Line range hint `14-14`: Function `detailsStore` is well-named, clearly indicating its purpose to create a `DetailsStore` instance. --- Line range hint `16-16`: The use of `internal` visibility modifier is appropriate, ensuring encapsulation within the module. --- Line range hint `18-18`: Parameters `database`, `mainContext`, `ioContext`, and `itemId` are well-defined, providing all necessary context for the store's operation. --- Line range hint `20-20`: The use of delegation by the `Store` interface using `by create<...>` is a clean and effective way to implement the `DetailsStore` interface. --- Line range hint `22-22`: Initialization of the store with a simple bootstrapper (`SimpleBootstrapper(Unit)`) is straightforward and appropriate for many use cases. --- Line range hint `24-24`: The `coroutineExecutorFactory` is used correctly to define the store's executor. This is a key part of integrating coroutines with the MVI architecture. --- Line range hint `26-26`: Definition of `ExecutorScope.save` function within the executor factory is a good use of local functions to encapsulate behavior that does not need to be exposed externally. --- Line range hint `28-28`: Use of `launch` with `ioContext` for database operations adheres to best practices by offloading I/O operations to an appropriate coroutine context. --- Line range hint `30-30`: Handling of actions and intents within the executor is clear and logically structured, facilitating easy understanding and maintenance. --- Line range hint `32-32`: The reducer function is well-implemented, with clear handling of different message types to mutate the state appropriately. --- Line range hint `34-34`: The use of sealed classes for messages (`Msg`) enhances type safety and makes the state management more predictable. --- Line range hint `36-36`: Type alias for `ExecutorScope` is a clean way to simplify type signatures throughout the code.
mvikotlin-extensions-reaktive/src/commonMain/kotlin/com/arkivanov/mvikotlin/extensions/reaktive/ReaktiveExecutorDsl.kt (8)
`1-1`: Package declaration correctly specifies the location within the project structure. --- `3-3`: Import statements are appropriate and necessary for the functionality provided in this file. --- `5-5`: The documentation comment provides a clear explanation of the `reaktiveExecutorFactory` function's purpose and usage. --- Line range hint `7-7`: Function `reaktiveExecutorFactory` is correctly implemented to provide a factory for `Executor` instances, using the provided configuration block. --- Line range hint `9-9`: The private `executor` function is a good design choice, encapsulating the logic for executor creation and keeping the public API clean. --- `11-11`: The `ExecutorBuilder` class is well-designed, providing a clear and flexible way to build executors with custom behavior. --- `13-13`: Use of inline functions with reified type parameters in `onIntent` and `onAction` methods allows for type-safe handling of intents and actions, which is crucial for the correctness of the executor behavior. --- `15-15`: The implementation of `ExecutorImpl` class is robust, correctly handling the execution of intents and actions, and managing its lifecycle through the `DisposableScope`.
--- 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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `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.` 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 a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.