Skip to content

Commit 7b9bfed

Browse files
authored
Prepare 1.5.0-RC release
1 parent 169a145 commit 7b9bfed

File tree

2 files changed

+83
-13
lines changed

2 files changed

+83
-13
lines changed

CHANGELOG.md

+71-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,77 @@
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+
171
1.4.1 / 2022-10-14
272
==================
373

4-
This is patch release contains several bugfixes and improvements.
74+
This is patch release contains several bugfixes and improvements.
575
Kotlin 1.7.20 is used by default.
676

777
### Improvements

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
[![JetBrains official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
55
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
66
[![TeamCity build](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/KotlinTools_KotlinxSerialization_Ko.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=KotlinTools_KotlinxSerialization_Ko&guest=1)
7-
[![Kotlin](https://img.shields.io/badge/kotlin-1.7.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
8-
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-serialization-core/1.4.1)](https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-serialization-core/1.4.1/pom)
7+
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
8+
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-serialization-core/1.5.0-RC)](https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-serialization-core/1.5.0-RC/pom)
99
[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://kotlinlang.org/api/kotlinx.serialization/)
1010
[![Slack channel](https://img.shields.io/badge/chat-slack-blue.svg?logo=slack)](https://kotlinlang.slack.com/messages/serialization/)
1111

@@ -92,17 +92,17 @@ Kotlin DSL:
9292

9393
```kotlin
9494
plugins {
95-
kotlin("jvm") version "1.7.20" // or kotlin("multiplatform") or any other kotlin plugin
96-
kotlin("plugin.serialization") version "1.7.20"
95+
kotlin("jvm") version "1.8.0" // or kotlin("multiplatform") or any other kotlin plugin
96+
kotlin("plugin.serialization") version "1.8.0"
9797
}
9898
```
9999

100100
Groovy DSL:
101101

102102
```gradle
103103
plugins {
104-
id 'org.jetbrains.kotlin.multiplatform' version '1.7.20'
105-
id 'org.jetbrains.kotlin.plugin.serialization' version '1.7.20'
104+
id 'org.jetbrains.kotlin.multiplatform' version '1.8.0'
105+
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.0'
106106
}
107107
```
108108

@@ -119,7 +119,7 @@ buildscript {
119119
repositories { mavenCentral() }
120120

121121
dependencies {
122-
val kotlinVersion = "1.7.20"
122+
val kotlinVersion = "1.8.0"
123123
classpath(kotlin("gradle-plugin", version = kotlinVersion))
124124
classpath(kotlin("serialization", version = kotlinVersion))
125125
}
@@ -130,7 +130,7 @@ Groovy DSL:
130130

131131
```gradle
132132
buildscript {
133-
ext.kotlin_version = '1.7.20'
133+
ext.kotlin_version = '1.8.0'
134134
repositories { mavenCentral() }
135135
136136
dependencies {
@@ -159,7 +159,7 @@ repositories {
159159
}
160160

161161
dependencies {
162-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
162+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0-RC")
163163
}
164164
```
165165

@@ -171,7 +171,7 @@ repositories {
171171
}
172172
173173
dependencies {
174-
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
174+
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0-RC"
175175
}
176176
```
177177

@@ -261,8 +261,8 @@ Ensure the proper version of Kotlin and serialization version:
261261

262262
```xml
263263
<properties>
264-
<kotlin.version>1.7.20</kotlin.version>
265-
<serialization.version>1.4.1</serialization.version>
264+
<kotlin.version>1.8.0</kotlin.version>
265+
<serialization.version>1.5.0-RC</serialization.version>
266266
</properties>
267267
```
268268

0 commit comments

Comments
 (0)