Migrating 0.9.5 → 1.0.0-alpha-1

Estimated reading time: 2 minutes

Changelog

Ktor 1.0.0-alpha-1 is the initial pre-release version that preludes the 1.0. This version is the first one using Kotlin 1.3.0-rc-131, and bumps the kotlinx.coroutines version to 0.30.2-eap13. As an important change, Ktor now uses the structured concurrency from kotlinx.coroutines. In addition it adds

1.0.0-alpha-1

Published 9 Oct 2018

Version Bumps:

  • Kotlin: 1.2.70 -> 1.3.0-rc-131
  • Kotlinx IO: 0.1.0-alpha-4 -> 0.1.0-alpha-17-rc13
  • Kotlinx Coroutines: 0.25.0 -> 0.30.2-eap13
  • Atomic FU: 0.11.3 -> 0.11.10-eap13

Major changes:

Deprecations, renames and API changes:

  • Increased some old deprecations to DeprecationLevel.ERROR
  • Deprecated ByteBufferBuilder
  • Renamed RoutingException -> LocationRoutingException
  • HttpMessageBuilder.contentLength() and HttpMessage.contentLength() now return Long
  • Remove some deprecated and changed to experimental internal APIs. (eg. WebSocketInternalAPI)
  • AndroidClientEngine is now @UseExperimental(InternalAPI::class)
  • Deprecated ApacheBackend typealias for Apache engine

Fixes:

  • Make default call pipeline discard request body content (Fixes #609, #574)
  • Fixes url path encoding
  • Fix server response logging after release
  • Make Cookie.matches ignore a leading dot in the domain

Additions:

Improvements:

  • Unify mimetype + use random from the Kotlin 1.3 stdlib
  • Test Kotlin/Native on MacOS

Minor changes:

  • Some API documentation
  • Add editorconfig for external editors
  • Use kotlin.code.style=official

New coroutines

Since 1.0.0-alpha-1, Ktor is using the latest kotlinx.coroutines version that is using structured concurrency. Now each request has its own CoroutineScope and you can also use the GlobalScope.

For more information: https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/basics.md#structured-concurrency