Skip to content

Commit 31d40c2

Browse files
author
Oleksandr Dzhychko
authored
Merge pull request #1075 from modelix/MODELIX-900-and-MODELIX-601
Mark JS API as stable
2 parents 0bd81c5 + fe03026 commit 31d40c2

File tree

12 files changed

+5
-88
lines changed

12 files changed

+5
-88
lines changed

model-client/build.gradle.kts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,27 +133,14 @@ val patchTypesScriptInProductionLibrary = tasks.register("patchTypesScriptInProd
133133
into(preparedProductionLibraryOutputDirectory)
134134
}
135135

136-
// Add correct TypeScript imports and mark exports as experimental.
136+
// Add correct TypeScript imports.
137137
val typescriptDeclaration =
138138
preparedProductionLibraryOutputDirectory.get().file("modelix.core-model-client.d.ts").asFile
139-
val originalTypescriptDeclarationContent = typescriptDeclaration.readLines()
140-
val experimentalDeclaration = """
141-
142-
/**
143-
* @experimental This feature is expected to be finalized with https://issues.modelix.org/issue/MODELIX-500.
144-
*/
145-
""".trimIndent()
139+
val originalTypescriptDeclarationContent = typescriptDeclaration.readText()
146140
typescriptDeclaration.writer().use {
147141
it.appendLine("""import { INodeJS } from "@modelix/ts-model-api";""")
148142
.appendLine()
149-
for (line in originalTypescriptDeclarationContent) {
150-
// Only mark the parts of the client (`org.modelix.model.client2`) experimental.
151-
// Reported declarations from `org.modelix.model.api` should not be annotated as experimental.
152-
if (line.startsWith("export declare namespace org.modelix.model.client2")) {
153-
it.appendLine(experimentalDeclaration)
154-
}
155-
it.appendLine(line)
156-
}
143+
.append(originalTypescriptDeclarationContent)
157144
}
158145
}
159146
}

model-client/integration-tests/src/jsTest/kotlin/org/modelix/model/client2/ClientJsAuthTest.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
@file:OptIn(UnstableModelixFeature::class)
2-
31
package org.modelix.model.client2
42

53
import io.ktor.client.plugins.ClientRequestException
64
import io.ktor.http.HttpStatusCode
75
import kotlinx.coroutines.await
86
import kotlinx.coroutines.test.runTest
9-
import org.modelix.kotlin.utils.UnstableModelixFeature
107
import kotlin.js.Promise
118
import kotlin.test.Test
129
import kotlin.test.assertEquals

model-client/src/jsMain/kotlin/org/modelix/model/client2/BranchJSImpl.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
@file:OptIn(UnstableModelixFeature::class)
18-
1917
package org.modelix.model.client2
2018

2119
import INodeJS
2220
import INodeReferenceJS
23-
import org.modelix.kotlin.utils.UnstableModelixFeature
2421
import org.modelix.model.api.IBranch
2522
import org.modelix.model.api.IBranchListener
2623
import org.modelix.model.api.INodeReferenceSerializer

model-client/src/jsMain/kotlin/org/modelix/model/client2/ChangeJS.kt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@
1717
package org.modelix.model.client2
1818

1919
import INodeJS
20-
import org.modelix.kotlin.utils.UnstableModelixFeature
2120

