Closed yrashk closed 3 years ago
I've removed WebAssembly builds for now as they aren't working well on GitHub Actions (one seemed to work, and one simply hans). I am thinking to use an external CI to run those. These wasm tests do pass on my computer, so I am inclined to merge this as is.
Solution: abstract
task
and select one right for the targetThe abstraction is located in
crate::sys::task
This maps
spawn
andspawn_blocking
on WASM towasm_bindgen_futures::spawn_local
. The former is perhaps the right choice but it's not perfect forspawn_blocking
that'll actually block.This change introduces a new crate (bpxe-internal-macros) that adds its own
#[bpxe_internal_macros]
attribute that will pick the correct attributes and whatever other necessary setup to run a test on a target.In order to make tests run I had to develop a simplistic single-threaded executor for WASM. It's using a lot of unsafe code, but it seems to work so far.
This change brings some crude JS API for BPXE that allows some experimentation. It can be demoed using examples/bpxe_wasm_demo