Supports ZIO v2.0.0-RC2
Highlights
-
Websocket Client Support
val url = "ws://localhost:8090/subscriptions" val app = Socket .collect[WebSocketFrame] { case WebSocketFrame.Text("BAZ") => ZStream.succeed(WebSocketFrame.close(1000)) case frame => ZStream.succeed(frame) } .toSocketApp .connect(url) // creates a socket connection on the provided URL
💥 Breaking Changes
-
Rename
ClientParams
toClientRequest
final case class ClientRequest( method: Method, url: URL, getHeaders: Headers = Headers.empty, data: HttpData = HttpData.empty, private val channelContext: ChannelHandlerContext = null, ) extends HeaderExtension[ClientRequest]
-
Drop
toZIO
andwrapZIO
APIsprivate val app = Http.collectZIO[Request] { case Method.GET -> !! / "greet" / name => UIO(Response.text(s"Greetings ${name}!")) }
-
Rename
asString
toencode
inScheme
sealed trait Scheme { self => def encode: String = Scheme.asString(self) }
-
Rename
getHeaders
toheaders
inClientRequest
final case class ClientRequest( method: Method, url: URL, headers: Headers = Headers.empty, data: HttpData = HttpData.empty, private val channelContext: ChannelHandlerContext = null, )
-
Remove
get
prefix from Public APIsPrevious Current getBodyAsByteBuf
bodyAsByteBuf
getBodyAsString
bodyAsString
getBody
body
getHeaders
headers
getStatus
status
getStatus
status
-
Rename
asString
toencode
inURL
def encode: String = ...
-
silent
is removed fromHttp
andHttpApp
Changes
🚀 Features
- Feature: WebSocket Client Support @tusharmath (#933)
- Feature: Url add
isAbsolute
andisRelative
operators @tusharmath (#946) - Feature: Add
Http.apply
@tusharmath (#949) - Feature: Add builder pattern for URL @beem812 (#930)
- Feature: Add
toHttp
to Response @tusharmath (#903) - Feature: Add
toHttp
to Socket.scala @tusharmath (#902) - Feature: Add
Socket.empty
@tusharmath (#901) - Feature: Add
echo
operator toSocket
@tusharmath (#900) - Feature: Add
collectManaged
to Http @beem812 (#909) - Feature: Add
Version
@tusharmath (#965) - Feature: Signed Cookie by @ShrutiVerma97 (#751)
- Feature: API to modify headers by @ShrutiVerma97 (#824)
- Feature: Add host in client from absolute URL @kaushik143 (#847)
🐛 Bug Fixes
- Fix: Add host and port hint in client ssl context @amitksingh1490 (#952)
- Fix: Server KeepAlive true by default and enable client to set Http version on requests @sumawa (#792)
- Fix: EncodeClientParams @ShrutiVerma97 (#868)
- Fix: Add host in client from absolute URL @kaushik143 (#847)
🧰 Maintenance
- Refactor: Remove sealed modifier from Middleware trait @tusharmath (#984)
- Refactor: Remove declarative API from Middlewares @tusharmath (#957)
- Refactor: Drop
toZIO
andwrapZIO
APIs @tusharmath (#950) - Refactor: HttpRunnableSpec clean up @tusharmath (#857)
- Refactor: Rename
getHeaders
toheaders
inClientRequest
@tusharmath (#928) - Refactor: Use declarative encoding for http.middleware @brendo-m (#869)
- Refactor: Rename
asString
toencode
inURI
@tusharmath (#898) - Refactor: Rename
asString
toencode
inPath
@tusharmath (#927) - Refactor: Rename
asString
toencode
inScheme
@tusharmath (#905) - Refactor: Rename
ClientParams
toClientRequest
@tusharmath (#856) - Remove
get
prefix from Public APIs @tusharmath (#958) - Refactor: Drop
CanBeSilent
type-constraint from Http @tusharmath (#964) - Performance: Improve performance server performance when closing connections @tusharmath (#882)
- Test: Added Integration tests for
HExit.Success
@zsfVishnu-d11 (#852) - Update scalafmt-core to 3.4.2 @amitksingh1490 (#961)
- Update scala3-library to 3.1.1 @amitksingh1490 (#873)
- Update netty-all to 4.1.74.Final @scala-steward (#982)
- Update sbt-updates to 0.6.2 @scala-steward (#966)
- Update netty-incubator-transport-native-io_uring to 0.0.12.Final @scala-steward (#908)
- Update sbt to 1.6.2 @scala-steward (#931)
- Update zio to 2.0.0-RC2 by @adamgfraser (#942 )
New Contributors
- @adamgfraser made their first contribution (#942)
Full Changelog: v2.0.0-RC2...v2.0.0-RC3