github vapor/vapor 3.0.0-beta.0
Vapor 3.0 Beta 0 (tip-of-tree)

latest releases: 4.100.0, 4.99.3, 4.99.2...
pre-release6 years ago

⚠️ It looks like SPM has issues resolving dependencies if you rely on this beta tag directly. Instead, rely on .branch("beta") and optionally use this Package.resolved file for specifically the beta.0 dependencies.

🎉 The first beta of Vapor 3.0 is here!

There have been some massive internal updates between Alpha 12 and Beta 0, but for the most part the public API is unchanged. Due to the internal changes, we are looking out for regressions from Alpha 12 to Beta 0. If you find any, please report and we will work quickly to resolve them.

New:

  • Reactive Streams: Vapor's internal async streams now support back-pressure.

Reactive streams means your Vapor applications will be more resilient to the producer-consumer problem that has long plagued web applications. Vapor achieves this by moving from "push" streams (aka, fire hose streams) to "pull" streams. At a high level, this means better performance and less memory usage during peak demand.

Learn more at reactive-streams.org.

  • Kqueue: Vapor now uses Kqueue under the hood instead of Dispatch. This yielded a 30% improvement in raw TCP performance. Epoll support for Linux coming soon.
  • Module separation: Vapor 3's source code has been put back to its original repos. Please file future issues on the repos to which they pertain.
  • Key String Map: Key string maps are no longer required on Fluent models thanks to a custom built decoder for deriving [CodingKey] paths from Swift KeyPaths.
  • Migrations: Migrations are no longer required when added to Fluent models thanks to another custom built decoder for discovering all model properties.
  • Terminal Styles: Several new terminal style options have been added to the Console package.
  • Future chaining: We have updated Future chaining methods to better match Swift.

futureString.map(to: T.self) accepts a (String) -> T

let futureString = futureInt.map(to: String.self) { $0.description }

futureString.flatMap(to: T.self) accepts a (String) -> Future<T>

let futureResponse = futureString.flatMap(to: Response.self) { string in
    return client.get(string)
}
  • Removed some .register overloads from the Services struct. Registering instances of services and providers now have their own methods.
var services = Services.default()

/// instance
let myFoo = Foo()
services.instance(myFoo)

/// provider
try services.provider(FooProvider())

/// factory
services.register { container in
    return Foo()
}

Fixed:

  • Services now properly respect tags.

Don't miss a new vapor release

NewReleases is sending notifications on new releases.