From 4263c1ce61ccf3f6c33ebe2954bb22b98663111a Mon Sep 17 00:00:00 2001 From: "Volodymyr B." Date: Sun, 23 Feb 2025 21:10:15 +0000 Subject: [PATCH 1/5] update readme --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4bc6d2d15..5c5b76370 100644 --- a/README.md +++ b/README.md @@ -178,12 +178,14 @@ Not all of these versions are tested on regular basis though, compatibility repo ## Usage in a browser application -The easiest way to get started with JavaScriptKit in your browser app is with [the `carton` +The easiest is to start with [Examples](/Examples) which has JavaScript glue runtime. + +Second option is to get started with JavaScriptKit in your browser app is with [the `carton` bundler](https://carton.dev). Add carton to your swift package dependencies: ```diff dependencies: [ -+ .package(url: "https://github.com/swiftwasm/carton", from: "1.0.0"), ++ .package(url: "https://github.com/swiftwasm/carton", from: "1.1.3"), ], ``` @@ -253,10 +255,6 @@ within it. You'll see `Hello, world!` output in the console. You can edit the ap your favorite editor and save it, `carton` will immediately rebuild the app and reload all browser tabs that have the app open. -You can also build your project with webpack.js and a manually installed SwiftWasm toolchain. Please -see the following sections and the [Example](https://github.com/swiftwasm/JavaScriptKit/tree/main/Example) -directory for more information in this more advanced use case. - ## Sponsoring [Become a gold or platinum sponsor](https://github.com/sponsors/swiftwasm/) and contact maintainers to add your logo on our README on Github with a link to your site. From 080933347280bb271ef689075f9554e8f25a53a9 Mon Sep 17 00:00:00 2001 From: "Volodymyr B." Date: Sun, 23 Feb 2025 21:11:10 +0000 Subject: [PATCH 2/5] update examples --- Examples/Basic/Package.swift | 2 +- Examples/Embedded/Package.swift | 5 +++-- Examples/Embedded/README.md | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Examples/Basic/Package.swift b/Examples/Basic/Package.swift index aade23359..cc2ea0a0f 100644 --- a/Examples/Basic/Package.swift +++ b/Examples/Basic/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 import PackageDescription diff --git a/Examples/Embedded/Package.swift b/Examples/Embedded/Package.swift index 227a049ff..f97638cc8 100644 --- a/Examples/Embedded/Package.swift +++ b/Examples/Embedded/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 import PackageDescription @@ -32,5 +32,6 @@ let package = Package( ]) ] ) - ] + ], + swiftLanguageModes: [.v5] ) diff --git a/Examples/Embedded/README.md b/Examples/Embedded/README.md index 2f388fcdc..e99d659ff 100644 --- a/Examples/Embedded/README.md +++ b/Examples/Embedded/README.md @@ -1,6 +1,6 @@ # Embedded example -Requires a recent DEVELOPMENT-SNAPSHOT toolchain. (tested with swift-DEVELOPMENT-SNAPSHOT-2024-09-25-a) +Requires a recent DEVELOPMENT-SNAPSHOT toolchain. (tested with swift-6.1-DEVELOPMENT-SNAPSHOT-2025-02-21-a) ```sh $ ./build.sh From f9d3ff8a5f025133cb7e8ddafeaad405b201e01e Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 24 Feb 2025 00:07:33 +0000 Subject: [PATCH 3/5] Update compatibility CI --- .github/workflows/compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index e16785157..65e60ea4a 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v4 - uses: swiftwasm/setup-swiftwasm@v1 with: - swift-version: wasm-5.10.0-RELEASE + swift-version: wasm-6.0.3-RELEASE - name: Run Test run: | set -eux From b4758bbf20d2a2dab2b6361f643f693b894dde46 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 24 Feb 2025 00:11:42 +0000 Subject: [PATCH 4/5] Use --static-swift-stdlib to use Foundation --- .github/workflows/compatibility.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/compatibility.yml b/.github/workflows/compatibility.yml index 65e60ea4a..04e2aa0d3 100644 --- a/.github/workflows/compatibility.yml +++ b/.github/workflows/compatibility.yml @@ -18,5 +18,5 @@ jobs: set -eux make bootstrap cd Examples/Basic - swift build --triple wasm32-unknown-wasi - swift build --triple wasm32-unknown-wasi -Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS + swift build --triple wasm32-unknown-wasi --static-swift-stdlib + swift build --triple wasm32-unknown-wasi -Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS --static-swift-stdlib From 1738361da3252ec583c6111d40ffb7f8c48d0972 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 24 Feb 2025 00:21:15 +0000 Subject: [PATCH 5/5] Skip Swift 6 concurrency restrictions for now --- Examples/Basic/Package.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Examples/Basic/Package.swift b/Examples/Basic/Package.swift index cc2ea0a0f..ea70e6b20 100644 --- a/Examples/Basic/Package.swift +++ b/Examples/Basic/Package.swift @@ -16,5 +16,6 @@ let package = Package( .product(name: "JavaScriptEventLoop", package: "JavaScriptKit") ] ) - ] + ], + swiftLanguageVersions: [.v5] )