Compare commits

..

No commits in common. "27efbe8cd06c766d50d05dd6ea812aa8bbe6ae7f" and "2193ec02e80d465b16d9802a8e1ed17cc8a4e367" have entirely different histories.

3 changed files with 3 additions and 9 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
/target

View File

@ -10,3 +10,6 @@ wasm-bindgen = "0.2"
[lib] [lib]
crate-type = ["cdylib"] crate-type = ["cdylib"]
# suppress the lint warning for the #[wasm_bindgen] directive in lib.rs
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['wasm_bindgen']}

View File

@ -2,11 +2,3 @@
A dead-simple, no-bundling, web-servable Rust/WASM/JS template. A dead-simple, no-bundling, web-servable Rust/WASM/JS template.
"Hello, world" style. "Hello, world" style.
For use in the Rust Ludus backend. For use in the Rust Ludus backend.
### Things to remember
* Use `js_sys` and `web_sys` for general JS and Web bindings.
* Ludus, however, speaks in JSON strings and requires a hand-written JS wrapper, which should make the whole JS interop thing much easier.
- For that, we use `serde_json`.
* The canonical reference for all this is https://rustwasm.github.io/wasm-bindgen/introduction.html.
* Look into what thi.ng does with Zig in its WASM packages: https://github.com/thi-ng/umbrella/tree/develop/packages, especially https://github.com/thi-ng/umbrella/tree/develop/packages/wasm-api.
- It's looking like `--target web` is the most appropriate to use in 2024, since they use ES modules and not CommonJS, which is what everything else uses (and necessitates the build step). See https://rustwasm.github.io/wasm-pack/book/commands/build.html.