All Versions
59
Latest Version
Avg Release Cycle
6 days
Latest Release
365 days ago

Changelog History
Page 5

  • v4.1.0 Changes

    April 14, 2020

    🚀 ###### This patch was authored and released by @mcdappdev.

    🏗 Makes Request.route publicly settable (#2315). This makes it easier to build and use custom Responder types.

  • v4.0.2 Changes

    April 14, 2020

    🚀 ###### This patch was authored and released by @tanner0101.

    👌 Improves logic for handling HEAD responses (#2310).

    Previously when HEAD requests were detected, the response body would be replaced with an empty body and the content-length header would be re-added. This caused problems with responses that don't use the content-length header, even for non-HEAD requests.

    🚦 Now, when HEAD requests are detected, the response body is not changed. Instead, a flag is set signaling the serializer to skip serialization of the body.

  • v4.0.1 Changes

    April 09, 2020

    🚀 ###### This patch was authored by @madsodgaard and released by @tanner0101.

    🔄 Changed AsyncPasswordVerifier methods to be non-throwing, since it is async.

  • v4.0.0 Changes

    August 02, 2019
    • ⚡️ Updated to OpenCrypto alpha 2 (#2031)
    • ⚡️ Updated to SSWG's official AsyncHTTPClient package (#2031)
    • 🔀 Merged server and client websocket code into WebSocket (#2031)

      // client return WebSocket.connect( to: "ws://echo.websocket.org/", on: req.eventLoop) { ws in ws.send("Hello, world!") ws.onText { ws, text in promise.succeed(text) ws.close().cascadeFailure(to: promise) } }// serverrouter.webSocket("bar") { req, ws in ws.send("Hello, world!") ws.onText { ws, text in promise.succeed(text) ws.close().cascadeFailure(to: promise) } }

    • BCrypt renamed to Bcrypt and included in Vapor (#2031)

      let hash = try Bcrypt.hash("vapor")print(hash) // $2b$12$Lmw/Zx2jSXgxE.r/8uipROCoh64KdPL7/mdEz38EqEFZDEu5JsAH2try Bcrypt.verify("vapor", created: hash) // truetry Bcrypt.verify("foo", created: hash) // false

  • v4.0.0-rc.3 Changes

    March 06, 2020

    🚀 ###### This patch was authored and released by @tanner0101.

    ⚡️ Updates to SwiftMetrics 2.0 which adds a new case the TimeUnit enum (#2224, fixes #2213).

    🍱 ⚠️ Metrics is no longer @_exported by Vapor. Add import Metrics to any files you use SwiftMetrics in.

  • v4.0.0-rc.2 Changes

    March 06, 2020

    🚀 ###### This patch was authored by @siemensikkema and released by @tanner0101.

    🚚 This is technically a breaking change since some public API is being removed, but it is not being used anywhere.

    • ✂ Remove unused ValidatorType
    • Avoid force unwrap.
    • Avoid illegal count and range operators by not exposing .range() and .count().
  • v4.0.0-rc.1 Changes

    March 01, 2020

    ➕ Adds new configuration options for URLEncodedFormDecoder / Encoder. This includes support for encoding and decoding arrays using brackets, separate values, or character-separated values (#2180, #2204).

    ➕ Adds the ability to use the Content API with XCTVapor's request and response (#2204).

    Brings vapor/multipart-kit into the Vapor module (#2204).

    ⚡️ Updates to Swift 5.2 (#2204).

    📚 > Release candidates represent the final shift toward focusing on bug fixes and documentation. Breaking changes will only be accepted for critical issues. We expect a final release of this package shortly after Swift 5.2's release date.

  • v4.0.0-beta.4 Changes

    February 26, 2020

    🍱 Migrate from Vapor's OpenCrypto library to Apple's new Swift Crypto library. This reduces the burden on Vapor on having to maintain a crypto library and completely removes OpenSSL as a dependency 🎉

    🍎 The downside of this is that Vapor 4 will require macOS 10.15, but the tradeoff is worth it.

  • v4.0.0-beta.3 Changes

    December 14, 2019

    Example output:

    # TYPE http_requests_total counter
    http_requests_total 0
    http_requests_total{status="200", path="GET /hello/:name", method="GET"} 7
    http_requests_total{status="200", path="GET /metrics", method="GET"} 3
    # TYPE http_request_duration_seconds summary
    http_request_duration_seconds{quantile="0.01"} 0.000115894
    http_request_duration_seconds{quantile="0.05"} 0.000115894
    ...
    

    ⚡️ Updates to RoutingKit beta 3 (#2126)

    ClientResponse, HTTPStatus, and HTTPHeaders are now Codable (#2124)

    Environment variables loaded from .env files can now be accessed immediately after Application has initialized (#2125)

    📦 .env (in same folder as Package.swift)

    FOO=BAR
    

    main.swift

    let app = Application(...)defer { app.shutdown() } let foo = Environment.get("FOO") print(foo) // BAR
    
  • v4.0.0-beta.2 Changes

    December 09, 2019
    • ♻️ Services has been refactored to be more type-safe. (#2098)

    Services, Container, and Provider have been replaced by a pattern built on Swift extensions. This is best explained with examples.

    Telling Vapor to use Leaf:

    import Leafimport Vapor// beta.1s.register(ViewRenderer.self) { c inreturn c.make(LeafRenderer.self) }// beta.2app.views.use(.leaf)
    

    Registering a factory service:

    // beta.1s.register(Foo.self) { c inreturn Foo(...) } app.make(Foo.self).bar()// beta.2extension Application { var foo: Foo { return Foo(...) } } app.foo.bar()
    

    Registering a singleton service:

    // beta.1s.register(Foo.self) { c inreturn Foo(...) } app.make(Foo.self).bar = 0app.make(Foo.self).bar += 1print(app.make(Foo.self).bar) // 1// beta.2extension Application { var foo: Foo { if let existing = self.storage[FooKey.self] as? Foo { return existing } else { let new = Foo() self.storage[FooKey.self] = new return new } } private struct FooKey: StorageKey { typealias Value = Foo } } app.foo.bar = 0app.foo.bar += 1print(app.foo.bar) // 1
    

    This new pattern of extending Application also works with Request:

    extension Application { var foo: Foo { ... } }extension Request { var bar: Bar { return self.application.foo.bar(for: self) } }
    

    ♻️ Validations has been refactored to yield better and more type-safe errors (#2071)

    Authentication methods are now grouped under a new req.auth helper (#2111)

    All authenticators now accept Request in their authenticate methods (#2111)

    ➕ Added new ErrorSource struct to the AbortError protocol (#2093)

    🔊 This new struct makes it easier to pass around information about where an error came from. It also makes it easier to indicate that a given error has no source information. This helps the logger avoid muddying logs with useless error source information.

    👍 RouteBuilder HTTP method helpers now support an array of [PathComponent] (#2097)

    ✅ User-provided HTTP headers are no longer ignored when using XCTVapor test methods (#2108)

    🐧 Enabled test discovery on Linux (#2118)