busstoptaktik / geodesy

Rust geodesy
Apache License 2.0
66 stars 6 forks source link

add js feature for compiling in wasm #36

Closed kylebarron closed 1 year ago

kylebarron commented 1 year ago

This compiles to wasm for me with:

cargo build --features js --target wasm32-unknown-unknown

I think it should be possible to have this work automatically by adding

# enable js feature for uuid to work in wasm
[target.'cfg(target_family = "wasm")'.dependencies.uuid]
features = ["js"]

(source in polars' Cargo.toml)

But when I run that Cargo tells me:

warning: dependency (uuid) specified without providing a local path, Git repository, or version to use. This will be considered an error in future versions

so maybe you need something more complex, like separating uuid into "in-wasm" and "out-of-wasm"

busstoptaktik commented 1 year ago

so maybe you need something more complex, like separating uuid into "in-wasm" and "out-of-wasm"

Maybe, but for now, to get the wasm-ball rolling, I'll merge your contribution and thank you for this small, but notable step!