Skip to content

v0.13.0 (Async/Await)

Compare
Choose a tag to compare
@adam-fowler adam-fowler released this 21 Sep 09:15
· 306 commits to main since this release

Breaking changes

  • HBRequest and HBResponse have been changed from classes to structs. This is in a bid to reduce race conditions during async calls. This will impact any code where you are mutating either of these, but should make it clearer where edits are being made.
  • bodyCollation parameter in route handler functions has been changed into a set of options which include .streamBody.
  • Added option .editResponse which indicates you are going to edit a route response via HBRequest.response. Not setting this will cause a crash.

Minor release changes

  • Added support for async/await in Swift 5.5
    • Added async route handlers
    • Added HBAsyncMiddleware protocol
    • Added HBAsyncRouteHandler for async versions of HBRouteHandler
    • Added async versions of persist framework functions.
  • Added HBApplication.Configuration.with() to generate new configuration with edited change.
  • XCT test framework binds to port zero by default.

Patch release changes

  • Add more informative messaging for when an extension doesn’t exist.
  • HBRequest.cookies returns a temporary object instead of caching the cookies in an ‘HBRequest` extension.
  • Replace import NIO with NIOCore or NIOPosix where applicable.