Skip to content

Commit f0a6546

Browse files
authored
Merge pull request #971 from Kotlin/version-1.0.0-RC
Version 1.0.0-RC
2 parents 7b64cc7 + fbf59d2 commit f0a6546

File tree

501 files changed

+23654
-12635
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

501 files changed

+23654
-12635
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.DS_Store
22

33
# IntelliJ files
4-
.idea/
4+
**/.idea/*
5+
!/.idea/vcs.xml
56
out/
67
*.iml
78

.idea/vcs.xml

+23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+126
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,129 @@
1+
1.0.0-RC / 2020-08-17
2+
==================
3+
4+
Release candidate for 1.0.0 version. The goal of RC release is to collect feedback from users
5+
and provide 1.0.0 release with bug fixes and improvements based on that feedback.
6+
7+
While working on 1.0.0 version, we carefully examined every public API declaration of the library and
8+
split it to stable API, that we promise to be source and binary-compatible,
9+
and experimental API, that may be changed in the future.
10+
Experimental API is annotated with `@ExperimentalSerializationApi` annotation, which requires opt-in.
11+
For a more detailed description of the guarantees, please refer to the [compatibility guide](docs/compatibility.md).
12+
13+
The id of the core artifact with `@Serializable` annotation and `Json` format was changed
14+
from `kotlinx-serialization-runtime` to `kotlinx-serialization-core` to be more clear and aligned with other kotlinx libraries.
15+
16+
A significant part of the public API was renamed or extracted to a separate package.
17+
To migrate from the previous versions of the library, please refer to the [migration guide](docs/migration.md).
18+
19+
### API changes
20+
21+
#### Json
22+
23+
* Core API changes
24+
* `stringify` and `parse` are renamed to `encodeToString` and `decodeToString`
25+
* `parseJson` and `fromJson` are renamed to `parseJsonElement` and `decodeFromJsonElement`
26+
* Reified versions of methods are extracted to extensions
27+
28+
* `Json` constructor is replaced with `Json {}` builder function, `JsonConfiguration` is deprecated in favor
29+
of `Json {}` builder
30+
* All default `Json` implementations are removed
31+
* `Json` companion object extends `Json`
32+
33+
* Json configuration
34+
* `prettyPrintIndent` allows only whitespaces
35+
* `serializeSpecialFloatingPointValues` is renamed to `allowSpecialFloatingPointValues`. It now affects both serialization and deserialization behaviour
36+
* `unquoted` JSON flag is deprecated for removal
37+
* New `coerceInputValues` option for null-defaults and unknown enums (#90, #246)
38+
39+
* Simplification of `JsonElement` API
40+
* Redundant members of `JsonElement` API are deprecated or extracted to extensions
41+
* Potential error-prone API is removed
42+
* `JsonLiteral` is deprecated in favor of `JsonPrimitive` constructors with nullable parameter
43+
44+
* `JsonElement` builders rework to be aligned with stdlib collection builders (#418, #627)
45+
* Deprecated infix `to` and unaryPlus in JSON DSL in favor of `put`/`add` functions
46+
* `jsonObject {}` and `json {}` builders are renamed to `buildJsonObject {}` and `buildJsonArray {}`
47+
* Make all builders `inline` (#703)
48+
49+
* JavaScript support
50+
* `DynamicObjectParser` is deprecated in the favor of `Json.decodeFromDynamic` extension functions
51+
* `Json.encodeToDynamic` extension is added as a counterpart to `Json.decodeFromDynamic` (former `DynamicObjectParser`) (#116)
52+
53+
* Other API changes:
54+
* `JsonInput` and `JsonOutput` are renamed to `JsonEncoder` and `JsonDecoder`
55+
* Methods in `JsonTransformingSerializer` are renamed to `transformSerialize` and `transformDeserialize`
56+
* `JsonParametricSerializer` is renamed to `JsonContentPolymorphicSerializer`
57+
* `JsonEncodingException` and `JsonDecodingException` are made internal
58+
59+
* Bug fixes
60+
* `IllegalStateException` when `null` occurs in JSON input in the place of an expected non-null object (#816)
61+
* java.util.NoSuchElementException when deserializing twice from the same JsonElement (#807)
62+
63+
#### Core API for format authoring
64+
65+
* The new naming scheme for `SerialFormats`
66+
* Core functions in `StringFormat` and `BinaryFormat` are renamed and now follow the same naming scheme
67+
* `stringify`/`parse` are renamed to `encodeToString`/`decodeToString`
68+
* `encodeToByteArray`/`encodeToHexString`/`decodeFromByteArray`/`decodeFromHexString` in `BinaryFormat` are introduced instead of `dump`/`dumps`/`load`/`loads`
69+
70+
* New format instances building convention
71+
* Constructors replaced with builder-function with the same name to have the ability to add new configuration parameters,
72+
while preserving both source and binary compatibility
73+
* Format's companion objects now extend format class and can be used interchangeably
74+
75+
* SerialDescriptor-related API
76+
* `SerialDescriptor` and `SerialKind` are moved to a separate `kotlinx.serialization.descriptors` package
77+
* `ENUM` and `CONTEXTUAL` kinds now extend `SerialKind` directly
78+
* `PrimitiveDescriptor` is renamed to `PrimitiveSerialDescriptor`
79+
* Provide specific `buildClassSerialDescriptor` to use with classes' custom serializers, creating other kinds is considered experimental for now
80+
* Replace extensions that returned lists (e.g. `elementDescriptors`) with properties that return iterable as an optimization
81+
* `IndexOutOfBoundsException` in `descriptor.getElementDescriptor(index)` for `List` after upgrade to 0.20.0 is fixed (#739)
82+
83+
* SerializersModule-related API
84+
* `SerialModule` is renamed to `SerializersModule`
85+
* `SerialModuleCollector` is renamed to `SerializersModuleCollector`
86+
* All builders renamed to be aligned with a single naming scheme (e.g. `SerializersModule {}` DSL)
87+
* Deprecate infix `with` in polymorphic builder in favor of subclass()
88+
* Helper-like API is extracted to extension functions where possible.
89+
* `polymorphicDefault` API for cases when type discriminator is not registered or absent (#902)
90+
91+
* Contextual serialization
92+
* `@ContextualSerialization` is split into two annotations: `@Contextual` to use on properties and `@UseContextualSerialization` to use on file
93+
* New `SerialDescriptor.capturedKClass` API to introspect SerializersModule-based contextual and polymorphic kinds (#515, #595)
94+
95+
* Encoding-related API
96+
* Encoding-related classes (`Encoder`, `Decoder`, `AbstractEncoder`, `AbstractDecoder`) are moved to a separate `kotlinx.serialization.encoding` package
97+
* Deprecated `typeParameters` argument in `beginStructure`/`beginCollectio`n methods
98+
* Deprecated `updateSerializableValue` and similar methods and `UpdateMode` enum
99+
* Renamed `READ_DONE` to `DECODE_DONE`
100+
* Make extensions `inline` where applicable
101+
* `kotlinx.io` mockery (`InputStream`, `ByteArrayInput`, etc) is removed
102+
103+
* Serializer-related API
104+
* `UnitSerializer` is replaced with `Unit.serializer()`
105+
* All methods for serializers retrieval are renamed to `serializer`
106+
* Context is used as a fallback in `serializer` by KType/Java's Reflect Type functions (#902, #903)
107+
* Deprecated all exceptions except `SerializationException`.
108+
* `@ImplicitReflectionSerializer` is deprecated
109+
* Support of custom serializers for nullable types is added (#824)
110+
111+
#### ProtoBuf
112+
113+
* `ProtoBuf` constructor is replaced with `ProtoBuf {}` builder function
114+
* `ProtoBuf` companion object now extends `ProtoBuf`
115+
* `ProtoId` is renamed to `ProtoNumber`, `ProtoNumberType` to `ProtoIntegerType` to be consistent with ProtoBuf specification
116+
* ProtoBuf performance is significantly (from 2 to 10 times) improved (#216)
117+
* Top-level primitives, classes and objects are supported in ProtoBuf as length-prefixed tagless messages (#93)
118+
* `SerializationException` is thrown instead of `IllegalStateException` on incorrect input (#870)
119+
* `ProtobufDecodingException` is made internal
120+
121+
#### Other formats
122+
* All format constructors are migrated to builder scheme
123+
* Properties serialize and deserialize enums as strings (#818)
124+
* CBOR major type 2 (byte string) support (#842)
125+
* `ConfigParser` is renamed to `Hocon`, `kotlinx-serialization-runtime-configparser` artifact is renamed to `kotlinx-serialization-hocon`
126+
* Do not write/read size of collection into Properties' map (#743)
1127

2128
0.20.0 / 2020-03-04
3129
==================

0 commit comments

Comments
 (0)