Skip to content

Commit 8291fb9

Browse files
[codex] Drop Swift 6.1/6.2 support and raise MSSV to 6.3 (#762)
* drop swift 6.1 * fix ci matrix * Detach async JS bridge tasks * Stabilize identity GC test * Revert detached async bridge tasks * Use Swift 6.2.4 in CI * Use Swift 6.2.3 in CI * Drop Swift 6.2 from CI * Document minimum Swift version * Add MSSV section to README * Fix async closure test formatting * Move tracing override to 24.04 matrix entry
1 parent ab2bdb3 commit 8291fb9

15 files changed

Lines changed: 35 additions & 280 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,13 @@ jobs:
1212
strategy:
1313
matrix:
1414
entry:
15-
- os: ubuntu-22.04
16-
toolchain:
17-
download-url: https://download.swift.org/swift-6.1-release/ubuntu2204/swift-6.1-RELEASE/swift-6.1-RELEASE-ubuntu22.04.tar.gz
18-
wasi-backend: Node
19-
target: "wasm32-unknown-wasi"
20-
env: |
21-
JAVASCRIPTKIT_DISABLE_TRACING_TRAIT=1
2215
- os: ubuntu-24.04
2316
toolchain:
2417
download-url: https://download.swift.org/development/ubuntu2404/swift-DEVELOPMENT-SNAPSHOT-2025-12-01-a/swift-DEVELOPMENT-SNAPSHOT-2025-12-01-a-ubuntu24.04.tar.gz
2518
wasi-backend: Node
2619
target: "wasm32-unknown-wasip1"
20+
env: |
21+
JAVASCRIPTKIT_DISABLE_TRACING_TRAIT=1
2722
- os: ubuntu-24.04
2823
toolchain:
2924
download-url: https://download.swift.org/swift-6.3-branch/ubuntu2404/swift-6.3-DEVELOPMENT-SNAPSHOT-2026-03-05-a/swift-6.3-DEVELOPMENT-SNAPSHOT-2026-03-05-a-ubuntu24.04.tar.gz
@@ -77,10 +72,6 @@ jobs:
7772
strategy:
7873
matrix:
7974
entry:
80-
- image: "swift:6.1.2"
81-
swift-syntax-version: "601.0.0"
82-
- image: "swift:6.2"
83-
swift-syntax-version: "602.0.0"
8475
- image: "swift:6.3"
8576
swift-syntax-version: "603.0.0"
8677
runs-on: ubuntu-latest
@@ -110,7 +101,7 @@ jobs:
110101
matrix:
111102
include:
112103
- os: macos-15
113-
xcode: Xcode_16.4
104+
xcode: Xcode_26.0.1
114105
runs-on: ${{ matrix.os }}
115106
steps:
116107
- uses: actions/checkout@v6
@@ -134,7 +125,7 @@ jobs:
134125
format:
135126
runs-on: ubuntu-latest
136127
container:
137-
image: swift:6.1.2
128+
image: swift:6.3
138129
steps:
139130
- uses: actions/checkout@v6
140131
- run: ./Utilities/format.swift

Examples/Embedded/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Embedded example
22

3-
Requires a recent DEVELOPMENT-SNAPSHOT toolchain. (tested with swift-6.1-DEVELOPMENT-SNAPSHOT-2025-02-21-a)
3+
Requires a recent DEVELOPMENT-SNAPSHOT toolchain.
44

55
```sh
66
$ ./build.sh

Package@swift-6.1.swift

Lines changed: 0 additions & 222 deletions
This file was deleted.

Plugins/PackageToJS/Tests/ExampleTests.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ extension Trait where Self == ConditionTrait {
297297
}
298298
}
299299

300-
#if compiler(>=6.1)
301300
@Test(.requireSwiftSDK)
302301
func testingWithCoverage() throws {
303302
let swiftSDKID = try #require(Self.getSwiftSDKID())
@@ -325,7 +324,6 @@ extension Trait where Self == ConditionTrait {
325324
}
326325
}
327326
}
328-
#endif
329327
#endif // compiler(>=6.3)
330328

331329
@Test(.requireSwiftSDK(triple: "wasm32-unknown-wasip1-threads"))
@@ -379,7 +377,6 @@ extension Trait where Self == ConditionTrait {
379377
}
380378
}
381379

382-
#if compiler(>=6.1)
383380
// TODO: Remove triple restriction once swift-testing is shipped in p1-threads SDK
384381
@Test(.requireSwiftSDK(triple: "wasm32-unknown-wasi"))
385382
func continuationLeakInTest_SwiftTesting() throws {
@@ -391,8 +388,6 @@ extension Trait where Self == ConditionTrait {
391388
try runSwift(["package", "--disable-sandbox", "--swift-sdk", swiftSDKID, "js", "test"], [:])
392389
}
393390
}
394-
#endif
395-
396391
@Test(.requireSwiftSDK)
397392
func playwrightOnPageLoad_XCTest() throws {
398393
let swiftSDKID = try #require(Self.getSwiftSDKID())
@@ -413,7 +408,6 @@ extension Trait where Self == ConditionTrait {
413408
}
414409
}
415410

416-
#if compiler(>=6.1)
417411
// TODO: Remove triple restriction once swift-testing is shipped in p1-threads SDK
418412
@Test(.requireSwiftSDK(triple: "wasm32-unknown-wasi"))
419413
func playwrightOnPageLoad_SwiftTesting() throws {
@@ -434,5 +428,4 @@ extension Trait where Self == ConditionTrait {
434428
)
435429
}
436430
}
437-
#endif
438431
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ Use the [BridgeJS Playground](https://swiftwasm.org/JavaScriptKit/PlayBridgeJS/)
120120

121121
Check out the [examples](https://github.com/swiftwasm/JavaScriptKit/tree/main/Examples) for more detailed usage patterns.
122122

123+
## Minimum Supported Swift Version (MSSV)
124+
125+
The minimum supported Swift version is 6.3.
126+
123127
## Contributing
124128

125129
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to the project.

Sources/JavaScriptEventLoop/JSRemote.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extension JSRemote where T == JSObject {
6262
///
6363
/// - Parameter object: The JavaScript object to reference remotely.
6464
public init(_ object: JSObject) {
65-
#if compiler(>=6.1) && _runtime(_multithreaded)
65+
#if _runtime(_multithreaded)
6666
self.init(sourceObject: object, sourceTid: object.ownerTid)
6767
#else
6868
self.init(sourceObject: object, sourceTid: -1)
@@ -92,7 +92,7 @@ extension JSRemote where T == JSObject {
9292
public func withJSObject<R: Sendable, E: Error>(
9393
_ body: @Sendable @escaping (JSObject) throws(E) -> R
9494
) async throws(E) -> sending R {
95-
#if compiler(>=6.1) && _runtime(_multithreaded)
95+
#if _runtime(_multithreaded)
9696
if storage.sourceTid == swjs_get_worker_thread_id_cached() {
9797
return try body(storage.sourceObject)
9898
}
@@ -137,13 +137,11 @@ private final class _JSRemoteContext: @unchecked Sendable {
137137
}
138138
}
139139

140-
#if compiler(>=6.1)
141140
@_expose(wasm, "swjs_invoke_remote_jsobject_body")
142141
@_cdecl("swjs_invoke_remote_jsobject_body")
143-
#endif
144142
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
145143
func _swjs_invoke_remote_jsobject_body(_ contextPtr: UnsafeRawPointer?) -> Bool {
146-
#if compiler(>=6.1) && _runtime(_multithreaded)
144+
#if _runtime(_multithreaded)
147145
guard let contextPtr else { return true }
148146
let context = Unmanaged<_JSRemoteContext>.fromOpaque(contextPtr).takeRetainedValue()
149147

0 commit comments

Comments
 (0)