-
Notifications
You must be signed in to change notification settings - Fork 331
Update kxrpc tutorial to 0.8.0 #651
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
Conversation
WalkthroughThe updates include dependency version bumps in the build configuration, changes to the Kotlin RPC interface and its implementation (removing inheritance from Changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
codeSnippets/snippets/tutorial-kotlin-rpc-app/build.gradle.kts
(2 hunks)codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt
(1 hunks)codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Server.kt
(3 hunks)codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/model/PizzaShop.kt
(1 hunks)topics/tutorial-first-steps-with-kotlin-rpc.topic
(14 hunks)
🔇 Additional comments (11)
codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt (1)
52-58
: LGTM! Simplified coroutine usage aligns with API changes.The removal of
streamScoped
wrapper and direct use ofcollect
correctly reflects the updatedviewOrders
method signature, which is no longer suspending. This simplification improves code readability.codeSnippets/snippets/tutorial-kotlin-rpc-app/build.gradle.kts (1)
17-22
: Consistent dependency version updates.All kotlinx-rpc dependencies are correctly updated to version 0.8.0, maintaining consistency across the build configuration.
codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/model/PizzaShop.kt (2)
8-8
: LGTM! Clean interface design with @rpc annotation.The interface now uses the
@Rpc
annotation instead of extendingRemoteService
, which provides a cleaner and more explicit way to mark RPC interfaces. This change aligns with the 0.8.0 API evolution.
13-13
: Consistent method signature change.The
viewOrders
method is now non-suspending, which aligns with the client-side changes that removedstreamScoped
wrapper. This simplification is consistent across the codebase.codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Server.kt (3)
16-16
: Simplified implementation without CoroutineContext.The removal of
CoroutineContext
parameter from the constructor aligns with the interface changes and simplifies the implementation. This is consistent with the 0.8.0 API evolution.
33-33
: Consistent method signature implementation.The
viewOrders
method implementation correctly reflects the interface change from suspending to non-suspending function, maintaining consistency across the codebase.
65-65
: Simplified service registration.The service registration no longer requires passing a coroutine context, which aligns with the simplified
PizzaShopImpl
constructor. This cleanup makes the registration more straightforward.topics/tutorial-first-steps-with-kotlin-rpc.topic (4)
193-198
: Accurate documentation of interface changes.The tutorial correctly documents the use of
@Rpc
annotation instead of extendingRemoteService
, which accurately reflects the 0.8.0 API changes.
368-372
: Updated build configuration guidance.The documentation now mentions the availability of Ktor Project Generator with kotlinx.rpc plugin, providing users with modern tooling options for project setup.
395-395
: Simplified plugin description.The updated description of the RPC plugin's purpose is more concise and accurate, focusing on stub generation for the client-side.
500-506
: Correct coroutine collection documentation.The tutorial correctly updates the client-side code to use direct
collect
method instead ofstreamScoped
, which aligns with the simplified API in 0.8.0.
kotlin("jvm") version "2.2.0" | ||
kotlin("plugin.serialization") version "2.2.0" | ||
id("io.ktor.plugin") version "3.2.0" | ||
id("org.jetbrains.kotlinx.rpc.plugin") version "0.8.0" |
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.
💡 Verification agent
🧩 Analysis chain
Verify plugin version compatibility.
The plugin version updates look systematic and appropriate for the 0.8.0 kotlinx-rpc update. Please verify these versions are compatible and available.
🏁 Script executed:
#!/bin/bash
# Description: Verify the updated plugin versions are available and compatible
echo "Checking Kotlin version 2.2.0 availability..."
curl -s "https://api.github.com/repos/JetBrains/kotlin/releases" | jq -r '.[].tag_name' | grep -E "^v?2\.2\.0$" || echo "Kotlin 2.2.0 not found in releases"
echo "Checking Ktor plugin version 3.2.0 availability..."
curl -s "https://plugins.gradle.org/api/v1/plugins/io.ktor.plugin" | jq -r '.versions[].version' | grep -E "^3\.2\.0$" || echo "Ktor plugin 3.2.0 not found"
echo "Checking kotlinx-rpc plugin version 0.8.0 availability..."
curl -s "https://plugins.gradle.org/api/v1/plugins/org.jetbrains.kotlinx.rpc.plugin" | jq -r '.versions[].version' | grep -E "^0\.8\.0$" || echo "kotlinx-rpc plugin 0.8.0 not found"
Length of output: 971
Plugin IDs & versions not found on Gradle Plugin Portal
Kotlin 2.2.0 is available, but the Gradle Plugin Portal API did not return versions for:
- io.ktor.plugin v3.2.0
- org.jetbrains.kotlinx.rpc.plugin v0.8.0
Please verify that these plugin IDs and versions are published (or correct the IDs/versions) before merging.
File requiring attention:
- codeSnippets/snippets/tutorial-kotlin-rpc-app/build.gradle.kts (lines 2–5)
🤖 Prompt for AI Agents
In codeSnippets/snippets/tutorial-kotlin-rpc-app/build.gradle.kts lines 2 to 5,
the plugin IDs io.ktor.plugin and org.jetbrains.kotlinx.rpc.plugin with versions
3.2.0 and 0.8.0 respectively are not found on the Gradle Plugin Portal. Verify
the correct plugin IDs and their published versions by checking the official
plugin repositories or documentation, then update these lines with the correct
plugin IDs and versions that are available on the Gradle Plugin Portal before
merging.
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.
Thanks for the update @Mr3zee 🙏
Just one more thing 👇
@vnikolova thank you for the review! Did the update |
Update the https://ktor.io/docs/tutorial-first-steps-with-kotlin-rpc.html tutorial for
0.8.0
release: https://github.com/Kotlin/kotlinx-rpc/releases/tag/0.8.0