Announcing SwiftNIO 2
First of all, a big thank you to the SwiftNIO community . The SwiftNIO project is now just over one year old and your contributions have been amazing. We are so happy to see the awesome things you have built using SwiftNIO in its first year and can't wait for what's next. A special shout-out also to all those living on the NIO 2 branches as we were developing them, it was a huge help to have the code run in actual projects right after it was written.
The main theme of the SwiftNIO 2 release is a refinement of our APIs and taking advantage of the new features in Swift 5 such as the new UTF-8 String . In addition to these refinements in the core of SwiftNIO, there are two major changes that are we are most excited about:
swift-nio-sslnow provides TLS (SSL) support without relying on your system's OpenSSL version. That allows much improved compatibility and makes SwiftNIO ready for future protocols that cannot be implemented without very up to date TLS libraries that Linux distributions often don't provide. That is achieved by vendoring BoringSSL inside the swift-nio-ssl SwiftPM package.
swift-nio-http2is now a pure-Swift implementation of the HTTP/2 protocol . That means you can now use HTTP/2 with SwiftNIO without having the nghttp2 library installed on your system.
Besides being super cool to have a pure-Swift HTTP/2 implementation this also means that using SwiftNIO for your package is easier than ever as with Open/LibreSSL and nghttp2 we dropped two significant system dependencies.
To get started, check out the README. If you want to migrate your SwiftNIO 1 application or library, do check out the migration guide we prepared for you. If you don't want to migrate right now, or you can't because you want to continue supporting Swift 4, don't worry: SwiftNIO1 does work with Swift 5 just fine and there's no action required today or in the near future.
If you want to start using SwiftNIO 2 right now without further ado, please find below the correct SwiftPM dependencies for all the repositories in the SwiftNIO 2 family (yes, some of them have major version 1).
// 🚀 .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"), // 🔐 .package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.0.0"), // ⛑ .package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.0.0"), // 2️⃣ .package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.0.0"), // , for `platforms: [ .macOS(.v10_14), .iOS(.v12), .tvOS(.v12), ]` .package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.0.0"),
Please feel free to reach out if you have any questions!
Thank you, the SwiftNIO team.