Skip to content

Commit 0ee8fb2

Browse files
Merge pull request #731 from SwiftFiddle/update-swift
Update Swift
2 parents 6408bd7 + 8e43e49 commit 0ee8fb2

File tree

5 files changed

+501
-429
lines changed

5 files changed

+501
-429
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ COPY Public ./Public/
1313
RUN npx webpack --config webpack.prod.js
1414

1515

16-
FROM swift:5.10-focal as swift
16+
FROM swift:6.1-jammy as swift
1717
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
1818
&& apt-get -q update \
1919
&& apt-get -q dist-upgrade -y\
@@ -40,7 +40,7 @@ RUN [ -d /build/Public ] && { mv /build/Public ./Public && chmod -R a-w ./Public
4040
RUN [ -d /build/Resources ] && { mv /build/Resources ./Resources && chmod -R a-w ./Resources; } || true
4141

4242

43-
FROM swift:5.10-focal-slim
43+
FROM swift:6.1-jammy-slim
4444
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
4545
&& apt-get -q update \
4646
&& apt-get -q dist-upgrade -y \

Public/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11
"use strict";
22

3-
import Plausible from "plausible-tracker";
4-
5-
const { enableAutoPageviews } = Plausible({
6-
domain: "swift-format.com",
7-
});
8-
enableAutoPageviews();
9-
103
import "./scss/default.scss";
114

125
import "codemirror/lib/codemirror.css";

Sources/App/entrypoint.swift

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,21 @@
11
import Vapor
2-
import Dispatch
3-
import Logging
4-
5-
/// This extension is temporary and can be removed once Vapor gets this support.
6-
private extension Vapor.Application {
7-
static let baseExecutionQueue = DispatchQueue(label: "vapor.codes.entrypoint")
8-
9-
func runFromAsyncMainEntrypoint() async throws {
10-
try await withCheckedThrowingContinuation { continuation in
11-
Vapor.Application.baseExecutionQueue.async { [self] in
12-
do {
13-
try self.run()
14-
continuation.resume()
15-
} catch {
16-
continuation.resume(throwing: error)
17-
}
18-
}
19-
}
20-
}
21-
}
222

233
@main
244
enum Entrypoint {
255
static func main() async throws {
266
var env = try Environment.detect()
277
try LoggingSystem.bootstrap(from: &env)
288

29-
let app = Application(env)
30-
defer { app.shutdown() }
9+
let app = try await Application.make(env)
3110

32-
try await configure(app)
33-
try await app.runFromAsyncMainEntrypoint()
11+
do {
12+
try await configure(app)
13+
try await app.execute()
14+
} catch {
15+
app.logger.report(error: error)
16+
try? await app.asyncShutdown()
17+
throw error
18+
}
19+
try await app.asyncShutdown()
3420
}
3521
}

0 commit comments

Comments
 (0)