I have asked a bunch of questions on these forums, especially in recent months, and I wanted to give something back.
It’s a simple demo, but you might find it helpful if you’re trying to pass complex data types between Swift and JS. More broadly, you might find this pattern and toolset useful for Embedded in general, since Codable is not available there.
Impressively (to me at least), the Wasm binary lands at ~140kB, including JSON encoding / decoding, and Unicode support. This code size is highly competitive with Rust!
I want to take a moment to give a huge shout out to @kateinoigakukun @Max_Desiatov and everyone else who contributed to making Swift Wasm a reality. It’s shaping up to be a very refined part of the ecosystem.
I – as just one of many – am very impressed, and grateful.
Also, big shout out to @fabianfett for swift-extras-json, which I forked for use in Embedded.