Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions .github/workflows/ci-embedded.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ jobs:
fail-fast: false
matrix:
swift:
- version: 6.3-snapshot-2026-02-14
wasm-sdk-url: https://download.swift.org/swift-6.3-branch/wasm-sdk/swift-6.3-DEVELOPMENT-SNAPSHOT-2026-02-14-a/swift-6.3-DEVELOPMENT-SNAPSHOT-2026-02-14-a_wasm.artifactbundle.tar.gz
wasm-sdk-checksum: e56084b2bfa90dbd3a6c3d11a779a387bae99ba83b985062e2a9ef51da55ce2f
wasm_sdk_id: swift-6.3-DEVELOPMENT-SNAPSHOT-2026-02-14-a_wasm-embedded
- version: 6.3-snapshot-2026-02-26
wasm-sdk-url: https://download.swift.org/swift-6.3-branch/wasm-sdk/swift-6.3-DEVELOPMENT-SNAPSHOT-2026-02-26-a/swift-6.3-DEVELOPMENT-SNAPSHOT-2026-02-26-a_wasm.artifactbundle.tar.gz
wasm-sdk-checksum: 8ce66e881a4c88df6da9565a79b34060af930f661e7dd8d066f7f132b3eaf699
wasm_sdk_id: swift-6.3-DEVELOPMENT-SNAPSHOT-2026-02-26-a_wasm-embedded

- version: main-snapshot-2026-02-19
wasm-sdk-url: https://download.swift.org/development/wasm-sdk/swift-DEVELOPMENT-SNAPSHOT-2026-02-19-a/swift-DEVELOPMENT-SNAPSHOT-2026-02-19-a_wasm.artifactbundle.tar.gz
wasm-sdk-checksum: 9671979f6a6585b642834993e0c63b6cae084a43dc6103a87a2e8f8929094e08
wasm_sdk_id: swift-DEVELOPMENT-SNAPSHOT-2026-02-19-a_wasm-embedded
- version: main-snapshot-2026-02-24
wasm-sdk-url: https://download.swift.org/development/wasm-sdk/swift-DEVELOPMENT-SNAPSHOT-2026-02-24-a/swift-DEVELOPMENT-SNAPSHOT-2026-02-24-a_wasm.artifactbundle.tar.gz
wasm-sdk-checksum: dc6e2fc24fb6cd7c7b72ef8d61dbfc3577bc1e360f33d410aebeda8974f1d02f
wasm_sdk_id: swift-DEVELOPMENT-SNAPSHOT-2026-02-24-a_wasm-embedded
examples:
- Examples/Swiftle
- Examples/Basic

steps:
- name: Checkout
Expand All @@ -37,8 +40,25 @@ jobs:
with:
toolchain: ${{ matrix.swift.version }}

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: ${{ matrix.examples }}/pnpm-lock.yaml

- name: Install Swift WASM SDK
run: swift sdk install ${{ matrix.swift.wasm-sdk-url }} --checksum ${{ matrix.swift.wasm-sdk-checksum }}

- name: Install dependencies
working-directory: ${{ matrix.examples }}
run: pnpm preinstall && pnpm install

- name: Build
run: swift build --swift-sdk ${{ matrix.swift.wasm_sdk_id }}
working-directory: ${{ matrix.examples }}
run: pnpm build
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ public extension Environment {
self.init(ObjectStorageReader(V.self))
}

