|
9 | 9 | </p>
|
10 | 10 | <chapter title="@Rpc Annotation and RemoteService Interface" id="rpc_annotation_and_remote_service_interface">
|
11 | 11 | <p>
|
12 |
| - This version brings changes to service definitions. |
13 |
| - Prior to <code>0.4.0</code> a service was defined as following: |
| 12 | + This version brings changes to service definitions. Starting with this version, service definitions require |
| 13 | + the <code>@Rpc</code> annotation. |
| 14 | + </p> |
| 15 | + <p> |
| 16 | + Prior to <code>0.4.0</code>, a service was defined as follows: |
14 | 17 | </p>
|
15 | 18 | <code-block lang="kotlin">
|
16 | 19 | interface MyService : RPC
|
17 | 20 | </code-block>
|
18 | 21 | <p>
|
19 |
| - Starting from <code>0.4.0</code> new service definition is required: |
| 22 | + Starting from <code>0.4.0</code>, the new service definition should be: |
20 | 23 | </p>
|
21 | 24 | <code-block lang="kotlin">
|
22 | 25 | @Rpc
|
23 | 26 | interface MyService
|
24 | 27 | </code-block>
|
25 | 28 | <p>
|
26 |
| - This definition will be enough for the project to build, but it is not sufficient for use in IDE. |
27 |
| - All interfaces annotated with <code>@Rpc</code> are inherently <code>RemoteService</code>. |
28 |
| - This supertype is added by our compiler plugin. |
29 |
| - However, IDE can't resolve it yet, so for the code to be highlighted properly, |
30 |
| - explicit typing is required: |
| 29 | + This definition is sufficient for the project to build. However, it will not fully support IDE features, |
| 30 | + such as code highlighting. |
| 31 | + All interfaces annotated with <code>@Rpc</code> are inherently of type <code>RemoteService</code>, which is |
| 32 | + added by the compiler plugin, but IDEs won't be able to resolve it. |
| 33 | + </p> |
| 34 | + <p> |
| 35 | + To ensure proper IDE support, add explicit typing: |
31 | 36 | </p>
|
32 | 37 | <code-block lang="kotlin">
|
33 | 38 | @Rpc
|
34 | 39 | interface MyService : RemoteService
|
35 | 40 | </code-block>
|
36 | 41 | <note>
|
37 |
| - The reasoning behind this change is that Kotlin Compiler Plugin API has changed. |
38 |
| - Versions <code>2.0.0</code> and <code>2.0.10</code> allowed our plugin to resolve marker interfaces (which <code>RPC</code> was) |
39 |
| - before the code generation phase. Starting from <code>2.0.20</code> this doesn't work, |
40 |
| - and we are forced to use annotations to reliably detect RPC services. |
41 |
| - To track changes in this regard, we created an <a href="https://youtrack.jetbrains.com/issue/KT-72654">issue</a> for the compiler team. |
42 |
| - This change is not the final API design decision, and it may be changed before the stable release. |
| 42 | + <p> |
| 43 | + The reasoning behind this update is that the Kotlin Compiler Plugin API has changed. |
| 44 | + Versions <code>2.0.0</code> and <code>2.0.10</code> allowed our plugin to resolve marker interfaces (like <code>RPC</code>) |
| 45 | + before the code generation phase. Starting from version <code>2.0.20</code>, this behaviour changed, |
| 46 | + making annotations the only reliable way to detect RPC services. |
| 47 | + </p> |
| 48 | + <p> |
| 49 | + To track changes in this regard, we raised an <a href="https://youtrack.jetbrains.com/issue/KT-72654">issue</a> |
| 50 | + with the compiler team. |
| 51 | + Note that this approach is subject to change, and the final API design may be updated before the stable |
| 52 | + release. |
| 53 | + </p> |
43 | 54 | </note>
|
44 | 55 | </chapter>
|
45 | 56 | <chapter title="Removal of Kotlin versions prior to 2.0" id="removal_of_kotlin_versions_prior_to_2_0">
|
46 | 57 | <p>
|
47 |
| - We stopped publishing compiler plugin artifacts for Kotlin versions prior to 2.0. |
48 |
| - The reason for this is high maintenance cost with little to no usage. |
| 58 | + We stopped publishing compiler plugin artifacts for Kotlin versions prior to <code>2.0.0</code>. |
| 59 | + The reason being its high maintenance cost with little to no usage. |
49 | 60 | We encourage the migration to Kotlin 2.0, where all stable versions are now supported.
|
50 | 61 | <br/>
|
51 |
| - List of Kotlin versions that are currently supported: <code>2.0.0</code>, <code>2.0.10</code>, <code>2.0.20</code>, <code>2.0.21</code> |
| 62 | + </p> |
| 63 | + <p> |
| 64 | + Currently supported Kotlin versions: <code>2.0.0</code>, <code>2.0.10</code>, <code>2.0.20</code>, <code>2.0.21</code> |
52 | 65 | </p>
|
53 | 66 | </chapter>
|
54 | 67 | <chapter title="Removal of org.jetbrains.kotlinx.rpc.platform Gradle plugin"
|
55 | 68 | id="removal_of_org_jetbrains_kotlinx_rpc_platform_gradle_plugin">
|
56 | 69 | <p>
|
57 |
| - Gradle plugin with id <code>org.jetbrains.kotlinx.rpc.platform</code> is not being published anymore. |
| 70 | + The Gradle plugin with id <code>org.jetbrains.kotlinx.rpc.platform</code> is not being published anymore. |
58 | 71 | The reason is that it's sole role was to set BOM in the project, which is now considered unnecessary.
|
59 | 72 | <a href="https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml">Gradle version catalogs</a>
|
60 | 73 | can be used instead.
|
61 | 74 | </p>
|
62 | 75 | </chapter>
|
63 | 76 | <chapter title="Removal of BOM from the Gradle plugin" id="removal_of_bom_from_the_gradle_plugin">
|
64 | 77 | <p>
|
65 |
| - The Gradle plugin that is left (<code>org.jetbrains.kotlinx.rpc.plugin</code>) |
66 |
| - does not set BOM for the project anymore. Instead, manual dependency can be set: |
| 78 | + The Gradle plugin with id <code>org.jetbrains.kotlinx.rpc.plugin</code> |
| 79 | + does not set BOM for the project anymore. |
| 80 | + </p> |
| 81 | + <p> |
| 82 | + To configure BOM manually, add the following dependency: |
67 | 83 | </p>
|
68 | 84 | <code-block lang="kotlin">
|
69 | 85 | dependencies {
|
|
0 commit comments