Skip to content

Support dart2wasm / Flutter --wasm via wasm_ffi 2.4.0 - #2

Merged
vm75 merged 6 commits into
mainfrom
agent/wasm-compat
Sep 3, 2026
Merged

vm75 merged 6 commits into
mainfrom
agent/wasm-compat

Conversation

@vm75

@vm75 vm75 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Summary

Updates universal_ffi to consume wasm_ffi: ^2.4.0 to inherit full WebAssembly compatibility for applications compiled with dart2wasm and Flutter Web --wasm.

References:

  • vm75/wasm_ffi issue #13
  • vm75/wasm_ffi PR #12
  • wasm_ffi 2.4.0

Exact Dependency Change

  • Upgraded wasm_ffi constraint in pubspec.yaml from ^2.3.0 to ^2.4.0.
  • Preserved minimum Dart SDK constraint (^3.10.8).

Production Code Changes

  • No production code changes were required in lib/. The clean facade architecture of universal_ffi seamlessly delegates WebAssembly loading, exports discovery, and 64-bit BigInt marshalling to wasm_ffi 2.4.0 without requiring duplicate wrappers.

Exact Tooling Versions Tested

  • Dart SDK: 3.10.8 (stable) (Tue Jan 27 00:02:04 2026 -0800) on 'linux_x64'
  • Flutter SDK: 3.38.9 (channel stable)
  • Chromium: 151.0.7922.75 Arch Linux
  • Node.js: v25.8.1

Validation Commands Run

dart pub get
dart format --output=none --set-exit-if-changed .
dart analyze
dart test
dart test -p chrome test/web_integration_test.dart
dart pub publish --dry-run
cd example_ffi_plugin/example
flutter analyze
flutter build web
flutter build web --wasm
node ../../tool/browser_smoke.mjs build/web

Runtime Test Results

  • Flutter Web (dart2js): PASS. Both emscripten/native_example.js and standalone/native_example.wasm were loaded, looking up functions and successfully executing string conversions, size checks, and C++ static initialization.
  • Flutter Web (--wasm / dart2wasm): PASS. Verified end-to-end function invocation and C++ static init in Chromium headless browser for both standalone Wasm and Emscripten modules.
  • Standalone Wasm: PASS. Verified standalone .wasm function lookup, 32-bit addition, 64-bit BigInt addition, and pointer memory read/writes via FfiHelper.safeUsing.
  • Emscripten Regression: PASS. Verified Emscripten JavaScript glue module resolution and invocation without regressions.
  • Native VM: PASS. Verified Linux dynamic library loading and function calls via FfiHelper.

CI Changes

  • Fixed root-package CHANGELOG inspection path in .github/workflows/publish.yml so validation is not skipped.
  • Added .github/workflows/ci.yml for automated PR and push validation across formatting, analysis, VM tests, package dry-run, and Flutter Web (dart2js & --wasm) builds.

Version and CHANGELOG

  • Bumped package version to 1.5.1 in pubspec.yaml.
  • Updated CHANGELOG.md with 1.5.1 release notes.
  • Updated README.md and AGENTS.md.

Package Publication

  • No package was published as part of this PR.

@vm75
vm75 merged commit 324555f into main Sep 3, 2026
1 check 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