Releases: zio/zio-http
v2.0.0-RC8 - ZIO 2 Support
Changes
Supports ZIO v2.0.0-RC6
Breaking Changes
- Refactor: Drop Endpoint API @tusharmath (#1264)
- Refactor: Client.socket now returns a ZManaged @tusharmath (#1259)
- Refactor: drop Http.route @tusharmath (#1271)
- Fix: Middleware type issues @tusharmath (#1269)
🚀 Features
- Feature: Add
request
method onClient
aspublic
@qboileau (#1247) - Feature: Add
merge
operator inHttp
@tusharmath (#1232) - Feature: added option to modify server bootstrap @zsfVishnu (#1210)
- Feature: add
delay
&tap
operator to Socket @tusharmath (#1157) - Feature: added option to modify server bootstrap @zsfVishnu (#1210)
- Feature: Add
empty
andallow
constructors toMiddleware
@ex0ns (#1251)
Improvements
- Refactor: rename property in
Server.Config
@tusharmath (#1243) - Refactor: move logic to ServerResponseWriter @tusharmath (#1223)
- Refactor: Drop
Endpoint
API @tusharmath (#1264) - Refactor: Client.socket now returns a
ZManaged
@tusharmath (#1259) - Refactor: ServerResponseHandler @ShrutiVerma97 (#1198)
- Refactor: move logic to ServerResponseWriter @tusharmath (#1223)
- Refactor: drop
Http.route
@tusharmath (#1271) - Performance: Improve Scheme.decode performance @ShrutiVerma97 (#1107)
- Refactor: Re-write
Path
usingVector
@gciuloaica (#1260)
🐛 Bug Fixes
- Fix: Request Streaming back pressure @gciuloaica (#1188)
- Fix: Use
zExec.unsafeRunUninterruptible
where appropriate @Dennis4b (#1253) - Fix: Echo
HttpData
directly fromRequest
@tusharmath (#1244) - Fix: Request Streaming @tusharmath (#1242)
- Fix: Handle on-close interruption in websocket @amitksingh1490 (#1156)
- Fix: Middleware type issues @tusharmath (#1269)
🧰 Maintenance
- Chore: Remove unnecessary dependencies @tusharmath (#1255)
- Update netty-incubator-transport-native-io_uring to 0.0.14.Final @amitksingh1490 (#1249)
- Chore: Remove unused file @tusharmath (#1258)
- Update sbt-bloop to 1.5.0 @amitksingh1490 (#1224)
- Update scalafmt-core to 3.5.2 @amitksingh1490 (#1218)
- maintenance: bump version in website docs @girdharshubham (#1177)
- Build(deps): Bump minimist from 1.2.5 to 1.2.6 in /docs/website @dependabot (#1172)
- Doc: Added missing period @oliveiosello (#1186)
- Update scalafmt-core to 3.5.0 @scala-steward (#1180)
- Update sbt-scalafix to 0.10.0 @scala-steward (#1192)
- Added workflow for Jmh benchmarks @ShrutiVerma97 (#1135)
- Doc: Getting started doc broken links fixed @ShrutiVerma97 (#1196)
- Update scala3-library to 3.1.2 @amitksingh1490 (#1203)
- Update netty-all to 4.1.76.Final @amitksingh1490 (#1202)
- Update zio, zio-streams, zio-test, ... to 1.0.14 @amitksingh1490 (#1201)
- Feature: Add implicit conversion from
Unit
toHtml
@nartamonov (#1204) - Update: bump version in website docs @girdharshubham (#1177)
- Update scalafmt-core to 3.5.7 @amitksingh1490 (#1273)
- Update sbt-bloop to 1.5.0 @amitksingh1490 (#1224)
- Add client server example @jamesward (#1228)
- Maintenance: Add internal Logging capabilities using
zhttp.log
@gciuloaica (#1115) - Fix: Use
check
instead ofcheckAll
@gciuloaica (#1266) - Doc: Middleware @sumawa (#999)
- Don't depend on scala-collection-compat when using Scala >= 2.13 @jpablo (#1276)
New Contributors
Full Changelog: v2.0.0-RC7...v2.0.0-RC8
v1.0.0.0-RC28
Changes
Breaking Changes
- Refactor: Drop Endpoint API @tusharmath (#1264)
- Refactor: Client.socket now returns a ZManaged @tusharmath (#1259)
- Refactor: drop Http.route @tusharmath (#1271)
- Fix: Middleware type issues @tusharmath (#1269)
🚀 Features
- Feature: Add
request
method onClient
aspublic
@qboileau (#1247) - Feature: Add
merge
operator inHttp
@tusharmath (#1232) - Feature: added option to modify server bootstrap @zsfVishnu (#1210)
- Feature: add
delay
&tap
operator to Socket @tusharmath (#1157) - Feature: added option to modify server bootstrap @zsfVishnu (#1210)
- Feature: Add
empty
andallow
constructors toMiddleware
@ex0ns (#1251)
Improvements
- Refactor: rename property in
Server.Config
@tusharmath (#1243) - Refactor: move logic to ServerResponseWriter @tusharmath (#1223)
- Refactor: Drop
Endpoint
API @tusharmath (#1264) - Refactor: Client.socket now returns a
ZManaged
@tusharmath (#1259) - Refactor: ServerResponseHandler @ShrutiVerma97 (#1198)
- Refactor: move logic to ServerResponseWriter @tusharmath (#1223)
- Refactor: drop
Http.route
@tusharmath (#1271) - Performance: Improve Scheme.decode performance @ShrutiVerma97 (#1107)
- Refactor: Re-write
Path
usingVector
@gciuloaica (#1260)
🐛 Bug Fixes
- Fix: Request Streaming back pressure @gciuloaica (#1188)
- Fix: Use
zExec.unsafeRunUninterruptible
where appropriate @Dennis4b (#1253) - Fix: Echo
HttpData
directly fromRequest
@tusharmath (#1244) - Fix: Request Streaming @tusharmath (#1242)
- Fix: Handle on-close interruption in websocket @amitksingh1490 (#1156)
- Fix: Middleware type issues @tusharmath (#1269)
🧰 Maintenance
- Chore: Remove unnecessary dependencies @tusharmath (#1255)
- Update netty-incubator-transport-native-io_uring to 0.0.14.Final @amitksingh1490 (#1249)
- Chore: Remove unused file @tusharmath (#1258)
- Update sbt-bloop to 1.5.0 @amitksingh1490 (#1224)
- Update scalafmt-core to 3.5.2 @amitksingh1490 (#1218)
- maintenance: bump version in website docs @girdharshubham (#1177)
- Build(deps): Bump minimist from 1.2.5 to 1.2.6 in /docs/website @dependabot (#1172)
- Doc: Added missing period @oliveiosello (#1186)
- Update scalafmt-core to 3.5.0 @scala-steward (#1180)
- Update sbt-scalafix to 0.10.0 @scala-steward (#1192)
- Added workflow for Jmh benchmarks @ShrutiVerma97 (#1135)
- Doc: Getting started doc broken links fixed @ShrutiVerma97 (#1196)
- Update scala3-library to 3.1.2 @amitksingh1490 (#1203)
- Update netty-all to 4.1.76.Final @amitksingh1490 (#1202)
- Update zio, zio-streams, zio-test, ... to 1.0.14 @amitksingh1490 (#1201)
- Feature: Add implicit conversion from
Unit
toHtml
@nartamonov (#1204) - Update: bump version in website docs @girdharshubham (#1177)
- Update scalafmt-core to 3.5.7 @amitksingh1490 (#1273)
- Update sbt-bloop to 1.5.0 @amitksingh1490 (#1224)
- Add client server example @jamesward (#1228)
- Maintenance: Add internal Logging capabilities using
zhttp.log
@gciuloaica (#1115) - Fix: Use
check
instead ofcheckAll
@gciuloaica (#1266) - Doc: Middleware @sumawa (#999)
- Don't depend on scala-collection-compat when using Scala >= 2.13 @jpablo (#1276)
New Contributors
- @oliveiosello made their first contribution in #1186
- @zsfVishnu made their first contribution in #1210
- @qboileau made their first contribution in #1247
- @Dennis4b made their first contribution in #1253
Full Changelog: v1.0.0.0-RC27...v1.0.0.0-RC28
v2.0.0-RC7 - ZIO 2 Support
What's Changed
Supports ZIO v2.0.0-RC5
- Merge main into zio-series/2.x by @kitlangton in #1189
- Upgrade to ZIO 2.0.0-RC5 by @adamgfraser in #1194
Full Changelog: v2.0.0-RC6...v2.0.0-RC7
v2.0.0-RC6 ZIO 2 Support
What's Changed
Supports ZIO v2.0.0-RC4
Maintenance
- Upgrade To ZIO 2.0.0-RC4 @adamgfraser #1178
Full Changelog: v2.0.0-RC5...v2.0.0-RC6
v2.0.0-RC5 - ZIO 2 Support
What's Changed
Supports ZIO v2.0.0-RC3
Highlights
Request Streaming
private val app = Http.collect[Request] {
case req @ Method.POST -> !! / "echo" =>
Response(data = HttpData.fromStream(req.bodyAsStream))
}
💥 Breaking Changes
Http.Status
names to Camel Case
Status.OK
->Status.Ok
Http.getResource
consistent withZStream.fromResource
val httpApp = Http.fromResource("TestFile.js")
- Client and Server Request merged
val clientRequest = Request(url = url, method = Method.GET, headers = headers )
Version
added in the Requestval req = Request(Version.`HTTP/1.1`, Method.GET, URL(!!))
🚀 Features
- Feature: Bearer auth middleware @dinojohn (#1097)
- Feature: Support Custom statuses code @gciuloaica (#1121)
- Feature: Add
version
toRequest
@amitksingh1490 (#1094) - Feature: Introduced defect channel for
Http
@nartamonov (#1083) - Feature: Request Streaming @amitksingh1490 (#1048)
- Feature: Added helper checkers to
Status
class @rleibman (#1058) - Feature: Server Request Decompression @girdharshubham (#1095)
- Feature: Effectful Auth Middleware @dinojohn (#1079)
- Feature: Add
when
operator inHttp
@ShrutiVerma97 (#1078) - Feature: Added new constructor in http @ShrutiVerma97 (#1077)
- Feature: Add more useful toString method for Request @nartamonov (#995)
- Feature: Add middleware.codecHttp @tusharmath (#1141)
- Feature: Add narrow operator to http @tusharmath (#1161)
- Feature: Add toHttp method to Response @tusharmath (#1160)
- Enhancement: Added combine operator @ShrutiVerma97 (#1106)
- Enhancement: Merge server and client Responses @amitksingh1490 (#1111)
🔨 Improvements
- Refactor: Make
Http.getResource
consistent withZStream.fromResource
@guizmaii (#1113) - Refactor: Http.Status names to Camel Case @tusharmath (#1129)
- Refactor: Merge client and server
Request
@amitksingh1490 (#1125) - Refactor: Server Settings Support in
HttpRunnableSpec#serve
@girdharshubham (#1053) - Refactor: Website docs sidebar pages repositioned @girdharshubham (#1049)
- Refactor: Merge client and server
Request
@amitksingh1490 (#1125) - Refactor:
Request
andResponse
to extendHttpDataExtension
@amitksingh1490 (#1112) - Refactor: DynamicServer is not bound to HttpEnv only @tusharmath (#1159)
- Refactor: Added lift in PartialCollect @ShrutiVerma97 (#1105)
- Refactor: Added lift in PartialCollect @ShrutiVerma97 (#1105)
- Performance: Improve HttpData toByteBuf @tusharmath @amitksingh1490 (#1137)
- Performance: Use CharSequence wherever possible @tusharmath (#1142)
🐛 Bug Fixes
- Fix: Fix request scala doc @kaushik143 (#1138)
- Fix:
toByteBuf
for streamed HttpData @ex0ns (#1118) - Fix: Capture synchronous defects inside Handler @dinojohn (#1099)
- Fix: Handle HttpClient Interruption on connection close @gciuloaica (#1039)
- Fix: Socket.end implementation @tusharmath (#1158)
- Fix: toHttp FromASCIIString by @amitksingh1490 in (#1176)
🧰 Maintenance
- Test: Removed flatten from test @ShrutiVerma97 (#1109)
- Example: More secure string compare for login @MasseGuillaume (#1120)
- Website: Rename getBodyAsString => bodyAsString in doc @MasseGuillaume (#1124)
- Website: New chapter: efficient development process @DaniRey (#1145)
- Website: Restop @DaniRey (#1146)
- Update netty-incubator-transport-native-io_uring to 0.0.13.Final @scala-steward (#1133)
- Update netty-all to 4.1.75.Final @scala-steward (#1130)
- Update scala-collection-compat to 2.7.0 @scala-steward (#1154)
- Update jwt-core to 9.0.5 @scala-steward (#1150)
- Update sbt-scala3-migrate to 0.5.1 @scala-steward (#1163)
- Upgrade to ZIO 2.0.0-RC3 by @adamgfraser in (#1152 , #1174 )
New Contributors
- @rleibman made their first contribution in #1058
- @ex0ns made their first contribution in #1118
- @MasseGuillaume made their first contribution in #1120
- @nartamonov made their first contribution in #1083
- @guizmaii made their first contribution in #1113
- @DaniRey made their first contribution in #1145
Full Changelog: v2.0.0-RC4...v2.0.0-RC5
v1.0.0.0-RC27
Changes
Bugfix
- Fix: update implementation of
FromAsciiString.encode
by @tusharmath (#1175 )
Full Changelog: v1.0.0.0-RC26...v1.0.0.0-RC27
v1.0.0.0-RC26
Changes
Highlights
Request Streaming
private val app = Http.collect[Request] {
case req @ Method.POST -> !! / "echo" =>
Response(data = HttpData.fromStream(req.bodyAsStream))
}
💥 Breaking Changes
Http.Status
names to Camel Case
Status.OK
->Status.Ok
Http.getResource
consistent withZStream.fromResource
val httpApp = Http.fromResource("TestFile.js")
- Client and Server Request merged
val clientRequest = Request(url = url, method = Method.GET, headers = headers )
Version
added in the Requestval req = Request(Version.`HTTP/1.1`, Method.GET, URL(!!))
🚀 Features
- Feature: Bearer auth middleware @dinojohn (#1097)
- Feature: Support Custom statuses code @gciuloaica (#1121)
- Feature: Add
version
toRequest
@amitksingh1490 (#1094) - Feature: Introduced defect channel for
Http
@nartamonov (#1083) - Feature: Request Streaming @amitksingh1490 (#1048)
- Feature: Added helper checkers to
Status
class @rleibman (#1058) - Feature: Server Request Decompression @girdharshubham (#1095)
- Feature: Effectful Auth Middleware @dinojohn (#1079)
- Feature: Add
when
operator inHttp
@ShrutiVerma97 (#1078) - Feature: Added new constructor in http @ShrutiVerma97 (#1077)
- Feature: Add more useful toString method for Request @nartamonov (#995)
- Feature: Add middleware.codecHttp @tusharmath (#1141)
- Feature: Add narrow operator to http @tusharmath (#1161)
- Feature: Add toHttp method to Response @tusharmath (#1160)
- Enhancement: Added combine operator @ShrutiVerma97 (#1106)
- Enhancement: Merge server and client Responses @amitksingh1490 (#1111)
🔨 Improvements
- Refactor: Make
Http.getResource
consistent withZStream.fromResource
@guizmaii (#1113) - Refactor: Http.Status names to Camel Case @tusharmath (#1129)
- Refactor: Merge client and server
Request
@amitksingh1490 (#1125) - Refactor: Server Settings Support in
HttpRunnableSpec#serve
@girdharshubham (#1053) - Refactor: Website docs sidebar pages repositioned @girdharshubham (#1049)
- Refactor: Merge client and server
Request
@amitksingh1490 (#1125) - Refactor:
Request
andResponse
to extendHttpDataExtension
@amitksingh1490 (#1112) - Refactor: DynamicServer is not bound to HttpEnv only @tusharmath (#1159)
- Refactor: Added lift in PartialCollect @ShrutiVerma97 (#1105)
- Refactor: Added lift in PartialCollect @ShrutiVerma97 (#1105)
- Performance: Improve HttpData toByteBuf @tusharmath @amitksingh1490 (#1137)
- Performance: Use CharSequence wherever possible @tusharmath (#1142)
🐛 Bug Fixes
- Fix: Fix request scala doc @kaushik143 (#1138)
- Fix:
toByteBuf
for streamed HttpData @ex0ns (#1118) - Fix: Capture synchronous defects inside Handler @dinojohn (#1099)
- Fix: Handle HttpClient Interruption on connection close @gciuloaica (#1039)
- Fix: Socket.end implementation @tusharmath (#1158)
🧰 Maintenance
- Test: Removed flatten from test @ShrutiVerma97 (#1109)
- Example: More secure string compare for login @MasseGuillaume (#1120)
- Website: Rename getBodyAsString => bodyAsString in doc @MasseGuillaume (#1124)
- Website: New chapter: efficient development process @DaniRey (#1145)
- Website: Restop @DaniRey (#1146)
- Update netty-incubator-transport-native-io_uring to 0.0.13.Final @scala-steward (#1133)
- Update netty-all to 4.1.75.Final @scala-steward (#1130)
- Update scala-collection-compat to 2.7.0 @scala-steward (#1154)
- Update jwt-core to 9.0.5 @scala-steward (#1150)
- Update sbt-scala3-migrate to 0.5.1 @scala-steward (#1163)
New Contributors
- @rleibman made their first contribution in #1058
- @ex0ns made their first contribution in #1118
- @MasseGuillaume made their first contribution in #1120
- @nartamonov made their first contribution in #1083
- @guizmaii made their first contribution in #1113
- @DaniRey made their first contribution in #1145
Full Changelog: v1.0.0.0-RC25...v1.0.0.0-RC26
v2.0.0-RC4 - ZIO 2 Support
Supports ZIO v2.0.0-RC2
Highlights
-
Support for Static Server
ZIO-HTTP now provides support for building static servers with a very simple DSL.// A simple app to serve static resource files from a local directory. val app = Http.collectHttp[Request] { case Method.GET -> "static" /: path => for { file <- Http.getResourceAsFile(path.encode) http <- // Rendering a custom UI to list all the files in the directory if (file.isDirectory) { // Accessing the files in the directory val files = file.listFiles.toList.sortBy(_.getName) val base = "/static" val rest = path.dropLast(1) // Custom UI to list all the files in the directory Http.template(s"File Explorer ~$base${path}") { ul( li(a(href := s"$base$rest", "..")), files.map { file => li( a( href := s"$base${path.encode}${if (path.isEnd) file.getName else "/" + file.getName}", file.getName, ), ) }, ) } } // Return the file if it's a static resource else if (file.isFile) Http.fromFile(file) // Return a 404 if the file doesn't exist else Http.empty } yield http }
-
New
Http.attempt
operator
Attempts to create an Http that succeeds with the provided value, capturing all exceptions on it's way.val app = Http.attempt(throw throwable).execute(())
💥 Breaking Changes
- Rename
provide
andprovideSome
inHttp
andSocket
domainsPrevious Current provide
provideEnvironment
provideSome
provideSomeEnvironment
🚀 Features
- Feature: Static Server @tusharmath (#1061)
- Feature: Support custom
ChannelInitializer
@rajcspsg (#932) - Feature: add
ifModifiedSinceDecoded
@tusharmath (#1075) - Feature: add
getResource
andgetResourceAsFile
operators on Http @tusharmath (#1074) - Feature: add
Http.attempt
operator @tusharmath (#1070) - Feature: add
withMediaType
operator inHeaderModifier
@tusharmath (#1071) - Feature: add
foldCause
to HttpError @tusharmath (#1066) - Feature: add
code
method on Status @tusharmath (#1068) - Feature: add
dropLast
to Path @tusharmath (#1065) - Feature: Add
data
inRequest
trait @amitksingh1490 (#1017) - Feature: add
Http.fromResource
@tusharmath (#1009) - Feature: add
fromFileZIO
@tusharmath (#1010) - Feature: Http from HExit @dinojohn (#986)
- Feature:
Content-Type
should be set using a custom MimeDB @ashprakasan (#899) - Feature:
Response.html
support taking in aStatus
@tusharmath (#1067)
Improvements
- Refactor: Remove tuple from ResponseHandler @amitksingh1490 (#1033)
- Refactor: Content Type Fixes @tusharmath (#1008)
- Refactor:
fromFile
usesfromFileZIO
@tusharmath (#1011) - Refactor: Tail recursive path encode method @ShrutiVerma97 (#1035)
- Refactor: Remove Collect and FromFunctionZIO @dinojohn (#1002)
- Refactor: rename
provide
andprovideSome
@girdharshubham (#996) - Performance: Use
CharSequence
for ServerTime @tusharmath (#1064)
🐛 Bug Fixes
- Fix: type info of
Http.response
@tusharmath (#1073) - Fix: Releasing request twice @dinojohn (#1046)
- Fix: Binary WebSocketFrame @girdharshubham (#1005)
🧰 Maintenance
- Maintenance: run scalafmt once @girdharshubham (#1027)
- Update scalafmt-core to 3.4.3 @amitksingh1490 (#1022)
- Update sbt-bloop to 1.4.13 @amitksingh1490 (#1055)
- Update jwt-core to 9.0.4 @amitksingh1490 (#1056)
Full Changelog: v2.0.0-RC3...v2.0.0-RC4
v1.0.0.0-RC25
Changes
Highlights
-
Support for Static Server
ZIO-HTTP now provides support for building static servers with a very simple DSL.// A simple app to serve static resource files from a local directory. val app = Http.collectHttp[Request] { case Method.GET -> "static" /: path => for { file <- Http.getResourceAsFile(path.encode) http <- // Rendering a custom UI to list all the files in the directory if (file.isDirectory) { // Accessing the files in the directory val files = file.listFiles.toList.sortBy(_.getName) val base = "/static" val rest = path.dropLast(1) // Custom UI to list all the files in the directory Http.template(s"File Explorer ~$base${path}") { ul( li(a(href := s"$base$rest", "..")), files.map { file => li( a( href := s"$base${path.encode}${if (path.isEnd) file.getName else "/" + file.getName}", file.getName, ), ) }, ) } } // Return the file if it's a static resource else if (file.isFile) Http.fromFile(file) // Return a 404 if the file doesn't exist else Http.empty } yield http }
-
New
Http.attempt
operator
Attempts to create an Http that succeeds with the provided value, capturing all exceptions on it's way.val app = Http.attempt(throw throwable).execute(())
💥 Breaking Changes
- Rename
provide
andprovideSome
inHttp
andSocket
domainsPrevious Current provide
provideEnvironment
provideSome
provideSomeEnvironment
🚀 Features
- Feature: Static Server @tusharmath (#1061)
- Feature: Support custom
ChannelInitializer
@rajcspsg (#932) - Feature: add
ifModifiedSinceDecoded
@tusharmath (#1075) - Feature: add
getResource
andgetResourceAsFile
operators on Http @tusharmath (#1074) - Feature: add
Http.attempt
operator @tusharmath (#1070) - Feature: add
withMediaType
operator inHeaderModifier
@tusharmath (#1071) - Feature: add
foldCause
to HttpError @tusharmath (#1066) - Feature: add
code
method on Status @tusharmath (#1068) - Feature: add
dropLast
to Path @tusharmath (#1065) - Feature: Add
data
inRequest
trait @amitksingh1490 (#1017) - Feature: add
Http.fromResource
@tusharmath (#1009) - Feature: add
fromFileZIO
@tusharmath (#1010) - Feature: Http from HExit @dinojohn (#986)
- Feature:
Content-Type
should be set using a custom MimeDB @ashprakasan (#899) - Feature:
Response.html
support taking in aStatus
@tusharmath (#1067)
Improvements
- Refactor: Remove tuple from ResponseHandler @amitksingh1490 (#1033)
- Refactor: Content Type Fixes @tusharmath (#1008)
- Refactor:
fromFile
usesfromFileZIO
@tusharmath (#1011) - Refactor: Tail recursive path encode method @ShrutiVerma97 (#1035)
- Refactor: Remove Collect and FromFunctionZIO @dinojohn (#1002)
- Refactor: rename
provide
andprovideSome
@girdharshubham (#996) - Performance: Use
CharSequence
for ServerTime @tusharmath (#1064)
🐛 Bug Fixes
- Fix: type info of
Http.response
@tusharmath (#1073) - Fix: Releasing request twice @dinojohn (#1046)
- Fix: Binary WebSocketFrame @girdharshubham (#1005)
🧰 Maintenance
- Maintenance: run scalafmt once @girdharshubham (#1027)
- Update scalafmt-core to 3.4.3 @amitksingh1490 (#1022)
- Update sbt-bloop to 1.4.13 @amitksingh1490 (#1055)
- Update jwt-core to 9.0.4 @amitksingh1490 (#1056)
Full Changelog: v1.0.0.0-RC24...v2.0.0
v2.0.0-RC3 - ZIO 2 Support
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