Skip to content

Add a WebAssembly front end (ElementaryUI + JavaScriptKit)#5

Merged
colemancda merged 25 commits into
masterfrom
wasm/elementary-ui
Jul 23, 2026
Merged

Add a WebAssembly front end (ElementaryUI + JavaScriptKit)#5
colemancda merged 25 commits into
masterfrom
wasm/elementary-ui

Conversation

@colemancda

Copy link
Copy Markdown
Member

Summary

Adds a browser / WebAssembly front end (Web/) built with ElementaryUI and JavaScriptKit, reusing the existing FuelingModel Store, view-model logic, and CoreFueling entities unchanged — only the transport, persistence, and view layers are new. Mirrors the standalone-package approach already used for Android/, so the wasm-only dependency graph never touches the Darwin/Android/test builds.

Root package

  • Require CoreModel 2.10.0 (brings InMemoryModelStorage + FetchRequest.evaluate).
  • Add InMemoryStore — a @MainActor backend that is both ModelStorage and ViewContext over one dictionary — plus a Store(inMemory:) initializer. SQLite's SQLCipher C code can't compile for wasm32, so this is the browser's persistence layer (also handy for previews/tests).
  • Gate CoreModelSQLite/SQLite and HTTPTypesFoundation/URLSession out of wasm (sqlitePlatforms/urlSessionPlatforms in the manifest, #if canImport(CoreModelSQLite) and !os(WASI) source guards). Android and Apple builds are unchanged.
  • New InMemoryStoreTests covering read-back, fuel-price queries, and partial-update semantics.

Web target

  • FetchHTTPClient — an HTTPClient transport over the browser fetch API (the wasm counterpart to URLSession / the Android JNI client).
  • FuelingStore — an ElementaryUI @Reactive coordinator bridging the stdlib-@Observable Store into ElementaryUI's reactivity.
  • ElementaryUI views: a searchable locations list and a location detail screen with live fuel prices.
  • Vite toolchain (@elementary-swift/vite-plugin-swift-wasm, useEmbeddedSDK: false → full-Foundation WASI SDK), with the ElementaryUI browser runtime vendored (not published to npm).

Testing

  • Full suite green on macOS (27 tests, including the SQLite backend).
  • Verified end to end in a browser against Scripts/test-server.py: locations list, search, and per-location detail with correct addresses and fuel prices.

Run

python3 Scripts/test-server.py --port 8080
cd Web && npm install && npm run dev   # http://localhost:5173

@colemancda
colemancda merged commit d636dad into master Jul 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant