Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.0.1
->1.3.1
1.4.2
->1.5.2
Release Notes
Kotlin/kotlinx.serialization
v1.3.1
==================
This release mainly contains bugfixes for 1.3.0 and provides new experimental
Json.decodeToSequence
function.Improvements
Bugfixes
v1.3.0
==================
This release contains all of the cool new features from 1.3.0-RC (see below) as well as minor improvements.
It uses Kotlin 1.5.31 by default.
Bugfixes and improvements
v1.2.2
==================
This release contains various bugfixes, some useful features and important performance improvements.
It also uses Kotlin 1.5.20 as default.
Features
@JsonNames
andcoerceInputValues
inJson.decodeFromDynamic
(#1479)Bugfixes and performance improvements
JsonStringBuilder
slow-path to avoid excessive array-copies for large strings with escape symbols (#1491)JsonDecodingException
instead ofClassCastException
during unexpected null inTreeJsonDecoder
(#1550)serialDescriptor<KType>
in production sources (#1540)DescriptorSchemaCache
in Json thread-local on Native (#1484)v1.2.1
==================
This release mainly contains bugfixes for various issues, including important broken thread-safety and improper encoding.
Features
Bugfixes
v1.2.0
==================
This release has some known critical bugs, so we advise to use 1.2.1 instead.
This release contains a lot of new features and important improvements listed below;
Kotlin 1.5.0 is used as a default compiler and language version.
JSON performance improvements
JSON encoder and decoder were revisited and significantly rewritten,
which lead us to up to 2-3x times speedup in certain cases.
Additional details can be found in the corresponding issues: [1], [2].
Ability to specify alternative names during JSON decoding
The one of the most voted issues is fixed now — it is possible to specify multiple names for one property
using new
@JsonNames
annotation.Unlike
@SerialName
, it only affects JSON decoding, so it is useful when dealing with different versions of the API.We've prepared a documentation for you about it.
JsonConfiguration in public API
JsonConfiguration
is exposed as a property ofJson
instance. You can use it to adjust behavior inyour custom serializers.
Check out more in the corresponding issue and the PR.
Generator for .proto files based on serializable Kotlin classes
Our implementation of Protocol Buffers format uses
@Serializable
Kotlin classes as a source of schema.This is very convenient for Kotlin-to-Kotlin communication, but makes interoperability between languages complicated.
To resolve this issue, we now have a
schema generator that can produce .proto files out of Kotlin classes. Using it, you can keep Kotlin
classes as a source of truth and use traditional protoc compilers for other languages at the same time.
To learn more, check out the documentation for the new
ProtoBufSchemaGenerator
class orvisit the corresponding PR.
Contextual serialization of generic classes
Before 1.2.0, it was impossible to register context serializer for generic class,
because
contextual
function accepted a single serializer.Now it is possible to register a provider — lambda that allows to construct a serializer for generic class
out of its type arguments serializers. See the details in the documentation.
Other features
Bugfixes
v1.1.0
==================
This release contains all features and bugfixes from 1.1.0-RC plus an additional fix for incorrect exception type
(#1325 — Throw
SerializationException
instead ofIllegalStateException
inEnumSerializer
) and uses release version of Kotlin 1.4.30.In the light of JCenter shutdown, starting from 1.1.0-RC and now on,
all new releases of kotlinx.serialization are published directly to Maven Central and therefore are not available in
https://kotlin.bintray.com/kotlinx/
repository.We suggest you to remove
jcenter()
and other kotlin bintray repositories from your buildscripts and to usemavenCentral()
repository instead.Kotlin/kotlinx.coroutines
v1.5.2
Compare Source
onUndeliveredElement
was incorrectly called on a properly received elements on JS (#2826).Dispatchers.Default
on React Native, it now fully relies onsetTimeout
instead of stubprocess.nextTick
. Thanks to @Legion2 (#2843).Mutex
implementation (#2581).Mutex
implementation is made completely lock-free as stated (#2590).v1.5.1
Compare Source
update
,getAndUpdate
, andupdateAndGet
operations ofMutableStateFlow
(#2720).Executor.asCoroutineDispatcher
implementation improvements (#2601):ScheduledExecutorService
, then itsschedule
API is used for time-related coroutine operations.RemoveOnCancelPolicy
is now part of the public contract.Task.asDeferred
andTask.await
that acceptCancellationTokenSource
for bidirectional cancellation (#2527).1.0.3
(#2740).CopyableThrowable
is allowed to modify the exception message during stacktrace recovery (#1931).CoroutineDispatcher.releaseInterceptedContinuation
is now afinal
method (#2785).Handler.asCoroutineDispatcher
now causes the dispatched coroutines to be canceled onDispatchers.IO (#​2778)
.ClassCastException
inreleaseInterceptedContinuation
andIllegalStateException
fromtryReleaseClaimedContinuation
(#2736, #2768).CompletableFuture.asDeferred
when the target future has a long chain of listeners (#2730).CoroutineDispatcher.isDispatchNeeded
are now considered as fatal and are propagated to the caller (#2733).DebugProbesKt
(used in the debugger implementation) are moved fromdebug
tocore
module.v1.5.0
Compare Source
Note that this is a full changelog relative to 1.4.3 version. Changelog relative to 1.5.0-RC can be found in the end.
Channels API
offer
,poll
, andsendBlocking
methods are deprecated, internalreceiveCatching
andonReceiveCatching
removed,receiveOrNull
andonReceiveOrNull
are completely deprecated. Previously deprecatedSendChannel.isFull
declaration is removed. Channel operators deprecated withERROR
are nowHIDDEN
.receiveCatching
,onReceiveCatching
trySend
,tryReceive
, andtrySendBlocking
along with the new result typeChannelResult
are introduced. They provide better type safety, are less error-prone, and have a consistent future-proof naming scheme. The full rationale behind this change can be found here.BroadcastChannel
andConflatedBroadcastChannel
are marked asObsoleteCoroutinesApi
in the favor orSharedFlow
andStateFlow
. The migration scheme can be found in their documentation. These classes will be deprecated in the next major release.callbackFlow
andchannelFlow
are promoted to stable API.Reactive integrations
kotlinx-coroutines-rx2
,kotlinx-coroutines-rx3
,kotlinx-coroutines-reactive
,kotlinx-coroutines-reactor
, andkotlinx-coroutines-jdk9
were revisited and promoted to stable (#2545).publish
is no longer allowed to emitnull
values (#2646).awaitSingleOr*
functions onPublisher
type are deprecated (#2591).MaybeSource.await
is deprecated in the favor ofawaitSingle
, additional lint functions forMono
are added in order to prevent ambiguousPublisher
usages (#2628, #1587).ContextView
support inkotlinx-coroutines-reactor
(#2575).MaybeSource.collect
andMaybe.collect
properly finish when they are completed without a value (#2617).Other improvements
Flow.last
andFlow.lastOrNull
operators (#2246).Flow.runningFold
operator (#2641).CoroutinesTimeout
rule for JUnit5 (#2197).Job
andAbstractCoroutine
was reworked, resulting in smaller code size, less memory footprint, and better performance (#2513, #2512).CancellationException
from Kotlin standard library is used for cancellation on Koltin/JS and Kotlin/Native (#2638).DelicateCoroutinesApi
annotation that warns users about potential target API pitfalls and suggests studying API's documentation first. The only delicate API right now isGlobalScope
(#2637).1.4.3
whenkotlinx-coroutines-core.jar
triggered IDEA debugger failure (#2619).ChildHandlerNode
with reusable continuations (#2564).Changelog relative to version 1.5.0-RC
emitAll
called from cancelledonCompletion
operator (#2700).stateIn
/shareIn
keep strong reference to sharing job (#2557).TimeSource
toAbstractTimeSource
due to import issues (#2691).watchosX64
target support for Kotlin/Native (#2524).v1.4.3
Compare Source
General changes
ThreadContextElement
(#985)ThreadContextElement
s are now restored in the opposite order from update (#2195)kotlinx-coroutines-reactor
to3.4.1
, thanks to @sokomishalov (#2432)callInPlace
contract added toReceiveChannel.consume
(#941)CoroutineStart.UNDISPATCHED
promoted to stable API (#1393)kotlinx.coroutines
are now released directly to MavenCentralDispatchedCoroutine
by a fieldTimeSource
renamed toSchedulerTimeSource
to prevent wildcard import issues (#2537)Bug fixes
Job
interface (#2423)await
/asDeferred
forMinimalStage
implementations in jdk8 module (#2456)onUndeliveredElement
wasn't called for unlimited channels (#2435)ListenableFuture.isCancelled
returned fromasListenableFuture
could have thrown an exception, thanks to @vadimsemenov (#2421)callbackFlow
andproduce
is properly cancelled when the channel was closed separately (#2506)Configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.