// // NOTE: in embedded for some reason this causes a compiler crash around the (actually unused) StoredValue<Optional<O>> type
// // ¯\_(ツ)_/¯ - try again with a newer toolchain in the future
// @_unavailableInEmbedded
init<O: ReactiveObject>(_: O.Type = O.self) where V == O? {
self.init(ObjectStorageReader(V.self))
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/ElementaryUI/Data/Environment/Environment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ public struct Environment<V> {
}
case let .objectReader(reader, _):
storage = .objectReader(reader, values.boxes[reader.propertyID])
#if hasFeature(Embedded)
// FIXME: embedded - create issue and check with main

#if hasFeature(Embedded) && compiler(<6.3)
// NOTE: 6.2 embedded hack for type inclusion
if __omg_this_was_annoying_I_am_false {
// NOTE: this is only to force inclusion of the the box type for V
storage = .valueBox(EnvironmentValues._Box<V>(reader.read(values.boxes[reader.propertyID])))
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions Sources/ElementaryUI/Data/State/Binding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public struct Binding<V> {
case let .stateAccessor(accessor):
accessor.value = newValue
case let .getSet(_, set):
#if hasFeature(Embedded)
// FIXME: embedded - create issue and check with main
#if hasFeature(Embedded) && compiler(<6.3)
// NOTE: 6.2 embedded hack for type inclusion
if __omg_this_was_annoying_I_am_false {
_ = AnyValueBox.init(newValue)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public final class _AttributeModifier: DOMElementModifier, Invalidateable {
self.upstream = upstream[_AttributeModifier.key]
self.upstream?.tracker.addDependency(self)

#if hasFeature(Embedded)
#if hasFeature(Embedded) && compiler(<6.3)
if __omg_this_was_annoying_I_am_false {
// this is to force inclusion of types
// NOTE: 6.2 embedded hack for type inclusion
_ = p {}.attributes(.class([""]), .style(["": ""]))
var f = [HashableUTF8View: _StoredAttribute]()
f[HashableUTF8View("")] = .none
Expand Down
1 change: 1 addition & 0 deletions Sources/ElementaryUI/HTMLViews/View+Binding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ struct DOMEffectView<Effect: DOMElementModifier, Wrapped: View>: View {

#if hasFeature(Embedded) && compiler(<6.3)
if __omg_this_was_annoying_I_am_false {
// NOTE: 6.2 embedded hack for type inclusion
var context = _CommitContext(
dom: JSKitDOMInteractor(),
scheduler: Scheduler(dom: JSKitDOMInteractor()),
Expand Down
4 changes: 2 additions & 2 deletions Sources/ElementaryUI/JSInterop/Elementary+JavaScriptKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ final class JSKitDOMInteractor: DOM.Interactor {
private let staticStrings = StaticJSStringCache()

init() {
#if hasFeature(Embedded)
#if hasFeature(Embedded) && compiler(<6.3)
if __omg_this_was_annoying_I_am_false {
// NOTE: this is just to force inclusion of some types that would otherwise crash the 6.2 compiler
// NOTE: 6.2 embedded hack for type inclusion
_ = JSClosure { _ in .undefined }
_ = JSObject()
_ = JSObject?(nil)
Expand Down
6 changes: 2 additions & 4 deletions Sources/ElementaryUI/JSInterop/GlobalEvents.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import JavaScriptKit

// NOTE: all of this is because
// a) Tasks are not yet supported for embedded wasm (so we can't use `.task` with an async sequence)
// b) Combine obvsiously won't fly
// ideally, once tasks work in embedded wasm, we can replace this with an AsyncSequence
// NOTE: all of this is because tasks were not a thing in embedded until recently
// revisit in 6.3

public protocol EventSource<Event> {
associatedtype Event
Expand Down
8 changes: 3 additions & 5 deletions Sources/ElementaryUI/_embeddedTricks.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// FIXME: embedded - create issue and check with main
// we need to force addition of types that are present in unused enum cases -> otherwise it crashes the compiler (6.2 at least)
#if hasFeature(Embedded)
// NOTE: In 6.2 we need to force addition of types that are present in unused enum cases -> otherwise it crashes the compiler (6.2 at least)
#if hasFeature(Embedded) && compiler(<6.3)
internal var __omg_this_was_annoying_I_am_false: Bool = false
#endif

// FIXME: embedded - remove once https://github.com/swiftlang/swift/issues/83460 lands
// also, implementation is AI slop, I would not trust it with anything
// NOTE: remove once on 6.3
#if hasFeature(Embedded) && compiler(<6.3)
@_silgen_name("swift_float32ToString")
@_noAllocation
Expand Down