Repository navigation
Releases: vercel-labs/swift-vercel-runtime
Releases · vercel-labs/swift-vercel-runtime
Release list
0.6.1
swift package --disable-sandbox vercel initadds.vercelto.gitignore(creating it if
needed) unless Git already ignores it, including through a parent directory's.gitignore.
The build writes.vercel/outputthere. A.vercelignored only by your global Git excludes
file still gets added, since it wouldn't be ignored in other clones.
0.6.0
swift package --disable-sandbox vercel initalso writes the local Swift version to
.swift-version(unless the file exists): the exact release for a swift.org toolchain (like
6.4.0), major.minor for Xcode's (like6.4), none for snapshots. Vercel builds then use the
Swift you develop with, and new Swift releases are opt-in. swiftly reads the same file.vercel-install-swift.sh:.swift-versionandSWIFT_VERSIONmatch swift.org releases
however they are named, so6.3.0finds the release named6.3.- Toolchain check: no hardcoded Swift versions. For Apple's toolchain it suggests
swiftly install/swiftly usewith its major.minor version (orlatest); for a missing or
mismatched Static Linux SDK it points to swift.org'sswift sdk installcommand instead of
guessing a URL. An SDK named without a patch version (likeswift-6.3-RELEASE_static-linux-0.1.0)
now matches its toolchain. - CI tests Swift 6.4 and the latest Swift release, also daily, and installs the matching Static
Linux SDK with the newscripts/install-static-sdk.sh. scripts/test-plugin.sh(replacingscripts/test-vercel-json.sh) tests all of the plugin's
PackagePlugin-free logic, with the tests inscripts/plugin-tests.
0.5.0
New optional products for Vercel features, each its own library so apps only link what they use.
See "Optional Vercel features" in the README.
VercelCache: the Vercel Runtime Cache (RuntimeCache), likegetCache()from
@vercel/functionsand sharing entries with it:Codablevalues with TTLs and tags (dates
encoded like Node'sJSON.stringify, customizable withencoder:/decoder:), and an in-memory
fallback locally.VercelGlobalConfig: reads Global Config (formerly Edge Config) stores (GlobalConfig), like
@vercel/edge-config:get,has,getAllanddigest, typed or asGlobalConfigValue.VercelFirewall: rate limiting with Vercel Firewall rules (Firewall.checkRateLimit, returning
aRateLimitResultwith an optionalRateLimitResult.Reason), like@vercel/firewall.VercelOIDC: the request's OIDC token and its claims (OIDC.token(),VercelOIDCToken), token
exchange for other audiences (OIDC.exchange), and AWS credentials from STS
(AWSCredentialsProvider,OIDC.awsCredentials).- Each feature module throws its own error type (
RuntimeCacheError,GlobalConfigError,
VercelFirewallError,VercelOIDCError) withtimedOut,requestFailedand an unexpected
status case. Descriptions,dumpand debug output of credentials, tokens and clients never
show secrets. Vercel: everything above plusVercelRuntime, with oneimport Vercel.VercelRuntime:Vercel.withRequestnow also works locally and setsVercel.currentRequest,
which the feature modules use to find the request's headers.Vercel.deadlineand
request.headers.vercel.deadlinegive the request's deadline.Vercel.reportFetchshows
outbound requests under External APIs in Observability; the feature modules report theirs
automatically.VercelBootstrap: passes the request deadline to the app asx-vercel-deadline(replacing any
sent by a client), forwards fetch metrics, and hands runtime cache configuration that Vercel
hides from request headers to the app over its socket (asked once per request, with a 1 second
timeout). It no longer depends onVercelRuntime, so it stays small.
0.4.0
- Git deployments:
scripts/vercel-install-swift.sh, used as a project's Install Command, installs
the swift.org toolchain and Static Linux SDK in Vercel's build image and keeps them (and the
package's.build) in Vercel's build cache, so Vercel can runswift package vercelon every
push. See "Deploy from Git" in the README. swift package --disable-sandbox vercel init [build options]sets up Git deployments: it sets
installCommandandbuildCommandinvercel.json, creating the file if needed. In an
existingvercel.jsonnothing else changes, not even formatting or key order.swift package vercel --swift-sdks-path <path>(orSWIFT_VERCEL_SDKS_PATH) builds with SDKs
from another directory.vercel.jsonbuild settings (installCommand,buildCommand, ...) no longer print an
"ignoring" note.- Inside
vercel build(VERCEL=1),cronsare no longer copied intoconfig.json: Vercel adds
them fromvercel.jsonitself and rejected the duplicates.
0.3.0
Breaking changes
- The build command is now
swift package --disable-sandbox vercel(wasvercel-build). Options
are unchanged. - The plugin product and target are now
VercelPlugin(wereVercelBuildPlugin). Apps do not
reference plugin products, so only scripts that invoke the command change.
0.2.0
Any Swift server that listens on a port now runs on Vercel unchanged, with no framework adapters.
This is how Vercel runs standalone Go servers.
VercelBootstrap(new): the function's entrypoint. It starts your app withPORTset, finds
the port it listens on (from/proc, so apps that ignorePORTwork too), and proxies requests
to it. It also implements the Vercel runtime protocol for the app: health checks, internal
header stripping, anendper request (and at101for WebSockets), streaming in both
directions with backpressure, WebSocket tunnels,CRON_SECRETenforcement on cron paths,
SIGTERMforwarding, and crash reporting. Built and deployed byvercel-build.VercelBuildPlugin: builds both binaries and writesvercel-bootstrap.json; the function's
handler,executable, is now the bootstrap, like Vercel's Go builder. Executable products named
executableorbootstrapare rejected (AWS Lambda would run a file namedbootstrapas its
runtime, bypassing Vercel's).VercelRuntimeis now optional and framework-agnostic. Per-request logs andwaitUntiltake the
request'sHTTPFields:Vercel.withRequest(request.headers) { ... }(typically from a
five-line middleware) andVercel.waitUntil(for: request.headers) { ... }. They talk to the
bootstrap overVERCEL_BOOTSTRAP_SOCKET, connecting on first use. Request helpers are
request.headers.vercel.- The package now requires macOS 15 instead of macOS 26.2 (Vapor 5 still requires macOS 26.2).
Breaking changes
- Removed
VercelVapor,VercelHummingbirdandVercelHummingbirdWebSocket. Use
Application()/Application(router:)and.http1WebSocketUpgradedirectly. - Removed
VercelCronMiddleware: the bootstrap enforcesCRON_SECRETon the cron paths from
vercel.json.VercelCron.isAuthorized(_:secret:)remains for other routes. - Removed the in-process runtime API (
VercelRuntimeclass,serverStarted,withRequest(_:)
with anInvocationContext,removeVercelInternalFields): the bootstrap owns the runtime
protocol now. request.vercelis nowrequest.headers.vercel.
0.1.0
First release. Run Swift servers natively on Vercel: apps are cross-compiled with the Swift Static
Linux SDK into a static binary that Vercel's executable runtime runs directly.
VercelRuntime: the Vercel functions runtime protocol over SwiftNIO (non-blocking IPC with a
single writer and bounded log buffering), request lifecycle withwithRequest, header handling,
VercelLogHandler(per-request logs for swift-log),Vercel.waitUntil, request helpers
(geolocation, IP address, request id, OIDC token),VercelEnvironment, and cron authorization.VercelHummingbird:Application(vercel:)andVercelCronMiddlewarefor Hummingbird 2.VercelHummingbirdWebSocket:.vercelWebSocketUpgradefor WebSockets with hummingbird-websocket.VercelVapor:Application.vercel()andVercelCronMiddlewarefor Vapor 5 (beta).VercelBuildPlugin:swift package --disable-sandbox vercel-buildwrites Build Output API v3
forvercel deploy --prebuilt, with crons fromvercel.json, static files, function settings,
and a toolchain/SDK check before compiling.