Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine the general approach for WASM to JS binding generation + demonstrate with a simple function export #101

Closed
2 tasks done
ianthetechie opened this issue May 2, 2024 · 1 comment
Assignees

Comments

@ianthetechie
Copy link
Contributor

ianthetechie commented May 2, 2024

  • Task 1: determine what we will use for binding generation. I mentioned on our first intro call that wasm-bindgen seems the likely candidate, but feel free to do some research on alternatives.
  • Task 2: demonstrate that it works with a simple function export and a test page using Javascript to call the WASM function. (Note that this test code doesn't need to be merged into the project, but we do need to have a quick demo + code to verify that the approach works).
@ianthetechie ianthetechie converted this from a draft issue May 2, 2024
@ianthetechie ianthetechie moved this from Todo to In Progress in Ferrostar on the Web (GSoC '24) Jun 14, 2024
@ianthetechie
Copy link
Contributor Author

I would suggest the following as a path forward once #120 is merged.

First, build a minimal POC: Add an extremely simple function (add two numbers?) to lib.rs and export it with wasm-bindgen. Then build a very simple webpage that loads the module and calls the function with JS and does a console log or something. It does not have to be pretty; just demonstrate that it's working.

I would suggest using a conditional dependency and attributes as shown at the end of this page: https://rustwasm.github.io/docs/wasm-bindgen/reference/rust-targets.html. This way we keep binary size smaller on other platforms.

From there, I would suggest that OsrmResponseParser is the easiest "real" thing to start with. It is very easy to test, since the core function is parsing string input and parsing it into a Route. I'll create a task for that.

@ianthetechie ianthetechie moved this from In Progress to Done in Ferrostar on the Web (GSoC '24) Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants