aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/Form.kt4
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt3
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt2
6 files changed, 14 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
index 8f93c7ea..e2f5d730 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
@@ -21,6 +21,7 @@
*/
package pl.treksoft.kvision.form
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Mapper
import kotlinx.serialization.context.MutableSerialContextImpl
@@ -106,7 +107,7 @@ class Form<K : Any>(private val panel: FormPanel<K>? = null, private val seriali
else -> listOf(entry.key to entry.value)
}
}.toMap()
- val mapper = Mapper.InNullableMapper(FormMapWrapper(map))
+ val mapper = Mapper().InNullableMapper(FormMapWrapper(map))
mapper.context = MutableSerialContextImpl().apply { registerSerializer(Date::class, DateSerializer) }
mapper.decode(serializer)
}
@@ -320,6 +321,7 @@ class Form<K : Any>(private val panel: FormPanel<K>? = null, private val seriali
}
companion object {
+ @UseExperimental(ImplicitReflectionSerializer::class)
inline fun <reified K : Any> create(
panel: FormPanel<K>? = null,
noinline init: (Form<K>.() -> Unit)? = null
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt b/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt
index 3533dee5..c9b33572 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt
@@ -22,6 +22,7 @@
package pl.treksoft.kvision.form
import com.github.snabbdom.VNode
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.serializer
import pl.treksoft.kvision.core.Container
@@ -407,6 +408,7 @@ open class FormPanel<K : Any>(
return formPanel
}
+ @UseExperimental(ImplicitReflectionSerializer::class)
inline fun <reified K : Any> create(
method: FormMethod? = null, action: String? = null, enctype: FormEnctype? = null,
type: FormType? = null, classes: Set<String> = setOf(),
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt
index a48a6b1f..4a086e2a 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt
@@ -21,6 +21,8 @@
*/
package pl.treksoft.kvision.remote
+import kotlinx.serialization.ImplicitReflectionSerializer
+import kotlinx.serialization.stringify
import pl.treksoft.jquery.JQueryAjaxSettings
import pl.treksoft.jquery.JQueryXHR
import pl.treksoft.jquery.jQuery
@@ -49,6 +51,7 @@ open class CallAgent {
* @param data data to be sent
* @return a promise of the result
*/
+ @UseExperimental(ImplicitReflectionSerializer::class)
@Suppress("UnsafeCastFromDynamic")
fun jsonRpcCall(
url: String,
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt
index b4cc6c21..30d2062d 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt
@@ -23,6 +23,7 @@ package pl.treksoft.kvision.remote
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.asDeferred
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.list
import kotlinx.serialization.serializer
import pl.treksoft.kvision.utils.JSON
@@ -34,6 +35,7 @@ import kotlin.js.JSON as NativeJSON
* Client side agent for JSON-RPC remote calls with Jooby.
*/
@Suppress("LargeClass", "TooManyFunctions")
+@UseExperimental(ImplicitReflectionSerializer::class)
open class JoobyRemoteAgent<T : Any>(val serviceManager: JoobyServiceManager<T>) : RemoteAgent {
val callAgent = CallAgent()
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
index b1ee4fde..cbb2978a 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
@@ -21,6 +21,7 @@
*/
package pl.treksoft.kvision.remote
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.internal.BooleanSerializer
import kotlinx.serialization.internal.ByteSerializer
@@ -52,6 +53,7 @@ interface RemoteAgent {
* @suppress
* Internal function
*/
+ @UseExperimental(ImplicitReflectionSerializer::class)
@Suppress("ComplexMethod", "TooGenericExceptionCaught", "NestedBlockDepth")
fun trySerialize(kClass: KClass<Any>, value: Any): String {
return if (value is List<*>) {
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt
index f1f3b473..f329d10e 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt
@@ -23,6 +23,7 @@ package pl.treksoft.kvision.remote
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.asDeferred
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.list
import kotlinx.serialization.serializer
import pl.treksoft.kvision.utils.JSON
@@ -34,6 +35,7 @@ import kotlin.js.JSON as NativeJSON
* Client side agent for JSON-RPC remote calls with Spring Boot.
*/
@Suppress("LargeClass", "TooManyFunctions")
+@UseExperimental(ImplicitReflectionSerializer::class)
open class SpringRemoteAgent<T : Any>(val serviceManager: SpringServiceManager<T>) : RemoteAgent {
val callAgent = CallAgent()