Skip to content

Commit 5ce1f7d

Browse files
committed
Review comments
1 parent 52e27f0 commit 5ce1f7d

File tree

5 files changed

+33
-31
lines changed

5 files changed

+33
-31
lines changed

docs/pages/kotlinx-rpc/topics/annotation-type-safety.topic

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
title="Annotation type-safety" id="annotation-type-safety">
77

88
<p>
9-
Library introduces a concept of annotation type-safety. Consider the following example:
9+
The library introduces a concept of annotation type-safety. Consider the following example:
1010
</p>
1111
<code-block lang="Kotlin">
1212
@Rpc
@@ -17,14 +17,15 @@
1717
fun &lt;T : RemoteService&gt; withService() {}
1818
</code-block>
1919
<p>
20-
Compiler can not guarantee, that the passed type is the one for which the code generation was run:
20+
Compiler can not guarantee, that the passed type parameter is the one for which the code generation was run:
2121
</p>
2222
<code-block lang="Kotlin">
2323
withService&lt;MyService&gt;() // ok
2424
withService&lt;MyServiceImpl&gt;() // compile time ok, runtime throws
2525
</code-block>
2626
<p>
27-
Our compiler plugin, however, can make this code behave as expected.
27+
The compiler plugin enforces annotation type-safety by requiring type parameters to have specific annotations,
28+
like <code>@Rpc</code>.
2829
</p>
2930
<code-block lang="Kotlin">
3031
@Rpc
@@ -41,27 +42,27 @@
4142
</code-block>
4243

4344
<note>
44-
Annotation type safety only ensures that the resolved type parameters are annotated with the required annotation.
45+
Annotation type safety only ensures that the resolved type parameters are annotated with the required
46+
annotation.
4547
The actual type of the passed argument may differ:
4648
<code-block lang="Kotlin">
4749
fun &lt;@Rpc T : Any&gt; registerService(body: () -> T) {}
4850

49-
// ok, T is resolved to MyService,
50-
// but 'body' parameter returns MyServiceImpl
51+
// T is resolved to MyService,
52+
// but 'body' returns MyServiceImpl
5153
registerService&lt;MyService&gt; { ctx -> MyServiceImpl(ctx) }
5254

53-
// error, T is resolved to MyServiceImpl
55+
// Error: T is resolved to MyServiceImpl
5456
registerService { ctx -> MyServiceImpl(ctx) }
5557
</code-block>
5658
</note>
5759

5860
<warning>
59-
The feature is highly experimental.
60-
The concept will stay, however due to the complexity of the implementation,
61-
our compiler plugin may behave unexpectedly when performing type-safety checks.
62-
Please, <a href="https://github.com/Kotlin/kotlinx-rpc/issues/new?template=bug_report.md">report</a> any encountered bugs.
61+
This feature is highly experimental and may lead to unexpected behaviour. If you encounter any issues,
62+
please <a href="https://github.com/Kotlin/kotlinx-rpc/issues/new?template=bug_report.md">report</a> them.
6363

