Add Vapor 3 API shims
This patch was authored and released by @tanner0101.
Adds _Vapor3
module that contains deprecations for Vapor 3 APIs (#2373).
To use this module, add the product as a dependency to your App target in Package.swift
. For example:
.target(name: "App", dependencies: [
.product(name: "Vapor", package: "vapor"),
.product(name: "_Vapor3", package: "vapor"),
]),
Then import the _Vapor3
module to enable deprecations.
import Vapor
import _Vapor3
...
app.get("test") { req -> Future<String> in
// ^~~~~~
// 'Future' is deprecated: renamed to 'EventLoopFuture'
...
}
Note: This module only deprecates part of the Vapor 3 API. Some things are missing and not everything can be deprecated. If you'd like to add something, please open up a PR!