Skip to content

Commit 83b6e33

Browse files
authored
Prepare 1.4.0-RC release (#1997)
1 parent c2f3c71 commit 83b6e33

File tree

7 files changed

+126
-57
lines changed

7 files changed

+126
-57
lines changed

CHANGELOG.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
1.4.0-RC / 2022-07-20
2+
==================
3+
4+
This is a candidate for the next big release with many new exciting features to try.
5+
It uses Kotlin 1.7.10 by default.
6+
7+
### Integration with Okio's BufferedSource and BufferedSink
8+
9+
[Okio library by Square](https://square.github.io/okio/) is a popular solution for fast and efficient IO operations on JVM, K/N and K/JS.
10+
In this version, we have added functions that parse/write JSON directly to Okio's input/output classes, saving you the overhead of copying data to `String` beforehand.
11+
These functions are called `Json.decodeFromBufferedSource` and `Json.encodeToBufferedSink`, respectively.
12+
There's also `decodeBufferedSourceToSequence` that behaves similarly to `decodeToSequence` from Java streams integration, so you can lazily decode multiple objects the same way as before.
13+
14+
Note that these functions are located in a separate new artifact, so users who don't need them wouldn't find themselves dependent on Okio.
15+
To include this artifact in your project, use the same group id `org.jetbrains.kotlinx` and artifact id `kotlinx-serialization-json-okio`.
16+
To find out more about this integration, check new functions' documentation and corresponding pull requests:
17+
[#1901](https://github.com/Kotlin/kotlinx.serialization/pull/1901) and [#1982](https://github.com/Kotlin/kotlinx.serialization/pull/1982).
18+
19+
### Inline classes and unsigned numbers do not require experimental annotations anymore
20+
21+
Inline classes and unsigned number types have been promoted to a Stable feature in Kotlin 1.5,
22+
and now we are promoting support for them in kotlinx.serialization to Stable status, too.
23+
To be precise, [we've removed all](https://github.com/Kotlin/kotlinx.serialization/pull/1963) `@ExperimentalSerializationApi` annotations from functions related to inline classes encoding and decoding,
24+
namely `SerialDescriptor.isInline`, `Encoder.encodeInline`, and some others. We've also updated related [documentation article](docs/value-classes.md).
25+
26+
Additionally, all `@ExperimentalUnsignedTypes` annotations [were removed](https://github.com/Kotlin/kotlinx.serialization/pull/1962) completely,
27+
so you can freely use types such as `UInt` and their respective serializers as a stable feature
28+
without opt-in requirement.
29+
30+
### Part of SerializationException's hierarchy is public now
31+
32+
When kotlinx.serialization 1.0 was released, all subclasses of `SerializationException` were made internal,
33+
since they didn't provide helpful information besides the standard message.
34+
Since then, we've received a lot of feature requests with compelling use-cases for exposing some of these internal types to the public.
35+
In this release, we are starting to fulfilling these requests by making `MissingFieldException` public.
36+
One can use it in the `catch` clause to better understand the reasons of failure — for example, to return 400 instead of 500 from an HTTP server —
37+
and then use its `fields` property to communicate the message better.
38+
See the details in the corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1983).
39+
40+
In future releases, we'll continue work in this direction, and we aim to provide more useful public exception types & properties.
41+
In the meantime, we've [revamped KDoc](https://github.com/Kotlin/kotlinx.serialization/pull/1980) for some methods regarding the exceptions — all of them now properly declare which exception types are allowed to be thrown.
42+
For example, `KSerializer.deserialize` is documented to throw `IllegalStateException` to indicate problems unrelated to serialization, such as data validation in classes' constructors.
43+
44+
### @MetaSerializable annotation
45+
46+
This release introduces a new `@MetaSerializable` annotation that adds `@Serializable` behavior to user-defined annotations — i.e., those annotations would also instruct the compiler plugin to generate a serializer for class. In addition, all annotations marked with `@MetaSerializable` are saved in the generated `@SerialDescriptor`
47+
as if they are annotated with `@SerialInfo`.
48+
49+
This annotation will be particularly useful for various format authors who require adding some metadata to the serializable class — this can now be done using a single annotation instead of two, and without the risk of forgetting `@Serializable`. Check out details & examples in the KDoc and corresponding [PR](https://github.com/Kotlin/kotlinx.serialization/pull/1979).
50+
51+
> Note: Kotlin 1.7.0 or higher is required for this feature to work.
52+
53+
### Moving documentation from GitHub pages to kotlinlang.org
54+
55+
As a part of a coordinated effort to unify kotlinx libraries users' experience, Dokka-generated documentation pages (KDoc) were moved from https://kotlin.github.io/kotlinx.serialization/ to https://kotlinlang.org/api/kotlinx.serialization/. No action from you is required — there are proper redirects at the former address, so there is no need to worry about links in your blogpost getting obsolete or broken.
56+
57+
Note that this move does not affect guides written in Markdown in the `docs` folder. We aim to move them later, enriching text with runnable examples as in the Kotlin language guides.
58+
59+
### Other improvements
60+
61+
* Allow Kotlin's null literal in JSON DSL (#1907) (thanks to [Lukellmann](https://github.com/Lukellmann))
62+
* Stabilize EmptySerializersModule (#1921)
63+
* Boost performance of polymorphic deserialization in optimistic scenario (#1919)
64+
* Added serializer for the `kotlin.time.Duration` class (plugin support comes in Kotlin 1.7.20) (#1960)
65+
* Support tagged not null marks in TaggedEncoder/Decoder (#1954) (thanks to [EdwarDDay](https://github.com/EdwarDDay))
66+
67+
### Bugfixes
68+
69+
* Support quoting unsigned integers when used as map keys (#1969)
70+
* Fix protocol buffer enum schema generation (#1967) (thanks to [mogud](https://github.com/mogud))
71+
* Support diamond inheritance of sealed interfaces in SealedClassSerializer (#1958)
72+
* Support retrieving serializer for sealed interface (#1968)
73+
* Fix misleading token description in JSON errors (#1941) (thanks to [TheMrMilchmann](https://github.com/TheMrMilchmann))
74+
175
1.3.3 / 2022-05-11
276
==================
377

@@ -26,7 +100,7 @@ Many thanks to [Paul de Vrieze](https://github.com/pdvrieze) for his valuable co
26100
* Iterate over element indices in ObjectSerializer in order to let the format skip unknown keys (#1916)
27101
* Correctly support registering both default polymorphic serializer & deserializer (#1849)
28102
* Make error message for captured generic type parameters much more straightforward (#1863)
29-
103+
30104
1.3.2 / 2021-12-23
31105
==================
32106

README.md

Lines changed: 12 additions & 12 deletions
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.6.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
8-
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-serialization-core/1.3.3)](https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-serialization-core/1.3.3/pom)
7+
[![Kotlin](https://img.shields.io/badge/kotlin-1.7.10-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.0-RC)](https://search.maven.org/artifact/org.jetbrains.kotlinx/kotlinx-serialization-core/1.4.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

@@ -89,17 +89,17 @@ Kotlin DSL:
8989

9090
```kotlin
9191
plugins {
92-
kotlin("jvm") version "1.6.21" // or kotlin("multiplatform") or any other kotlin plugin
93-
kotlin("plugin.serialization") version "1.6.21"
92+
kotlin("jvm") version "1.7.10" // or kotlin("multiplatform") or any other kotlin plugin
93+
kotlin("plugin.serialization") version "1.7.10"
9494
}
9595
```
9696

9797
Groovy DSL:
9898

9999
```gradle
100100
plugins {
101-
id 'org.jetbrains.kotlin.multiplatform' version '1.6.21'
102-
id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.21'
101+
id 'org.jetbrains.kotlin.multiplatform' version '1.7.10'
102+
id 'org.jetbrains.kotlin.plugin.serialization' version '1.7.10'
103103
}
104104
```
105105

@@ -116,7 +116,7 @@ buildscript {
116116
repositories { mavenCentral() }
117117

118118
dependencies {
119-
val kotlinVersion = "1.6.21"
119+
val kotlinVersion = "1.7.10"
120120
classpath(kotlin("gradle-plugin", version = kotlinVersion))
121121
classpath(kotlin("serialization", version = kotlinVersion))
122122
}
@@ -127,7 +127,7 @@ Groovy DSL:
127127

128128
```gradle
129129
buildscript {
130-
ext.kotlin_version = '1.6.21'
130+
ext.kotlin_version = '1.7.10'
131131
repositories { mavenCentral() }
132132
133133
dependencies {
@@ -156,7 +156,7 @@ repositories {
156156
}
157157

158158
dependencies {
159-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
159+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0-RC")
160160
}
161161
```
162162

@@ -168,7 +168,7 @@ repositories {
168168
}
169169
170170
dependencies {
171-
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3"
171+
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.0-RC"
172172
}
173173
```
174174

@@ -286,8 +286,8 @@ Ensure the proper version of Kotlin and serialization version:
286286

287287
```xml
288288
<properties>
289-
<kotlin.version>1.6.21</kotlin.version>
290-
<serialization.version>1.3.3</serialization.version>
289+
<kotlin.version>1.7.10</kotlin.version>
290+
<serialization.version>1.4.0-RC</serialization.version>
291291
</properties>
292292
```
293293

core/commonMain/src/kotlinx/serialization/SerializationExceptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public open class SerializationException : IllegalArgumentException {
5959
}
6060

6161
/**
62-
* Thrown when [KSerializer] did not receive a non-optonal property from [CompositeDecoder] and [CompositeDecoder.decodeElementIndex]
62+
* Thrown when [KSerializer] did not receive a non-optional property from [CompositeDecoder] and [CompositeDecoder.decodeElementIndex]
6363
* had already returned [CompositeDecoder.DECODE_DONE].
6464
*
6565
* [MissingFieldException] is thrown on missing field from all [auto-generated][Serializable] serializers and it

docs/value-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ output:
4545
```
4646

4747
As we see, `Color` class is not included during the encoding, only its underlying data. This invariant holds even if the actual value class
48-
is [allocated](https://kotlinlang.org/docs/reference/inline-classes.html#representation) — for example, when inline
48+
is [allocated](https://kotlinlang.org/docs/reference/inline-classes.html#representation) — for example, when value
4949
class is used as a generic type argument:
5050

5151
```kotlin

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
group=org.jetbrains.kotlinx
66
version=1.4.0-SNAPSHOT
77

8-
kotlin.version=1.7.0
8+
kotlin.version=1.7.10
99

1010
# This version take precedence if 'bootstrap' property passed to project
1111
kotlin.version.snapshot=1.7.255-SNAPSHOT

integration-test/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
#
44

5-
mainKotlinVersion=1.7.0
5+
mainKotlinVersion=1.7.10
66
mainLibVersion=1.4.0-SNAPSHOT
77

88
kotlin.code.style=official

kotlin-js-store/yarn.lock

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ brace-expansion@^1.1.7:
5555
balanced-match "^1.0.0"
5656
concat-map "0.0.1"
5757

58+
brace-expansion@^2.0.1:
59+
version "2.0.1"
60+
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae"
61+
integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==
62+
dependencies:
63+
balanced-match "^1.0.0"
64+
5865
braces@~3.0.2:
5966
version "3.0.2"
6067
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
@@ -126,10 +133,10 @@ concat-map@0.0.1:
126133
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
127134
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
128135

129-
debug@4.3.3:
130-
version "4.3.3"
131-
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664"
132-
integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==
136+
debug@4.3.4:
137+
version "4.3.4"
138+
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
139+
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
133140
dependencies:
134141
ms "2.1.2"
135142

@@ -217,11 +224,6 @@ glob@7.2.0:
217224
once "^1.3.0"
218225
path-is-absolute "^1.0.0"
219226

220-
growl@1.10.5:
221-
version "1.10.5"
222-
resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e"
223-
integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==
224-
225227
has-flag@^4.0.0:
226228
version "4.0.0"
227229
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
@@ -284,11 +286,6 @@ is-unicode-supported@^0.1.0:
284286
resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7"
285287
integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==
286288

287-
isexe@^2.0.0:
288-
version "2.0.0"
289-
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
290-
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
291-
292289
js-yaml@4.1.0:
293290
version "4.1.0"
294291
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
@@ -311,39 +308,44 @@ log-symbols@4.1.0:
311308
chalk "^4.1.0"
312309
is-unicode-supported "^0.1.0"
313310

314-
minimatch@3.0.4, minimatch@^3.0.4:
311+
minimatch@5.0.1:
312+
version "5.0.1"
313+
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b"
314+
integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==
315+
dependencies:
316+
brace-expansion "^2.0.1"
317+
318+
minimatch@^3.0.4:
315319
version "3.0.4"
316320
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
317321
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
318322
dependencies:
319323
brace-expansion "^1.1.7"
320324

321-
mocha@9.2.1:
322-
version "9.2.1"
323-
resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.2.1.tgz#a1abb675aa9a8490798503af57e8782a78f1338e"
324-
integrity sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==
325+
mocha@10.0.0:
326+
version "10.0.0"
327+
resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.0.0.tgz#205447d8993ec755335c4b13deba3d3a13c4def9"
328+
integrity sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==
325329
dependencies:
326330
"@ungap/promise-all-settled" "1.1.2"
327331
ansi-colors "4.1.1"
328332
browser-stdout "1.3.1"
329333
chokidar "3.5.3"
330-
debug "4.3.3"
334+
debug "4.3.4"
331335
diff "5.0.0"
332336
escape-string-regexp "4.0.0"
333337
find-up "5.0.0"
334338
glob "7.2.0"
335-
growl "1.10.5"
336339
he "1.2.0"
337340
js-yaml "4.1.0"
338341
log-symbols "4.1.0"
339-
minimatch "3.0.4"
342+
minimatch "5.0.1"
340343
ms "2.1.3"
341-
nanoid "3.2.0"
344+
nanoid "3.3.3"
342345
serialize-javascript "6.0.0"
343346
strip-json-comments "3.1.1"
344347
supports-color "8.1.1"
345-
which "2.0.2"
346-
workerpool "6.2.0"
348+
workerpool "6.2.1"
347349
yargs "16.2.0"
348350
yargs-parser "20.2.4"
349351
yargs-unparser "2.0.0"
@@ -358,10 +360,10 @@ ms@2.1.3:
358360
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
359361
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
360362

361-
nanoid@3.2.0:
362-
version "3.2.0"
363-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c"
364-
integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==
363+
nanoid@3.3.3:
364+
version "3.3.3"
365+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25"
366+
integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==
365367

366368
normalize-path@^3.0.0, normalize-path@~3.0.0:
367369
version "3.0.0"
@@ -490,17 +492,10 @@ to-regex-range@^5.0.1:
490492
dependencies:
491493
is-number "^7.0.0"
492494

493-
which@2.0.2:
494-
version "2.0.2"
495-
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
496-
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
497-
dependencies:
498-
isexe "^2.0.0"
499-
500-
workerpool@6.2.0:
501-
version "6.2.0"
502-
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b"
503-
integrity sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==
495+
workerpool@6.2.1:
496+
version "6.2.1"
497+
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
498+
integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==
504499

505500
wrap-ansi@^7.0.0:
506501
version "7.0.0"

0 commit comments

Comments
 (0)