What's new in SwiftWasm #4
SwiftWasm 5.3.0 and 5.3.1 releases
As you may have seen in our previous post, we've published our first stable release recently. Shortly after that, @flavio reported an issue with
JSONDecoder. Following an investigation by @kateinoigakukun into the root cause of the issue, we've published SwiftWasm 5.3.1, which also included updates from the upstream 5.3.1 patch release.
(If you're interested in technical details, the
JSONDecoder issue was caused by a peculiar assumption about memory layout in Swift runtime, which wasn't applicable to WebAssembly's linear memory. Check the PR diff for more details.)
We still use a fork of OpenCombine in Tokamak due to our custom implementation of the
ObservableObject protocol. In addition to that, our fork also contained some changes to the package manifest to make it build with SwiftWasm, but they made it incompatible with non-Wasm platforms. This issue was resolved in the upstream OpenCombine repository, which reduced the amount of customizations we apply, and brings us closer to using the upstream repository as is.
Following the 0.5.0 release, which added support for the latest
carton, we published a small 0.5.1 patch with support for editing Tokamak projects in Xcode with working autocomplete. Not long after that an important bugfix landed in 0.5.2, which fixed an issue with display order of updated views in the DOM renderer. A few weeks later another bugfix release was published as 0.5.3. In this update Tokamak now internally relies on the aforementioned OpenCombineJS library instead of providing its own
JSScheduler type conforming to Combine's
Scheduler. More importantly, it fixes a bug with
Toggle not being updated after resetting it from a binding.
@kateinoigakukun implemented a
stripCustomSections transformation in the
WasmTransformer library. According to the spec, data in custom sections should not contribute to observed behavior of a given binary. In the case of binaries produced by SwiftWasm, custom sections contain debugging information that can now be stripped with
Previously, custom sections were stripped to reduce final binary size as a build step in `carton bundle
with the wasm-strip` utility from WABT. Thanks to the new transformation in
WasmTransformer, WABT is no longer needed as a dependency of
carton, which makes installation for our end users simpler and faster.
Initial support for presenting crash stack traces directly in
carton has been completed, starting with Firefox support. Support for more browsers will be added in separate PRs.
There was also work on file downloader cleanup, support for browser testing, and simpler URLs for main bundle resources. As soon as these are merged, a new version of
carton will be tagged that will use the latest 5.3.1 release of SwiftWasm.
A lot of the progress wouldn't be possible without payments from our GitHub Sponsors. Their contribution is deeply appreciated and allows us to spend more time on SwiftWasm projects. You can see the list of sponsors and make your contribution on the sponsorship pages of Carson Katri, Yuta Saito and Max Desiatov.
Thanks for reading! 👋