64-
To ensure critical bugs don't paralyze your app, there is a kill-switch present for the feature:
64+
To prevent critical bugs from affecting your app, you can disable this feature using the following
65+
configuration:
6566
<code-block lang="Kotlin">
6667
// build.gradle.kts
6768
rpc {

docs/pages/kotlinx-rpc/topics/configuration.topic

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
</title>
5555

5656
<warning>
57-
These parameters are deprecated since <code>0.5.0</code>, see the <a href="0-5-0.topic">migration guide</a>.
57+
These parameters are deprecated since <code>0.5.0</code>. For more information,
58+
see the <a href="0-5-0.topic">migration guide</a>.
5859
</warning>
5960

6061
<code-block lang="kotlin">

docs/pages/kotlinx-rpc/topics/features.topic

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<p>
1313
You can send and receive <a href="https://kotlinlang.org/docs/flow.html">Kotlin Flows</a> in RPC
1414
methods.
15-
This is only applied to <code>Flow</code> type, <code>StateFlow</code> and <code>SharedFlow</code>
16-
are not supported and there are no plans to do so.
15+
However, this only applies to the <code>Flow</code> type. <code>StateFlow</code> and <code>SharedFlow</code>
16+
are not supported, and there are no plans to add support for them.
1717
</p>
1818

1919
<code-block lang="kotlin">
@@ -32,7 +32,7 @@
3232
</code-block>
3333

3434
<p>
35-
Another limitation is that server-side steaming (flows that are returned from a function),
35+
Another requirement is that server-side steaming (flows that are returned from a function),
3636
must be the top-level type:
3737
</p>
3838

@@ -51,13 +51,13 @@
5151
</code-block>
5252

5353
<note>
54-
Note that flows that are declared in classes (like in <code>StreamResult</code>) require
54+
Note that flows that are declared in classes (like in <code>StreamResult</code>) require a
5555
<a href="https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#contextual-serialization">Contextual</a>
5656
annotation.
5757
</note>
5858

5959
<p>
60-
To use flows in your code - you need to use special <code>streamScoped</code> function
60+
To use flows in your code, use the <code>streamScoped</code> function
6161
that will provide your flows with their lifetime:
6262
</p>
6363

@@ -85,17 +85,17 @@
8585
After that, all streams that are still live will be closed.
8686
</p>
8787
<p>
88-
You can have multiple RPC call and flows inside the <code>streamScoped</code> function, even from
88+
You can have multiple RPC calls and flows inside the <code>streamScoped</code> function, including those from
8989
different services.
9090
</p>
9191
<p>
92-
On server side, you can use <code>invokeOnStreamScopeCompletion</code> handler inside your methods
93-
to execute code after <code>streamScoped</code> on client side has closed.
92+
On the server side, you can use the <code>invokeOnStreamScopeCompletion</code> handler inside your methods
93+
to execute code after <code>streamScoped</code> on the client side has closed.
9494
It might be useful to clean resources, for example.
9595
</p>
96-
<note>
96+
<warning>
9797
Note that this API is experimental and may be removed in future releases.
98-
</note>
98+
</warning>
9999
<p>
100100
Another way of managing streams is to do it manually.
101101
For this, you can use the <code>StreamScope</code> constructor function together with

docs/pages/kotlinx-rpc/topics/service-descriptors.topic

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
This API is experimental and may be changed at any time.
1010
</note>
1111
<p>
12-
Service Descriptors allow to access entities generated by the compiler plugin.
13-
API can be accessed using the following code:
12+
Service Descriptors allow you to access entities generated by the compiler plugin.
13+
You can access them by using the following code:
1414
</p>
1515
<code-block lang="Kotlin">
1616
serviceDescriptorOf&lt;MyService&gt;()
1717
</code-block>
1818
<p>
19-
The list of available entities can be found <a href="https://github.com/Kotlin/kotlinx-rpc/blob/main/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptor.kt">in code</a>
19+
For the list of available entities, refer to <a href="https://github.com/Kotlin/kotlinx-rpc/blob/main/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptor.kt">the source code</a>.
2020
</p>
2121
</topic>

docs/pages/kotlinx-rpc/topics/strict-mode.topic

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
title="Strict mode" id="strict-mode">
77

88
<p>
9-
Starting with version <code>0.5.0</code> library undergoes major change in supported service APIs.
9+
Starting with version <code>0.5.0</code>, the library introduces major changes to the service APIs.
1010
The following declarations will be gradually restricted:
1111
</p>
1212
<list>
1313
<li>
14-
<b>StateFlow and SharedFlow</b>
14+
<b><code>StateFlow</code> and <code>SharedFlow</code></b>
1515
<p>Deprecation level: <code>WARNING</code></p>
1616
<code-block lang="kotlin">
1717
@Rpc
@@ -66,7 +66,7 @@
6666
</list>
6767

6868
<p>
69-
Deprecation levels are controlled by the Gradle `rpc` extension:
69+
Deprecation levels are controlled by the Gradle <code>rpc</code> extension:
7070
</p>
7171
<code-block lang="Kotlin">
7272
// build.gradle.kts
@@ -88,9 +88,9 @@
8888
Modes <code>RpcStrictMode.NONE</code> and <code>RpcStrictMode.ERROR</code> are available.
8989
</p>
9090

91-
<note>
91+
<warning>
9292
Note that setting <code>RpcStrictMode.NONE</code> should not be done permanently.
9393
All deprecated APIs will become errors in future without an option to suppress it.
9494
Consider your migration path in advance.
95-
</note>
95+
</warning>
9696
</topic>

0 commit comments

Comments
 (0)