From 40b9cc1f785eaae352267757ac9e091c25ed0744 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Wed, 7 Nov 2018 22:16:46 +0100 Subject: Upgrade to Kotlin 1.3.0 final. --- src/main/kotlin/pl/treksoft/kvision/form/Form.kt | 4 +++- src/main/kotlin/pl/treksoft/kvision/form/FormPanel.kt | 2 ++ src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt | 3 +++ src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt | 2 ++ src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt | 2 ++ src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt | 2 ++ 6 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin') 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(private val panel: FormPanel? = 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(private val panel: FormPanel? = null, private val seriali } companion object { + @UseExperimental(ImplicitReflectionSerializer::class) inline fun create( panel: FormPanel? = null, noinline init: (Form.() -> 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( return formPanel } + @UseExperimental(ImplicitReflectionSerializer::class) inline fun create( method: FormMethod? = null, action: String? = null, enctype: FormEnctype? = null, type: FormType? = null, classes: Set = 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(val serviceManager: JoobyServiceManager) : 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, 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(val serviceManager: SpringServiceManager) : RemoteAgent { val callAgent = CallAgent() -- cgit