https://github.com/ole/swift-webassembly-javascriptkit-playground
https://github.com/ole/swift-webassembly-javascriptkit-playground
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ole/swift-webassembly-javascriptkit-playground
- Owner: ole
- Created: 2025-01-03T18:55:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-15T19:35:30.000Z (over 1 year ago)
- Last Synced: 2025-01-15T21:53:25.332Z (over 1 year ago)
- Language: Swift
- Size: 119 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A simple WebAssembly module that uses JavaScriptKit to manipulate the DOM, built with SwiftPM in Embedded Swift mode. Inspired by [Simon Leeb, Web App with Embedded Swift - POC demo (2024-10-20)](https://forums.swift.org/t/web-app-with-embedded-swift-poc-demo/75486).
As of 2025-01, you need a current Swift development toolchain to build this, at least on macOS. To run this, build the Wasm binary with `make wasmlib`, then start a local web server with `make server`.
The build steps are documented in the `Makefile`. You’ll probably have to modify them if:
- You’re not on macOS, or
- You are on macOS, but your installed Swift toolchain is not in `~/Library/Developer/Toolchain/swift-latest.xctoolchain`, or
- You don’t have Python installed (used to start a local web server) or you want to use another tool to run a local web server.
This is the resulting web page in the browser:
