|
| 1 | + |
| 2 | +1.5.0-RC / 2023-01-25 |
| 3 | +================== |
| 4 | + |
| 5 | +This is a release candidate for the next version with many new features to try. |
| 6 | +It uses Kotlin 1.8.0 by default. |
| 7 | + |
| 8 | +### Json naming strategies |
| 9 | + |
| 10 | +A long-awaited feature (#33) is available in this release. |
| 11 | +A new interface, `JsonNamingStrategy` and Json configuration property `namingStrategy` allow |
| 12 | +defining a transformation that is applied to all properties' names serialized by a Json instance. |
| 13 | +There's also a predefined implementation for the most common use case: `Json { namingStrategy = JsonNamingStrategy.SnakeCase }`. |
| 14 | +Check out the [PR](https://github.com/Kotlin/kotlinx.serialization/pull/2111) for more details and documentation. |
| 15 | + |
| 16 | +### Json unquoted literals |
| 17 | + |
| 18 | +kotlinx-serialization-json has an API for manipulating raw Json values: functions and classes `JsonObject`, `JsonPrimitive`, etc. |
| 19 | +In this release, there is a new addition to this API: `JsonUnquotedLiteral` constructor function. |
| 20 | +It allows to produce a string that is not quoted in the Json output. This function has a lot of valuable |
| 21 | +applications: from writing unsigned or large numbers to embedding whole Json documents without the need for re-parsing. |
| 22 | +This huge feature was contributed to us by [aSemy](https://github.com/aSemy): [#2041](https://github.com/Kotlin/kotlinx.serialization/pull/2041). |
| 23 | + |
| 24 | +### Stabilization of serializer(java.lang.Type) function family |
| 25 | + |
| 26 | +Functions `serializer`, `serializerOrNull` and extensions `SerializersModule.serializer`, `SerializersModule.serializerOrNull` |
| 27 | +have JVM-only overloads that accept `java.lang.Type`. These overloads are crucial for interoperability: with them, third-party Java frameworks |
| 28 | +like Spring, which usually rely on Java's reflection and type tokens, can retrieve `KSerializer` instance and use kotlinx.serialization properly. |
| 29 | +We've removed `@ExperimentalSerializationApi` from these functions, and starting from 1.5.0-RC they're considered stable with all backward compatibility guarantees. |
| 30 | +This change should improve third-party support for kotlinx.serialization in various frameworks. |
| 31 | +See the [PR](https://github.com/Kotlin/kotlinx.serialization/issues/2069) for details. |
| 32 | + |
| 33 | +### Deprecations in module builders for polymorphism |
| 34 | + |
| 35 | +Some time ago, in 1.3.2, new functions `SerializersModuleBuilder.polymorphicDefaultSerializer/polymorphicDefaultDeserializer` and `PolymorphicModuleBuilder.defaultDeserializer` were introduced |
| 36 | +— better names allow an easier understanding of which serializers affect what part of the process. |
| 37 | +In 1.5.0-RC, we finish the migration path: these functions are no longer experimental. |
| 38 | +And old functions, namely `SerializersModuleCollector.polymorphicDefault` and `PolymorphicModuleBuilder.default`, are now deprecated. |
| 39 | +See the [PR](https://github.com/Kotlin/kotlinx.serialization/issues/2076) for details. |
| 40 | + |
| 41 | +### Bundled Proguard rules |
| 42 | + |
| 43 | +The `kotlinx-serialization-core-jvm` JAR file now includes consumer Proguard rules, |
| 44 | +so manual Proguard configuration is no longer necessary for most of the setups. |
| 45 | +See updated [Android setup section](https://github.com/Kotlin/kotlinx.serialization/blob/169a14558ca13cfd731283a854d825d1f19ef195/README.md#android) |
| 46 | +and corresponding PRs: [#2092](https://github.com/Kotlin/kotlinx.serialization/issues/2092), [#2123](https://github.com/Kotlin/kotlinx.serialization/issues/2123). |
| 47 | + |
| 48 | +### Support for kotlin.Duration in HOCON format |
| 49 | + |
| 50 | +HOCON specifies its own formatting for duration values. Starting with this release, |
| 51 | +kotlinx-serialization-hocon is able to serialize and deserialize `kotlin.Duration` |
| 52 | +using proper representation instead of the default one. Big thanks to [Alexander Mikhailov](https://github.com/alexmihailov) |
| 53 | +and his PRs: [#2080](https://github.com/Kotlin/kotlinx.serialization/issues/2080), [#2073](https://github.com/Kotlin/kotlinx.serialization/issues/2073). |
| 54 | + |
| 55 | +### Functional and performance improvements |
| 56 | + |
| 57 | + * Make DeserializationStrategy covariant at declaration-site (#1897) (thanks to [Lukellmann](https://github.com/Lukellmann)) |
| 58 | + * Added support for the `kotlin.Nothing` class as built-in (#1991, #2150) |
| 59 | + * Further improve stream decoding performance (#2101) |
| 60 | + * Introduce CharArray pooling for InputStream decoding (#2100) |
| 61 | + * Consolidate exception messages and improve them (#2068) |
| 62 | + |
| 63 | +### Bugfixes |
| 64 | + |
| 65 | + * Add stable hashCode()/equals() calculation to PrimitiveSerialDescriptor (#2136) (thanks to [Vasily Vasilkov](https://github.com/vgv)) |
| 66 | + * Added a factory that creates an enum serializer with annotations on the class (#2125) |
| 67 | + * Correctly handle situation where different serializers can be provided for the same KClass in SealedClassSerializer (#2113) |
| 68 | + * Fixed serializers caching for parametrized types from different class loaders (#2070) |
| 69 | + |
| 70 | + |
1 | 71 | 1.4.1 / 2022-10-14
|
2 | 72 | ==================
|
3 | 73 |
|
4 |
| -This is patch release contains several bugfixes and improvements. |
| 74 | +This is patch release contains several bugfixes and improvements. |
5 | 75 | Kotlin 1.7.20 is used by default.
|
6 | 76 |
|
7 | 77 | ### Improvements
|
|
0 commit comments