Conversation
dh0er
marked this pull request as ready for review
June 1, 2026 21:58
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
This adds clean
dart2wasmsupport for the web build while keeping the existing standalone.wasmasset flow.The package now uses the current
universal_ffirelease line for web FFI support and avoids package-local Dart code generation for Wasm function signatures. The Wasm asset is built as a standalone module and the asset saver uses an explicit typed lookup for thewrite_filebridge.Dependency
This depends on the standalone Wasm function export fix in dh0er/wasm_ffi#2. Without that
wasm_ffichange, standalone Wasm exports are surfaced asJSFunctionunderdart2wasmand cannot be invoked through the existinglookupFunction/asFunctionpath reliably.Changes
3.10.8.universal_ffito^1.5.0.assets/sweph.wasmas standalone Wasm with explicit standalone/web-worker flags.-DNO_SWE_GLPfor the Wasm build so Swiss Ephemeris does not depend on native library-path behavior.write_filebridge for web asset loading.lookup<NativeFunction<...>>(...).asFunction<...>()explicitly.Sweph.init/ web asset loading shape intact.Validation
dart pub getflutter pub getinexample/dart analyzemake wasmflutter build web --wasminexample/Sweph Version: 2.10.03flutter build webinexample/git diff --checkNote
Medium Risk
Touches the Wasm build pipeline and FFI boundary for ephemeris file loading on web; behavior was validated manually but depends on external wasm_ffi export fixes.
Overview
Adds dart2wasm-compatible web support by building
assets/sweph.wasmas a standalone module (no Emscripten JS shell), with-DNO_SWE_GLP, a stubbedgetenv, and an exportedwrite_filebridge for in-memory ephemeris assets.The Dart side bumps the SDK floor to 3.10.8, upgrades
universal_ffito ^1.5.0, and fixes the web asset saver to use typedlookup<NativeFunction<...>>().asFunction()andPointer<Uint8>when callingwrite_fileand freeing WASM memory. Examples usetextContenton the DOM API;Utf8Pointer.toDartStringis a small refactor only.Reviewed by Cursor Bugbot for commit e6ffdbd. Bugbot is set up for automated code reviews on this repo. Configure here.