Notable changes this month: WasmKit now runs both a WASI guest and its GDB stub on an ESP32; BridgeJS gained imports from external ECMAScript modules, generic imported functions, and JS-side export renaming across JavaScriptKit 0.57.0-0.58.0; ElementaryUI 0.7.0 now easily buildable through swift package js.
Many thanks to @JDevlieghere, @kateinoigakukun, @krodak, @sliemeobn, @wfltaylor for contributions!
Forum Discussions
- Edge of Tomorrow: full-stack Swift on both sides of
fetch: a Cloudflare Worker demo that builds for Wasm with latest 6.4.x development snapshots using Embedded Swift and Swift Build, pairs ElementaryUI with BridgeJS and Fetch API networking in the browser, and shares data types between edge and frontend through the experimentalNewCodableprototype.
JavaScriptKit
0.57.0 extends last month's JS-snippet imports to external ECMAScript modules, and 0.57.1 puts @JS struct parameters on the same stack ABI as everything else. 0.58.0 adds support for generic functions on imported JS APIs, renaming an export on the JS side, and types declared inside extensions. PackageToJS now derives WASI and shared memory support from product binary's imports instead of using target triple, which adapts this plugin to SwiftBuild now enabled by default in SwiftPM 6.4.
- BridgeJS: import from external ECMAScript modules, and split snippet origins #795;
- BridgeJS: unify
@JSstruct parameter lowering onto the stack ABI #798; - BridgeJS: support generic functions on imported JS APIs #799;
- BridgeJS: export with a different JS name #801;
- BridgeJS: lower imported optional stack parameters fully on the stack #802;
- BridgeJS: allow extensions to contain types #803;
- BridgeJS: emit diagnostics from extensions properly #804;
- BridgeJS: resolve qualified types relative to lexical scope #806;
- PackageToJS: derive WASI and shared memory support from wasm imports #807.
WasmKit
Most of the month went into making WASI work on bare metal, with its own platform layer over raw syscalls, and a GDB stub that no longer requires Swift Concurrency runtime; the ESP32 example links a WASI guest and serves the stub over UART under QEMU. A new wasmkit wast subcommand runs .wast scripts in standalone context, which enables running Wasm spec test suite in embedded environments.
- Replace
SystemExtraswith an internal, injectable platform layer in WASI #398; - Make the debugger stack sans-IO and drop NIO, swift-log, and swift-system #399;
- Fix the 32-bit wasm memory page limit on 32-bit hosts #401;
- Drop the async
withThrowing/CleanupFailureoverloads from WASI #402; - Use a
PlatformMutexin WASI instead ofSynchronization.Mutex#403; - Decouple
WASIFilefromGuestMemory#404; - Make the WASI host module table generic over guest memory #406;
- Allow linking a subset of the WASI preview1 surface #407;
- Decouple
WASIDirfrom its associated iterator type #408; - Cover WASI in the embedded check and strip unused code #409;
- Run a WASI guest on emulated hardware in the ESP32 example #410;
- Run the GDB stub on embedded targets #411;
- Materialize stack-live constants on block entry #412;
- Do not read a host callee as a wasm function when stepping #405;
- Accept an empty value for an
--envvariable #414; - Add a
wasmkit wastsubcommand with a newWASTRunnermodule #415; - Demote debugger server lifecycle logs to trace #416;
- Stop leaking and losing breakpoints while stepping #417;
- GDB RP: Exit with the client and detach from the guest #418.
ElementaryUI
0.6.1 fixes a crasher under Embedded Swift on 6.3. 0.7.0 removes the bundled elementary-ui-browser-runtime npm package: with vite-plugin-swift-wasm 0.2 the Vite plugin integrates with JavaScriptKit's SwiftPM plugin and its generated package output directly, enabling better integration with BridgeJS. It is also the last release needing the reinstall-and-clear-the-Vite-cache step.
- Fixed crasher in 6.3 Embedded #121;
- Upgrade to JavaScriptKit 0.58 #122;
- Migrate examples to
virtual:swift-wasm?js#123; - Deprecate the bundled
elementary-ui-browser-runtimepackage #125.
uWASI
- Significant expansion of available WASI Preview 1 support #16.
Thank you for reading, and please feel free to add any comments or suggestions if we missed anything!
If you'd like to catch up with changes from previous months, here's a list of recent updates: