stadiamaps / ferrostar

A FOSS navigation SDK built from the ground up for the future
https://stadiamaps.github.io/ferrostar/
Other
91 stars 11 forks source link

Create WASM to JS bindings for OsrmResponseParser #121

Open ianthetechie opened 1 week ago

ianthetechie commented 1 week ago

After doing a minimal test of WASM to JS bindings, I'd suggest this is the first "real" project to attempt.

The OSRM parser is just parsing (string) data into our standardized data model. It's also a full "object", so it should be a good representative of future work.

You'll need to ensure all data models (Route etc.) are accessible from JavaScript as well. It looks like there are two approaches to this. Some things can be exposed with a #[wasm_bindgen] attribute, but others (ex: with collections; probably many of our types) will need to use serde. This page documents how to do it in serde: https://rustwasm.github.io/docs/wasm-bindgen/reference/arbitrary-data-with-serde.html. It's nothing out of the ordinary, and we already conditionally derive this anyways for testing on many types.

Completion criteria: