d-markey / squadron

Multithreading and worker thread pool for Dart / Flutter, to offload CPU-bound and heavy I/O tasks to Isolate or Web Worker threads.
https://pub.dev/packages/squadron
MIT License
79 stars 0 forks source link

WASM Support #37

Open AlexDochioiu opened 1 month ago

AlexDochioiu commented 1 month ago

Hey @d-markey . Would be great to update squadron to the new dart:js_interop since flutter 3.22.0 added stable wasm support (which doesn't work with dart:html and js/js).

d-markey commented 1 month ago

A little bit of feedback on progress: it will take some time before I publish an update, but I'm getting there!

Debugging is complicated, but I've fixed several issues already. One key finding is compatibility between Dart and Wasm type systems. JavaScript had its caveats, it seems Wasm has even more. E.g. ints posted from the main thread come through as doubles on Wasm side. Careful handling of types will be essential, and this will impact squadron_builder as well.

image