Rust's wasm tooling seems to either confine you entirely to Rust while offering some solid packaging possibilities, or lets you interop with Emscripten while abandoning those same opportunities. Is that a correct summary of the state of things?
Right now I'm trying to use Spatialite, a C-based SQLite extension that offers geospatial capabilities, in a Rust-based project. I'd like this project to run in a variety of form factors, and am starting to think that a wasm-based NPM package may be the way to go. Essentially, I need to make it easy to run my higher-level Rust interface, which in turn needs Spatialite, which in turn needs a whole pile of its own dependencies. Currently I have everything compiling to a single wasm binary, including a Yew-based UI, but it increasingly looks like the browser may not be the best execution environment for this project.
Is there any way to use wasm-pack, or some other existing tooling, to build my package with Emscripten and package it for NPM? When I asked about this a while back, wasm-pack and friends were exclusively for wasm32-unknown-unknown.
Alternatively, can I build my lower-level interface library into one wasm library with Emscripten, then somehow link that wasm library to a wrapper that is only compiled with wasm32-unknown-unknown? So the wrapped library would essentially encapsulate all my dependencies and C code, exposing a higher-level interface to those, and the second Rust library would expose an interface to JS while calling the wasm32-unknown-emscripten library?
Thanks for any help.