OnlineSwiftPlayground
OnlineSwiftPlayground copied to clipboard
Draft: Swift version management, Docker multi-stage build
While implementing #38, I sometime struggled with steps necessary to make the app build. I'd like to pitch developer experience improvement using swiftenv
for toolchain management.
The problem
The current toolchain management is hard to understand and error-prone when managing multiple versions. The configuration of supported swift versions is spread across multiple places (build scripts, Vapor app, frontend and Docker) making maintenance real challenge.
The solution
- Offload swift toolchain management to
swiftenv
- Use installed toolchains (
swiftenv versions
) as the source of truth for BE and FE (using new/api/versions
endpoint) - Drop per-toolchain
OnlinePlayground
in favour of Swift 5 ABI (build once, link everywhere™️) - (Unrelated) Use slim container for app deployment
- Uses Docker multi-stage build (stripping final image from system swift version, node, ..)
Let me know if it sounds interesting to you and we can coordinate to finish this PR.