Add a WebAssembly front end (ElementaryUI + JavaScriptKit)#5
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a browser / WebAssembly front end (
Web/) built with ElementaryUI and JavaScriptKit, reusing the existingFuelingModelStore, view-model logic, andCoreFuelingentities unchanged — only the transport, persistence, and view layers are new. Mirrors the standalone-package approach already used forAndroid/, so the wasm-only dependency graph never touches the Darwin/Android/test builds.Root package
CoreModel2.10.0 (bringsInMemoryModelStorage+FetchRequest.evaluate).InMemoryStore— a@MainActorbackend that is bothModelStorageandViewContextover one dictionary — plus aStore(inMemory:)initializer. SQLite's SQLCipher C code can't compile forwasm32, so this is the browser's persistence layer (also handy for previews/tests).CoreModelSQLite/SQLiteandHTTPTypesFoundation/URLSessionout of wasm (sqlitePlatforms/urlSessionPlatformsin the manifest,#if canImport(CoreModelSQLite)and!os(WASI)source guards). Android and Apple builds are unchanged.InMemoryStoreTestscovering read-back, fuel-price queries, and partial-update semantics.Web target
FetchHTTPClient— anHTTPClienttransport over the browserfetchAPI (the wasm counterpart toURLSession/ the Android JNI client).FuelingStore— an ElementaryUI@Reactivecoordinator bridging the stdlib-@ObservableStoreinto ElementaryUI's reactivity.@elementary-swift/vite-plugin-swift-wasm,useEmbeddedSDK: false→ full-Foundation WASI SDK), with the ElementaryUI browser runtime vendored (not published to npm).Testing
Scripts/test-server.py: locations list, search, and per-location detail with correct addresses and fuel prices.Run