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

Promoted DSL APIs to stable #135

Merged
merged 1 commit into from
Apr 27, 2024
Merged

Promoted DSL APIs to stable #135

merged 1 commit into from
Apr 27, 2024

Conversation

arkivanov
Copy link
Owner

@arkivanov arkivanov commented Apr 27, 2024

Closes #96.

Summary by CodeRabbit

  • Refactor
    • Removed the @ExperimentalMviKotlinApi annotation across various components, indicating a stabilization of these features in the library.
  • Tests
    • Updated test classes by removing the @OptIn(ExperimentalMviKotlinApi::class) annotation, reflecting changes in the experimental status of features.

Copy link

coderabbitai bot commented Apr 27, 2024

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 5073f2f and 2a9c81a.
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
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.

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 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.

@arkivanov arkivanov merged commit 1350f82 into master Apr 27, 2024
2 checks passed
@arkivanov arkivanov deleted the stable-dsl branch April 27, 2024 18:23
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.

[4.0] Stabilize and document the new store DSL API
1 participant