Releases: vapor/vapor
4.117.0 - Fix warnings in 6.2
What's Changed
Fix warnings in 6.2 by @0xTim in #3361
Fixes the warnings from the 6.2 RC
This patch was released by @0xTim
Full Changelog: 4.116.0...4.117.0
4.116.0 - Allow initializing Vapor.Application with a Logger
What's Changed
Allow initializing Vapor.Application with a Logger by @czechboy0 in #3359
When using a single Logger in the whole app, it’s useful to be able to initialize the Vapor app with one as well, rather than letting it create one internally.
This doesn’t change behavior for existing users, just adds a new variant of the
Vapor.Application.makemethod that takes a Logger explicitly.Added unit tests to cover both the default and the new option.
This patch was released by @0xTim
Full Changelog: 4.115.1...4.116.0
4.115.1 - Add Sendable annotations to the OTP types
What's Changed
Add Sendable annotations to the OTP types by @0xTim in #3345
Add some missing Sendable annontations to the OTP types so
@preconcurrency importis not required when using the types across isolation boundaries
Reviewers
Thanks to the reviewers for their help:
This patch was released by @0xTim
Full Changelog: 4.115.0...4.115.1
4.115.0 - Improve `VaporTesting`'s `withApp` method
What's Changed
Improve VaporTesting's withApp method by @fpseverino in #3332
This PR makes the
withApphelper method work as advertised, allowing an optional configuration method for theApplicationto be passed.Also, marks it with
@discardableResultto avoid unnecessary warnings.
This patch was released by @gwynne
Full Changelog: 4.114.1...4.115.0
4.114.1 - Correct SessionData's Codable conformance
What's Changed
Correct SessionData's Codable conformance by @gwynne in #3317
The
SessionDatatype (which is nothing but a very thin wrapper over a[String: String]dictionary anyway) had aCodableimplementation that was technically incorrect. This corrects it. There should not be any effect whatsoever on behavior unless someone is using a very esotericEncoderorDecoderto encode or decode it, but it’s still more correct this way.Also took the opportunity to do a little code formatting cleanup and to replace the silly use of
.reduce()in theExpressibleByDictionaryLiteralinitializer with use of the applicable (and somewhat faster)Dictionaryinitializer.
Reviewers
Thanks to the reviewers for their help:
This patch was released by @gwynne
Full Changelog: 4.114.0...4.114.1
4.114.0 - Added a cache policy for file middleware
What's Changed
Added a cache policy for file middleware by @dimitribouniol in #3314
Currently, if a vapor app uses
FileMiddlewareto deliver static resources, it would have no control over the cache policy used by the browser for those files. This adds a configurable cache policy interface with reasonable defaults to better control when and how often a browser re-requests files (for instance, disabling caches during development).
This patch was released by @0xTim
Full Changelog: 4.113.2...4.114.0
4.113.2 - Fix warning in service fix
What's Changed
Fix warning in service fix by @0xTim in #3303
This patch was released by @0xTim
Full Changelog: 4.113.1...4.113.2
4.113.1 - Prevent stack overflow by using `NIOLock` instead of `NIOLockedValueBox` during service initialization
What's Changed
Prevent stack overflow by using NIOLock instead of NIOLockedValueBox during service initialization by @MrMage in #3302
At first glance, one could think that using a
NIOLockedValueBox<(@Sendable (Application) -> ServiceType)?>formakeServicewould be sufficient here. However, for some reason, callingself.storage.makeService.withLockedValue({ $0 })repeatedly inService.servicecauses each subsequent call to the function stored inside the locked value to perform one (or several) more “trampoline” function calls, slowing down the execution and eventually leading to a stack overflow. This is why we use aNIOLockhere instead; it seems to avoid the{ $0 }issue above despite still accessing_makeServicefrom within a closure ({ self._makeService }).
- Replace
NIOLockedValueBoxwithNIOLockto avoid adding trampoline function calls- Add detailed comment explaining the rationale behind the locking mechanism change
- Simplify service initialization with direct fatalError instead of optional handling
- Remove redundant nil checks in service getter
This patch was released by @0xTim
Full Changelog: 4.113.0...4.113.1
4.113.0 - Fix warnings from NIO 2.79.0
What's Changed
Fix warnings from NIO 2.79.0 by @0xTim in #3285
Fixes a number of
Sendablewarnings introduced by https://github.com/apple/swift-nio/releases/tag/2.79.0This also deprecates the main
Application.init()API that was blocking on an event loop that has been marked asnoasyncfor a while. Vapor users should migrate to the async APIs.
This patch was released by @0xTim
Full Changelog: 4.112.2...4.113.0
4.112.2 - Android support
What's Changed
Android support by @marcprux in #3282
This PR adds experimental support for building and testing on Android. It simply involves adding some conditional imports.
Building is contingent on apple/swift-distributed-tracing#163, apple/swift-http-structured-headers#57, swift-server/async-http-client#799, and apple/swift-nio-extras#244, but if you use local snapshots of those packages, you can build with the Android SDK using:
~/Library/Developer/Toolchains/swift-6.0.3-RELEASE.xctoolchain/usr/bin/swift build --swift-sdk aarch64-unknown-linux-android24 --build-tests
This patch was released by @0xTim
Full Changelog: 4.112.1...4.112.2