2221
/**
2322
* Represents a change in branch that can be handled by a [ChangeHandler].
2423
* See [BranchJS.addListener]
2524
*/
26-
@UnstableModelixFeature(
27-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
28-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
29-
)
3025
@JsExport
3126
sealed interface ChangeJS {
3227
/**
@@ -38,10 +33,6 @@ sealed interface ChangeJS {
3833
/**
3934
* Represents a changed property value.
4035
*/
41-
@UnstableModelixFeature(
42-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
43-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
44-
)
4536
@JsExport
4637
data class PropertyChanged(
4738
override val node: INodeJS,
@@ -54,10 +45,6 @@ data class PropertyChanged(
5445
/**
5546
* Represents moved, added or removed children.
5647
*/
57-
@UnstableModelixFeature(
58-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
59-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
60-
)
6148
@JsExport
6249
data class ChildrenChanged(
6350
override val node: INodeJS,
@@ -70,10 +57,6 @@ data class ChildrenChanged(
7057
/**
7158
* Represents a changed reference target.
7259
*/
73-
@UnstableModelixFeature(
74-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
75-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
76-
)
7760
@JsExport
7861
data class ReferenceChanged(
7962
override val node: INodeJS,
@@ -86,19 +69,11 @@ data class ReferenceChanged(
8669
/**
8770
* Represents the change of the parent of [node] changed.
8871
*/
89-
@UnstableModelixFeature(
90-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
91-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
92-
)
9372
@JsExport
9473
data class ContainmentChanged(override val node: INodeJS) : ChangeJS
9574

9675
/**
9776
* Represents the change of the concept of a [node].
9877
*/
99-
@UnstableModelixFeature(
100-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
101-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
102-
)
10378
@JsExport
10479
data class ConceptChanged(override val node: INodeJS) : ChangeJS

model-client/src/jsMain/kotlin/org/modelix/model/client2/ClientJS.kt

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
@file:OptIn(UnstableModelixFeature::class, DelicateCoroutinesApi::class)
17+
@file:OptIn(DelicateCoroutinesApi::class)
1818

1919
package org.modelix.model.client2
2020

@@ -24,7 +24,6 @@ import kotlinx.coroutines.DelicateCoroutinesApi
2424
import kotlinx.coroutines.GlobalScope
2525
import kotlinx.coroutines.await
2626
import kotlinx.coroutines.promise
27-
import org.modelix.kotlin.utils.UnstableModelixFeature
2827
import org.modelix.model.ModelFacade
2928
import org.modelix.model.api.INode
3029
import org.modelix.model.api.JSNodeConverter
@@ -36,10 +35,6 @@ import kotlin.js.Promise
3635
/**
3736
* Same as [loadModelsFromJsonAsBranch] but directly returns the [BranchJS.rootNode] of the created branch.
3837
*/
39-
@UnstableModelixFeature(
40-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
41-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
42-
)
4338
@JsExport
4439
fun loadModelsFromJson(json: Array<String>): INodeJS {
4540
val branch = loadModelsFromJsonAsBranch(json)
@@ -51,10 +46,6 @@ fun loadModelsFromJson(json: Array<String>): INodeJS {
5146
*
5247
* Each JSON string will be added as child of the [BranchJS.rootNode] the created [BranchJS].
5348
*/
54-
@UnstableModelixFeature(
55-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
56-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
57-
)
5849
@JsExport
5950
fun loadModelsFromJsonAsBranch(json: Array<String>): BranchJS {
6051
val branch = ModelFacade.toLocalBranch(ModelFacade.newLocalTree())
@@ -68,10 +59,6 @@ fun loadModelsFromJsonAsBranch(json: Array<String>): BranchJS {
6859
* @param url URL to the V2 endpoint of the model server.
6960
* e.g., http://localhost:28102/v2
7061
*/
71-
@UnstableModelixFeature(
72-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
73-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
74-
)
7562
@JsExport
7663
fun connectClient(url: String, bearerTokenProvider: (() -> Promise<String?>)? = null): Promise<ClientJS> {
7764
return GlobalScope.promise {
@@ -94,10 +81,6 @@ fun connectClient(url: String, bearerTokenProvider: (() -> Promise<String?>)? =
9481
* The full version data of an [ModelClientV2] is not exposed because most parts model API are not exposed to JS yet.
9582
* See https://issues.modelix.org/issue/MODELIX-962
9683
*/
97-
@UnstableModelixFeature(
98-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
99-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
100-
)
10184
@JsExport
10285
interface ClientJS {
10386

@@ -203,10 +186,6 @@ typealias ChangeHandler = (ChangeJS) -> Unit
203186
* The full version data of an [ModelClientV2] is not exposed because most parts model API are not exposed to JS yet.
204187
* See https://issues.modelix.org/issue/MODELIX-962
205188
*/
206-
@UnstableModelixFeature(
207-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
208-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
209-
)
210189
@JsExport
211190
interface BranchJS {
212191
/**

model-client/src/jsMain/kotlin/org/modelix/model/client2/ReplicatedModelJS.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
@file:OptIn(UnstableModelixFeature::class, UnstableModelixFeature::class)
18-
1917
package org.modelix.model.client2
2018

21-
import org.modelix.kotlin.utils.UnstableModelixFeature
2219
import kotlin.js.Promise
2320

2421
/**
2522
* Represents a branch two-way live replicated to the model server.
2623
*/
27-
@UnstableModelixFeature(
28-
reason = "The overarching task https://issues.modelix.org/issue/MODELIX-500 is in development.",
29-
intendedFinalization = "The client is intended to be finalized when the overarching task is finished.",
30-
)
3124
@JsExport
3225
interface ReplicatedModelJS {
3326
/**

model-client/src/jsMain/kotlin/org/modelix/model/client2/ReplicatedModelJSImpl.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17-
@file:OptIn(UnstableModelixFeature::class, DelicateCoroutinesApi::class)
17+
@file:OptIn(DelicateCoroutinesApi::class)
1818

1919
package org.modelix.model.client2
2020

2121
import kotlinx.coroutines.DelicateCoroutinesApi
2222
import kotlinx.coroutines.GlobalScope
2323
import kotlinx.coroutines.promise
2424
import kotlinx.datetime.toJSDate
25-
import org.modelix.kotlin.utils.UnstableModelixFeature
2625
import org.modelix.model.withAutoTransactions
2726
import kotlin.js.Promise
2827

model-client/src/jsTest/kotlin/org/modelix/model/client2/BranchJSTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
package org.modelix.model.client2
1818

1919
import GeneratedConcept
20-
import org.modelix.kotlin.utils.UnstableModelixFeature
2120
import kotlin.test.Test
2221
import kotlin.test.assertEquals
2322
import kotlin.test.assertNull
2423

25-
@OptIn(UnstableModelixFeature::class)
2624
class BranchJSTest {
2725

2826
private val emptyRoot = """

model-client/src/jsTest/kotlin/org/modelix/model/client2/ClientJSTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@
1717
package org.modelix.model.client2
1818

1919
import GeneratedConcept
20-
import org.modelix.kotlin.utils.UnstableModelixFeature
2120
import kotlin.test.Test
2221
import kotlin.test.assertEquals
2322

24-
@OptIn(UnstableModelixFeature::class)
2523
class ClientJSTest {
2624

2725
private val emptyRoot = """

vue-model-api/src/useModelClient.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ type ClientJS = org.modelix.model.client2.ClientJS;
1111
*
1212
* The URL is reactive and if it changes, the client is automatically disposed and a new client for the updated URL is created.
1313
*
14-
* @experimental This feature is expected to be finalized with https://issues.modelix.org/issue/MODELIX-500.
15-
*
1614
* @param url - Reactive reference of an URL to a model server.
1715
* @param getClient - Function how to create a cliente given an URL.
1816
*

0 commit comments

Comments
 (0)