From 2a4ce5588a1360ed3474d4e61edf583f0bb6a4eb Mon Sep 17 00:00:00 2001 From: Donghyeon Kim Date: Fri, 29 Jan 2021 03:17:31 +0900 Subject: [PATCH 1/5] Fix typo in serializers.md (#1307) In the document, ISO 6801 is modified to ISO 8601. The date and time format standard is ISO 8601, not ISO 6801. --- docs/serializers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/serializers.md b/docs/serializers.md index 5435f3f7ac..e0da5a7000 100644 --- a/docs/serializers.md +++ b/docs/serializers.md @@ -815,7 +815,7 @@ All the previous approaches to specifying custom serialization strategies were _ fully defined at compile-time. The exception was the [Passing a serializer manually](#passing-a-serializer-manually) approach, but it worked only on a top-level object. You might need to change the serialization strategy for objects deep in the serialized object tree at run-time, with the strategy being selected in a context-dependent way. -For example, you might want to represent `java.util.Date` in JSON format as an ISO 6801 string or as a long integer +For example, you might want to represent `java.util.Date` in JSON format as an ISO 8601 string or as a long integer depending on a version of a protocol you are serializing data for. This is called _contextual_ serialization, and it is supported by a built-in [ContextualSerializer] class. Usually we don't have to use this serializer class explicitly—there is the [Contextual] annotation providing a shortcut to From c8c14c9d54589224bb7347d3faf58d18e20294ae Mon Sep 17 00:00:00 2001 From: Mike Gershunovsky Date: Mon, 1 Feb 2021 07:24:22 -0500 Subject: [PATCH 2/5] Fix typo in serializers.md (#1315) --- docs/serializers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/serializers.md b/docs/serializers.md index e0da5a7000..01d6e07547 100644 --- a/docs/serializers.md +++ b/docs/serializers.md @@ -933,7 +933,7 @@ object ProjectSerializer ``` You must bind this serializer to a class using one of the approaches explained in this chapter. We'll -follow the [Passing a serializer manually](#passing-a-serializer-manually) appraoch for this example. +follow the [Passing a serializer manually](#passing-a-serializer-manually) approach for this example. ```kotlin fun main() { From b33c0bb16ee264aae09842b4521f20eb748ca083 Mon Sep 17 00:00:00 2001 From: Leonid Startsev Date: Mon, 1 Feb 2021 19:40:10 +0300 Subject: [PATCH 3/5] Prepare 1.1.0-RC --- CHANGELOG.md | 44 ++++++++++++++++++++++++++++++ gradle.properties | 4 +-- integration-test/gradle.properties | 4 +-- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59594f277d..56a7920465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,47 @@ +1.1.0-RC / 2021-02-03 +================== + +This is a release candidate of 1.1.0 version. Note that final 1.1.0 version may include more features and bugfixes, +which would be listed in the corresponding changelog. + +### Kotlin version requirement updated + +Due to changes in calling conventions between compiler plugin and serialization core runtime, this release requires +Kotlin version at least 1.4.30-M1. However, this changes should not affect your code, +because only deprecated functions were removed from public API. +See [corresponding PR](https://github.com/Kotlin/kotlinx.serialization/pull/1260) for the details. + +### Experimental support for inline classes (IR only) + +Using 1.1.0-RC, you can mark inline classes as `@Serializable` and use them in other serializable classes. +Unsigned integer types (`UByte`, `UShort`, `UInt` and `ULong`) are serializable as well and have special support in JSON. +This feature requires Kotlin compiler 1.4.30-RC and enabling new IR compilers for for [JS](https://kotlinlang.org/docs/reference/js-ir-compiler.html) and [JVM](https://kotlinlang.org/docs/reference/whatsnew14.html#new-jvm-ir-backend). + +You can learn more in the [documentation](docs/inline-classes.md) +and corresponding [pull request](https://github.com/Kotlin/kotlinx.serialization/pull/1244). + +### Other features + + * Add serializerOrNull function for KType and Type arguments (#1164) + * Allow shared prefix names in Properties (#1183) (thanks to [TorRanfelt](https://github.com/TorRanfelt)) + * Add support for encoding/decoding Properties values as Strings (#1158) (thanks to [daniel-jasinski](https://github.com/daniel-jasinski)) + +### Bugfixes and performance improvements + + * Support contextual serialization for derived classes (#1277) (thanks to [Martin Raison](https://github.com/martinraison)) + * Ensure serialization is usable from K/N background thread (#1282) + * Fail on primitive type overflow during JsonElement deserialization (#1300) + * Throw SerializationException instead of ISE when encountering an invalid boolean in JSON (#1299) + * Optimize the loop for writing large varints in ProtoBuf (#1294) + * Fix serializing property with custom accessors and backing field (#1197) + * Optimize check for missing fields in deserialization and improve MissingFieldException message (#1153) + * Improved support of nullable serializer in @UseSerializers annotation (#1195) + * Correctly escape keys in JsonObject.toString() (#1246) (thanks to [Karlatemp](https://github.com/Karlatemp)) + * Treat Collection as ArrayList in serializer by type lookups (#1257) + * Do not try to end structure in encode/decode structure extensions if an exception has been thrown, so the original exception will be propagated (#1201) + * Properly cache serial names in order to improve performance of JSON parser with strict mode (#1209) + * Fix dynamic serialization for nullable values (#1199) (thanks to [ankushg](https://github.com/ankushg)) + 1.0.1 / 2020-10-28 ================== diff --git a/gradle.properties b/gradle.properties index 47ed36cade..2f2b1f6d51 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ # group=org.jetbrains.kotlinx -version=1.1.0-SNAPSHOT +version=1.1.0-RC -kotlin.version=1.4.30-RC +kotlin.version=1.4.30-270 # This version take precedence if 'bootstrap' property passed to project kotlin.version.snapshot=1.4.255-SNAPSHOT diff --git a/integration-test/gradle.properties b/integration-test/gradle.properties index 9ee976e02a..9c1e94590b 100644 --- a/integration-test/gradle.properties +++ b/integration-test/gradle.properties @@ -2,8 +2,8 @@ # Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. # -mainKotlinVersion=1.4.30-RC -mainLibVersion=1.1.0-SNAPSHOT +mainKotlinVersion=1.4.30-270 +mainLibVersion=1.1.0-RC kotlin.code.style=official kotlin.js.compiler=both From 0e2b7c07021194bbc3e001a838d915a72e0d6471 Mon Sep 17 00:00:00 2001 From: Leonid Startsev Date: Wed, 3 Feb 2021 16:41:28 +0300 Subject: [PATCH 4/5] Fix duplicated 'for' Co-authored-by: Him188 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56a7920465..902d772795 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ See [corresponding PR](https://github.com/Kotlin/kotlinx.serialization/pull/1260 Using 1.1.0-RC, you can mark inline classes as `@Serializable` and use them in other serializable classes. Unsigned integer types (`UByte`, `UShort`, `UInt` and `ULong`) are serializable as well and have special support in JSON. -This feature requires Kotlin compiler 1.4.30-RC and enabling new IR compilers for for [JS](https://kotlinlang.org/docs/reference/js-ir-compiler.html) and [JVM](https://kotlinlang.org/docs/reference/whatsnew14.html#new-jvm-ir-backend). +This feature requires Kotlin compiler 1.4.30-RC and enabling new IR compilers for [JS](https://kotlinlang.org/docs/reference/js-ir-compiler.html) and [JVM](https://kotlinlang.org/docs/reference/whatsnew14.html#new-jvm-ir-backend). You can learn more in the [documentation](docs/inline-classes.md) and corresponding [pull request](https://github.com/Kotlin/kotlinx.serialization/pull/1244). From cdde6545d71155bbc8cd021d17378452dbb29842 Mon Sep 17 00:00:00 2001 From: Leonid Startsev Date: Wed, 3 Feb 2021 16:48:19 +0300 Subject: [PATCH 5/5] Add backticks to classes --- CHANGELOG.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 902d772795..8022cecc1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,22 +22,22 @@ and corresponding [pull request](https://github.com/Kotlin/kotlinx.serialization ### Other features - * Add serializerOrNull function for KType and Type arguments (#1164) - * Allow shared prefix names in Properties (#1183) (thanks to [TorRanfelt](https://github.com/TorRanfelt)) - * Add support for encoding/decoding Properties values as Strings (#1158) (thanks to [daniel-jasinski](https://github.com/daniel-jasinski)) + * Add `serializerOrNull` function for `KType` and `Type` arguments (#1164) + * Allow shared prefix names in `Properties` (#1183) (thanks to [TorRanfelt](https://github.com/TorRanfelt)) + * Add support for encoding/decoding `Properties` values as Strings (#1158) (thanks to [daniel-jasinski](https://github.com/daniel-jasinski)) ### Bugfixes and performance improvements * Support contextual serialization for derived classes (#1277) (thanks to [Martin Raison](https://github.com/martinraison)) * Ensure serialization is usable from K/N background thread (#1282) - * Fail on primitive type overflow during JsonElement deserialization (#1300) - * Throw SerializationException instead of ISE when encountering an invalid boolean in JSON (#1299) - * Optimize the loop for writing large varints in ProtoBuf (#1294) + * Fail on primitive type overflow during `JsonElement` deserialization (#1300) + * Throw `SerializationException` instead of ISE when encountering an invalid boolean in JSON (#1299) + * Optimize the loop for writing large varints in `ProtoBuf` (#1294) * Fix serializing property with custom accessors and backing field (#1197) - * Optimize check for missing fields in deserialization and improve MissingFieldException message (#1153) - * Improved support of nullable serializer in @UseSerializers annotation (#1195) - * Correctly escape keys in JsonObject.toString() (#1246) (thanks to [Karlatemp](https://github.com/Karlatemp)) - * Treat Collection as ArrayList in serializer by type lookups (#1257) + * Optimize check for missing fields in deserialization and improve `MissingFieldException` message (#1153) + * Improved support of nullable serializer in `@UseSerializers` annotation (#1195) + * Correctly escape keys in `JsonObject.toString()` (#1246) (thanks to [Karlatemp](https://github.com/Karlatemp)) + * Treat `Collection` as `ArrayList` in serializer by type lookups (#1257) * Do not try to end structure in encode/decode structure extensions if an exception has been thrown, so the original exception will be propagated (#1201) * Properly cache serial names in order to improve performance of JSON parser with strict mode (#1209) * Fix dynamic serialization for nullable values (#1199) (thanks to [ankushg](https://github.com/ankushg))